1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #11900 from DeterminateSystems/fix-help-test

Fix help test in dev shell
This commit is contained in:
Eelco Dolstra 2025-01-23 15:20:34 +01:00 committed by GitHub
commit 261b213272
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 21 deletions

View file

@ -2,6 +2,31 @@
source common.sh 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 # test help output
nix-build --help nix-build --help
@ -49,22 +74,3 @@ nix-daemon --help
nix-hash --help nix-hash --help
nix-instantiate --help nix-instantiate --help
nix-prefetch-url --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

View file

@ -242,8 +242,6 @@ foreach suite : suites
# Used for target dependency/ordering tracking, not adding compiler flags or anything. # Used for target dependency/ordering tracking, not adding compiler flags or anything.
depends : suite['deps'], depends : suite['deps'],
workdir : workdir, workdir : workdir,
# Won't pass until man pages are generated
should_fail : suite['name'] == 'main' and script == 'help.sh'
) )
endforeach endforeach
endforeach endforeach