From a329839346a3c2c9591985b70841858dd575846f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Jun 2013 22:02:21 -0600 Subject: add a system to skip tests that require networking or sudo. --- test/libremakepkg-test.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/libremakepkg-test.sh') diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh index 9e54fb6..94249a9 100644 --- a/test/libremakepkg-test.sh +++ b/test/libremakepkg-test.sh @@ -2,19 +2,22 @@ describe libremakepkg +. ./test-common.sh + before() { - tmpdir=$(mktemp -d --tmpdir test-libremakepkg.XXXXXXXXXXXX) + _before libremakepkg + mkdir -p "$XDG_CONFIG_HOME"/libretools echo "CHROOTDIR='$tmpdir/chrootdir'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOT='default'" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf - stat=0 } after() { - rm -rf -- "$tmpdir" "$XDG_CONFIG_HOME" + _after } it_builds_a_trivial_package() { + require network sudo || return 0 cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD" cd "$tmpdir" -- cgit v1.2.2