mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
Merge pull request #10143 from fricklerhandwerk/test-help
add tests for showing help
This commit is contained in:
commit
6b976a1898
@ -24,6 +24,7 @@
|
|||||||
, libgit2
|
, libgit2
|
||||||
, libseccomp
|
, libseccomp
|
||||||
, libsodium
|
, libsodium
|
||||||
|
, man
|
||||||
, lowdown
|
, lowdown
|
||||||
, mdbook
|
, mdbook
|
||||||
, mdbook-linkcheck
|
, mdbook-linkcheck
|
||||||
@ -213,6 +214,7 @@ in {
|
|||||||
git
|
git
|
||||||
mercurial
|
mercurial
|
||||||
openssh
|
openssh
|
||||||
|
man # for testing `nix-* --help`
|
||||||
] ++ lib.optionals (doInstallCheck || enableManual) [
|
] ++ lib.optionals (doInstallCheck || enableManual) [
|
||||||
jq # Also for custom mdBook preprocessor.
|
jq # Also for custom mdBook preprocessor.
|
||||||
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
||||||
|
69
tests/functional/help.sh
Normal file
69
tests/functional/help.sh
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
source common.sh
|
||||||
|
|
||||||
|
clearStore
|
||||||
|
|
||||||
|
# test help output
|
||||||
|
|
||||||
|
nix-build --help
|
||||||
|
nix-shell --help
|
||||||
|
|
||||||
|
nix-env --help
|
||||||
|
nix-env --install --help
|
||||||
|
nix-env --upgrade --help
|
||||||
|
nix-env --uninstall --help
|
||||||
|
nix-env --set --help
|
||||||
|
nix-env --set-flag --help
|
||||||
|
nix-env --query --help
|
||||||
|
nix-env --switch-profile --help
|
||||||
|
nix-env --list-generations --help
|
||||||
|
nix-env --delete-generations --help
|
||||||
|
nix-env --switch-generation --help
|
||||||
|
nix-env --rollback --help
|
||||||
|
|
||||||
|
nix-store --help
|
||||||
|
nix-store --realise --help
|
||||||
|
nix-store --serve --help
|
||||||
|
nix-store --gc --help
|
||||||
|
nix-store --delete --help
|
||||||
|
nix-store --query --help
|
||||||
|
nix-store --add --help
|
||||||
|
nix-store --add-fixed --help
|
||||||
|
nix-store --verify --help
|
||||||
|
nix-store --verify-path --help
|
||||||
|
nix-store --repair-path --help
|
||||||
|
nix-store --dump --help
|
||||||
|
nix-store --restore --help
|
||||||
|
nix-store --export --help
|
||||||
|
nix-store --import --help
|
||||||
|
nix-store --optimise --help
|
||||||
|
nix-store --read-log --help
|
||||||
|
nix-store --dump-db --help
|
||||||
|
nix-store --load-db --help
|
||||||
|
nix-store --print-env --help
|
||||||
|
nix-store --generate-binary-cache-key --help
|
||||||
|
|
||||||
|
nix-channel --help
|
||||||
|
nix-collect-garbage --help
|
||||||
|
nix-copy-closure --help
|
||||||
|
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
|
||||||
|
nix $cmd --help
|
||||||
|
done
|
@ -129,7 +129,8 @@ nix_tests = \
|
|||||||
read-only-store.sh \
|
read-only-store.sh \
|
||||||
nested-sandboxing.sh \
|
nested-sandboxing.sh \
|
||||||
impure-env.sh \
|
impure-env.sh \
|
||||||
debugger.sh
|
debugger.sh \
|
||||||
|
help.sh
|
||||||
|
|
||||||
ifeq ($(HAVE_LIBCPUID), 1)
|
ifeq ($(HAVE_LIBCPUID), 1)
|
||||||
nix_tests += compute-levels.sh
|
nix_tests += compute-levels.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user