summary refs log tree commit diff
path: root/tests/guix-build.sh
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2020-09-25 11:00:11 -0500
committerEric Bavier <bavier@member.fsf.org>2020-09-28 21:06:36 -0500
commitd8934360d2453a403b5433e71d09188e4ed23b57 (patch)
tree8f65be24496c1cc375bc675ca20e7d126f8d2ed1 /tests/guix-build.sh
parent9380b0a0752d7b922a664e6d96899047cb2f2811 (diff)
downloadguix-d8934360d2453a403b5433e71d09188e4ed23b57.tar.gz
tests: Simplify shell exit status negation;
* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh,
tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh,
tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh,
tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh,
tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh,
tests/guix-package.sh: Use the shell '!' keyword to negate command exit status
in place of 'if ...; then false; else true; fi'
Diffstat (limited to 'tests/guix-build.sh')
-rw-r--r--tests/guix-build.sh22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index ec2f736ccb..6dbb53206e 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -24,8 +24,7 @@
 guix build --version
 
 # Should fail.
-if guix build -e +;
-then false; else true; fi
+! guix build -e +
 
 # Source-less packages are accepted; they just return nothing.
 guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
@@ -178,7 +177,7 @@ cat > "$module_dir/foo.scm" <<EOF
     (inputs (quasiquote (("sed" ,sed))))))  ;unbound variable
 EOF
 
-if guix build package-with-something-wrong -n; then false; else true; fi
+! guix build package-with-something-wrong -n
 guix build package-with-something-wrong -n 2> "$module_dir/err" || true
 grep "unbound" "$module_dir/err"		     # actual error
 grep "forget.*(gnu packages base)" "$module_dir/err" # hint
@@ -222,7 +221,7 @@ test "`guix build --log-file guile-bootstrap`" = "$log"
 test "`guix build --log-file $out`" = "$log"
 
 # Should fail because the name/version combination could not be found.
-if guix build hello-0.0.1 -n; then false; else true; fi
+! guix build hello-0.0.1 -n
 
 # Keep a symlink to the result, registered as a root.
 result="t-result-$$"
@@ -231,8 +230,7 @@ guix build -r "$result"					\
 test -x "$result/bin/guile"
 
 # Should fail, because $result already exists.
-if guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
-then false; else true; fi
+! guix build -r "$result" -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'
 
 rm -f "$result"
 
@@ -270,8 +268,7 @@ drv2=`guix build hello -d --with-input=gcc=gcc-toolchain`
 test "$drv1" != "$drv2"
 guix gc -R "$drv2" | grep `guix build -d gcc-toolchain`
 
-if guix build guile --with-input=libunistring=something-really-silly
-then false; else true; fi
+! guix build guile --with-input=libunistring=something-really-silly
 
 # Deprecated/superseded packages.
 test "`guix build superseded -d`" = "`guix build bar -d`"
@@ -279,10 +276,8 @@ test "`guix build superseded -d`" = "`guix build bar -d`"
 # Parsing package names and versions.
 guix build -n time		# PASS
 guix build -n time@1.9		# PASS, version found
-if guix build -n time@3.2;	# FAIL, version not found
-then false; else true; fi
-if guix build -n something-that-will-never-exist; # FAIL
-then false; else true; fi
+! guix build -n time@3.2	# FAIL, version not found
+! guix build -n something-that-will-never-exist # FAIL
 
 # Invoking a monadic procedure.
 guix build -e "(begin
@@ -354,5 +349,4 @@ export GUIX_BUILD_OPTIONS
 guix build emacs
 
 GUIX_BUILD_OPTIONS="--something-completely-crazy"
-if guix build emacs;
-then false; else true; fi
+! guix build emacs