From 37dd69b44511dc73eb04bdebe8d82c9a0386338e Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Apr 2023 00:11:27 -0500 Subject: tests: Fix checks for expected failures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses . With 'set -e', a return status inverted with '!' does not cause the shell to exit immediately. Instead use '&& false' to indicate an expected failure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès --- tests/guix-package-aliases.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/guix-package-aliases.sh') diff --git a/tests/guix-package-aliases.sh b/tests/guix-package-aliases.sh index 311838b768..f68d24b9a7 100644 --- a/tests/guix-package-aliases.sh +++ b/tests/guix-package-aliases.sh @@ -36,7 +36,7 @@ guix install --bootstrap guile-bootstrap -p "$profile" test -x "$profile/bin/guile" # Make sure '-r' isn't passed as-is to 'guix package'. -! guix install -r guile-bootstrap -p "$profile" --bootstrap +guix install -r guile-bootstrap -p "$profile" --bootstrap && false test -x "$profile/bin/guile" # Use a package transformation option and make sure it's recorded. @@ -48,16 +48,16 @@ grep "libreoffice=inkscape" "$profile/manifest" guix upgrade --version guix upgrade -n guix upgrade gui.e -n -! guix upgrade foo bar -n; +guix upgrade foo bar -n && false guix remove --version guix remove --bootstrap guile-bootstrap -p "$profile" -! test -x "$profile/bin/guile" +test ! -x "$profile/bin/guile" test `guix package -p "$profile" -I | wc -l` -eq 0 -! guix remove -p "$profile" this-is-not-installed --bootstrap +guix remove -p "$profile" this-is-not-installed --bootstrap && false -! guix remove -i guile-bootstrap -p "$profile" --bootstrap +guix remove -i guile-bootstrap -p "$profile" --bootstrap && false guix search '\' game | grep '^name: gnubg' @@ -66,7 +66,7 @@ guix show guile guix show python@3 | grep "^name: python" # "python@2" exists but is deprecated; make sure it doesn't show up. -! guix show python@2 +guix show python@2 && false # Specifying multiple packages. output="`guix show sed grep | grep ^name:`" -- cgit v1.2.3