click-extra test-suite - Run declarative CLI test cases against a
command or binary.
click-extra test-suite [OPTIONS]
Run declarative CLI test cases against a command or binary.
Resolves the suite by precedence: --suite-file or --suite-envvar,
then the [tool.click-extra.test-suite] config (cases, then file), then a
built-in default. Each case invokes the target with its parameters and
checks the exit code and output.
Cases run in parallel by default (see --jobs): each is an
independent process invocation, so they overlap well. Pass --jobs max to use
every logical core, or --jobs 1 for sequential execution, which lets
--exit-on-error stop on the first failure.
On an interactive terminal a spinner reports how many cases have
finished. It stays silent in pipes and CI logs, and --no-progress or
--accessible turns it off.
- --command /
--binary COMMAND
- Path to the binary file to test, or a command line to be executed.
[required]
- -F / --suite-file
FILE
- Path to a test suite file; its format is taken from the extension (YAML,
TOML, JSON, JSON5, JSONC, Hjson). Repeat to run multiple suites in
sequence. Without any suite source, a built-in default suite runs.
- -E / --suite-envvar
ENVVAR_NAME
- Name of an environment variable holding a test suite in YAML. Repeat to
collect multiple suites.
- -t / --select-test
INTEGER
- Only run the cases with these 1-based numbers. Repeat to select several;
omit to run them all.
- -s / --skip-platform
PLATFORM
- Skip cases on these platforms. Repeat to skip several.
[values: aarch64, aix, alacritty, all_agents, all_architectures, all_arm,
all_ci, all_mips, all_platforms, all_shells, all_sparc, all_terminals,
all_traits, all_windows, almalinux, alpine, altlinux, amzn, android,
apple_terminal, arch, arch_32_bit, arch_64_bit, arm, armv5tel, armv6l,
armv7l, armv8l, ash, azure_pipelines, bamboo, bash, big_endian,
bourne_shells, bsd, bsd_without_macos, buildkite, buildroot, c_shells,
cachyos, centos, chromeos, circle_ci, cirrus_ci, claude_code, clearlinux,
cline, cloudlinux, cmd, codebuild, codex, contour, copilot_cli, crush,
csh, cursor, cygwin, dash, debian, dragonfly_bsd, endeavouros, exherbo,
fedora, fish, foot, freebsd, gemini_cli, generic_linux, gentoo, ghostty,
github_ci, gitlab_ci, gnome_terminal, gnu_screen, gpu_terminals, guix,
haiku, hermetic_build, heroku_ci, hurd, hyper, i386, i586, i686,
ibm_mainframe, ibm_powerkvm, illumos, iterm2, kali, kitty, konsole, ksh,
kvmibm, linux, linux_layers, linux_like, linuxmint, little_endian,
loongarch, loongarch64, macos, mageia, mandriva, manjaro, midnightbsd,
mips, mips64, mips64el, mipsel, multiplexers, native_terminals, netbsd,
nixos, nobara, nushell, openbsd, opensuse, openwrt, oracle, os400,
other_posix, other_shells, parallels, pi, pidora, pikaos, powerpc,
powershell, ppc, ppc64, ppc64le, raspbian, rhel, rio, riscv, riscv32,
riscv64, rocky, s390x, scientific, sh, slackware, sles, slitaz, solaris,
sourcemage, sparc, sparc64, sunos, system_v, tabby, tcsh, teamcity, tilix,
tmux, travis_ci, tuxedo, ubuntu, ultramarine, unix, unix_layers,
unix_without_macos, void, vscode_terminal, wasm32, wasm64, web_terminals,
webassembly, wezterm, windows, windows_shells, windows_terminal, wsl1,
wsl2, x86, x86_64, xenserver, xonsh, xterm, zellij, zsh]
- -x /
--exit-on-error
- Exit instantly on the first failed case (sequential runs only).
- -T / --timeout
SECONDS
- Default timeout for each CLI call, unless the case sets its own.
- -W / --work-directory
DIRECTORY
- Directory to run each case's command in. Defaults to the current one.
Moves the command under test, not the runner: suite files are read before
any case starts.
- --show-trace-on-error /
--hide-trace-on-error
- Show the execution trace of failed cases.
- --stats /
--no-stats
- Print the worker summary and the result tally.
- --jobs
[auto|max|INTEGER]
- Number of parallel jobs. Accepts an integer, auto (the host's logical CPUs
minus one) or max (all logical CPUs). --jobs 0 runs sequentially.
- --help /
-h
- Show this message and exit.
- --config
LOCATION
- Location of the configuration file. Supports local path with glob patterns
or remote URL.
- --no-config
- Ignore all configuration files and only use command line parameters and
environment variables.
- --validate-config
LOCATION
- Validate the configuration file and exit.
- --export-config
FORMAT
- Export the configuration in the selected format to <stdout>, then
exit.
[values: toml, yaml, json, json5, jsonc, hjson, xml, plist]
- --accessible
- Accessibility mode: disable colors and render tables in a borderless,
screen-reader-friendly format.
- --color[=auto|always|never]
- Colorize the output. A bare --color is the same as --color=always.
- --no-color
- Disable colorization (alias of --color=never).
- --progress /
--no-progress
- Show progress indicators during long operations. Disabled for
non-interactive output (pipes, dumb terminals, CI) and by
--accessible.
- --theme
[auto|dark|dracula|light|manpage|monokai|nord|solarized-dark]
- Color theme used for help screens.
- --table-format
FORMAT
- Rendering style of tables.
[values: aligned, asciidoc, colon-grid, csv, csv-excel, csv-excel-tab,
csv-unix, double-grid, double-outline, fancy-grid, fancy-outline, github,
grid, heavy-grid, heavy-outline, hjson, html, jira, json, json5, jsonc,
latex, latex-booktabs, latex-longtable, latex-raw, mediawiki, mixed-grid,
mixed-outline, moinmoin, orgtbl, outline, pipe, plain, presto, pretty,
psql, rounded-grid, rounded-outline, rst, simple, simple-grid,
simple-outline, textile, toml, tsv, unsafehtml, vertical, xml, yaml,
youtrack]
- --verbosity
LEVEL
- Either CRITICAL, ERROR, WARNING, INFO, DEBUG.
[values: CRITICAL, ERROR, WARNING, INFO, DEBUG]
- --verbose /
-v
- Increase the default WARNING verbosity by one level for each additional
repetition of the option.
- --quiet /
-q
- Decrease the default WARNING verbosity by one level for each additional
repetition of the option.
- --debug
- Shorthand for --verbosity DEBUG.
- TEST_SUITE_COMMAND
- Path to the binary file to test, or a command line to be executed.
- TEST_SUITE_SUITE_FILE
- Path to a test suite file; its format is taken from the extension (YAML,
TOML, JSON, JSON5, JSONC, Hjson). Repeat to run multiple suites in
sequence. Without any suite source, a built-in default suite runs.
- TEST_SUITE_SUITE_ENVVAR
- Name of an environment variable holding a test suite in YAML. Repeat to
collect multiple suites.
- TEST_SUITE_SELECT_TEST
- Only run the cases with these 1-based numbers. Repeat to select several;
omit to run them all.
- TEST_SUITE_SKIP_PLATFORM
- Skip cases on these platforms. Repeat to skip several.
- TEST_SUITE_EXIT_ON_ERROR
- Exit instantly on the first failed case (sequential runs only).
- TEST_SUITE_TIMEOUT
- Default timeout for each CLI call, unless the case sets its own.
- TEST_SUITE_WORK_DIRECTORY
- Directory to run each case's command in. Defaults to the current one.
Moves the command under test, not the runner: suite files are read before
any case starts.
- TEST_SUITE_SHOW_TRACE_ON_ERROR
- Show the execution trace of failed cases.
- TEST_SUITE_STATS
- Print the worker summary and the result tally.
- TEST_SUITE_JOBS
- Number of parallel jobs. Accepts an integer, auto (the host's logical CPUs
minus one) or max (all logical CPUs). --jobs 0 runs sequentially.
- TEST_SUITE__CLICK_DEFAULT_HELP
- Show this message and exit.
- TEST_SUITE_CONFIG
- Location of the configuration file. Supports local path with glob patterns
or remote URL.
- TEST_SUITE_VALIDATE_CONFIG
- Validate the configuration file and exit.
- TEST_SUITE_EXPORT_CONFIG
- Export the configuration in the selected format to <stdout>, then
exit.
- TEST_SUITE_ACCESSIBLE
- Accessibility mode: disable colors and render tables in a borderless,
screen-reader-friendly format.
- TEST_SUITE_COLOR
- Colorize the output. A bare --color is the same as --color=always.
- TEST_SUITE_NO_COLOR
- Disable colorization (alias of --color=never).
- TEST_SUITE_PROGRESS
- Show progress indicators during long operations. Disabled for
non-interactive output (pipes, dumb terminals, CI) and by
--accessible.
- TEST_SUITE_THEME
- Color theme used for help screens.
- TEST_SUITE_TABLE_FORMAT
- Rendering style of tables.
- TEST_SUITE_VERBOSITY
- Either CRITICAL, ERROR, WARNING, INFO, DEBUG.
- TEST_SUITE_VERBOSE
- Increase the default WARNING verbosity by one level for each additional
repetition of the option.
- TEST_SUITE_QUIET
- Decrease the default WARNING verbosity by one level for each additional
repetition of the option.
- TEST_SUITE_DEBUG
- Shorthand for --verbosity DEBUG.
- TEST_SUITE_TIME
- Measure and print elapsed execution time.
- TEST_SUITE_PARAMS
- Show all CLI parameters, their provenance, defaults and value, then
exit.
- TEST_SUITE_TREE
- Show the tree of nested subcommands and exit.
- TEST_SUITE_MAN
- Read the command's manual page and exit.
- TEST_SUITE_HELP_FORMAT
- Render the command in the given format and exit.
- TEST_SUITE_VERSION
- Show the version and exit.
~/.config/click-extra/{*.toml,*.yaml,*.yml,*.json,*.json5,*.jwcc,*.jsonc,*.hjson,*.ini,*.xml,*.plist,*.sqlite,*.sqlite3,*.conf,pyproject.toml}
- 0
- Success.
- 1
- A runtime error, or an aborted prompt (Ctrl-C, a declined
confirmation).
- 2
- A usage error: unknown option, invalid value, missing operand, or an
unparsable configuration file.