Skip to content

Commit

Permalink
test: Use skipTest instead of exit 0
Browse files Browse the repository at this point in the history
This way shellcheck is ok with it, and it conveys that a significant
chunk of the test is skipped.

(cherry picked from commit 414c346)

# Conflicts:
#	tests/functional/help.sh
  • Loading branch information
roberth authored and mergify[bot] committed Feb 7, 2025
1 parent cd4d9ca commit 7ecc994
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/functional/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@

source common.sh

<<<<<<< HEAD
=======
function subcommands() {
jq -r '
def recurse($prefix):
to_entries[] |
($prefix + [.key]) as $newPrefix |
(if .value | has("commands") then
($newPrefix, (.value.commands | recurse($newPrefix)))
else
$newPrefix
end);
.args.commands | recurse([]) | join(" ")
'
}

nix __dump-cli | subcommands | while IFS= read -r cmd; do
# shellcheck disable=SC2086 # word splitting of cmd is intended
nix $cmd --help
done

[[ $(type -p man) ]] || skipTest "'man' not installed"

# FIXME: we don't know whether we built the manpages, so we can't
# reliably test them here.
skipTest "we don't know whether we built the manpages, so we can't reliably test them here."

>>>>>>> 414c34656 (test: Use skipTest instead of exit 0)
# test help output

nix-build --help
Expand Down Expand Up @@ -49,6 +77,7 @@ nix-daemon --help
nix-hash --help
nix-instantiate --help
nix-prefetch-url --help
<<<<<<< HEAD

function subcommands() {
jq -r '
Expand All @@ -68,3 +97,5 @@ nix __dump-cli | subcommands | while IFS= read -r cmd; do
# shellcheck disable=SC2086 # word splitting of cmd is intended
nix $cmd --help
done
=======
>>>>>>> 414c34656 (test: Use skipTest instead of exit 0)

0 comments on commit 7ecc994

Please sign in to comment.