1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

tests: Fix checks for expected failures.

Addresses <https://issues.guix.gnu.org/62406>.

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 <ludo@gnu.org>
This commit is contained in:
Eric Bavier
2023-04-20 00:11:27 -05:00
committed by Ludovic Courtès
parent a09c7da8f8
commit 37dd69b445
21 changed files with 117 additions and 109 deletions

View File

@@ -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 '\<board\>' 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:`"