summaryrefslogtreecommitdiff
path: root/test/libremakepkg-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/libremakepkg-test.sh')
-rw-r--r--test/libremakepkg-test.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/libremakepkg-test.sh b/test/libremakepkg-test.sh
index 0482638..58adcca 100644
--- a/test/libremakepkg-test.sh
+++ b/test/libremakepkg-test.sh
@@ -72,10 +72,10 @@ it_cleans_the_chroot_before_building() {
libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
cd "$tmpdir/1"
- testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; }
+ testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { status=$?; tail "$tmpdir/out"|cat -v; return $status; }
cd "$tmpdir/2"
- testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; }
+ testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { status=$?; tail "$tmpdir/out"|cat -v; return $status; }
testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'first time, pass'
# This next line is actually a separate test, but it fits in well with this test, and chroot tests are slow..
@@ -83,7 +83,7 @@ it_cleans_the_chroot_before_building() {
not testsudo librechroot -l "$roundup_test_name" run test -e /var/cache/pacman/pkg/libretools-testpkg1-1.0-1-any.pkg.tar.?z
cd "$tmpdir/3"
- testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { r=$?; tail "$tmpdir/out"|cat -v; return $r; }
+ testsudo libremakepkg -l "$roundup_test_name" &> "$tmpdir/out" || { status=$?; tail "$tmpdir/out"|cat -v; return $status; }
not testsudo librechroot -l "$roundup_test_name" run libretools-testpkg1 'second time, fail'
}
@@ -110,11 +110,10 @@ it_otherwise_fails_as_normal_user() {
# I do this to give it a chance of passing
cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD"
cd "$tmpdir"
- local stat=0
- libremakepkg >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
+ libremakepkg >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
- [[ $stat != 0 ]]
+ [[ $status != 0 ]]
empty $tmpdir/stdout
not empty $tmpdir/stderr
}
@@ -123,15 +122,14 @@ it_fails_if_a_hook_fails() {
require network sudo || return 0
cp libremakepkg.d/PKGBUILD-hello "$tmpdir/PKGBUILD"
cd "$tmpdir"
- local stat=0
sed -i 's/^BLACKLIST=.*/&-bogus/' "$XDG_CONFIG_HOME"/libretools/libretools.conf
trap 'sed -i s/-bogus// "$XDG_CONFIG_HOME"/libretools/libretools.conf' RETURN
libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
- testsudo libremakepkg -l "$roundup_test_name" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
+ testsudo libremakepkg -l "$roundup_test_name" >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
- [[ $stat != 0 ]]
+ [[ $status != 0 ]]
tail -n1 $tmpdir/stderr | grep -qF '==> ERROR: Failure(s) in check_pkgbuild: check_pkgbuild_nonfree'
}
@@ -152,8 +150,8 @@ it_detects_distcc_files() {
# now throw a wrench in it
testsudo librechroot -l "$roundup_test_name" run touch /bin/distcc-tool
# and make sure that the engine broke
- testsudo libremakepkg -l "$roundup_test_name" || stat=$?
- [[ $stat != 0 ]]
+ testsudo libremakepkg -l "$roundup_test_name" || status=$?
+ [[ $status != 0 ]]
not [[ -f $(echo libretools-hello-1.0-1-any.pkg.tar.?z) ]]
}