diff --git a/tests/functional/help.sh b/tests/functional/help.sh index 127cc455b..2d64c465d 100755 --- a/tests/functional/help.sh +++ b/tests/functional/help.sh @@ -2,6 +2,31 @@ source common.sh +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. +exit 0 + # test help output nix-build --help @@ -49,22 +74,3 @@ nix-daemon --help nix-hash --help nix-instantiate --help nix-prefetch-url --help - -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 diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 83e08c4f5..dee003e42 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -242,8 +242,6 @@ foreach suite : suites # Used for target dependency/ordering tracking, not adding compiler flags or anything. depends : suite['deps'], workdir : workdir, - # Won't pass until man pages are generated - should_fail : suite['name'] == 'main' and script == 'help.sh' ) endforeach endforeach