rux test
Purpose
Run package unit tests
Synopsis
rux test [options] [-- <test arguments>...]
Behavior
Discovers the executable packages under Tests/ and every package whose sources mark functions #Test(), builds them with test mode enabled, and runs them; a package of #Test() functions with no Main gets a generated runner. Arguments after -- go to every test program, whose runner reads each plain argument as a name filter and runs the tests any of them matches: rux test -- Parser Words runs the tests whose names contain Parser or Words, and --exact, --skip, --list and --quiet refine that. A package with no test the filters match is reported as skipped, and the run fails when no package had one, so a misspelt name never passes with nothing run. Given arguments, each package's report is shown even when it passed, which is how rux test -- --list lists the tests. Up to --jobs test packages run at once, one per logical core by default. Workspaces include root and member test trees. --define and --release apply consistently to every test target.
Arguments
This command accepts no operands.
Options
| Option | Description |
|---|---|
--jobs <N> | Run up to N test packages concurrently (default: one per logical core) |
--define <name[=value]> | Set or override a config compile-time value |
--no-cache | Compile every test package even when an earlier build is still up to date |
--release | Build with release profile |
--target <triple> | Build and run the tests for the specified target platform |
Global options may appear before or after the command. See Global options.
Output and exit status
A summary counting test packages is written to stdout; compiler diagnostics and failed test details identify unsuccessful targets. The command returns 1 when any build or test fails, or when filters matched no test in any package.
Success exits 0, invalid command-line usage exits 2, and compiler, validation, filesystem, network, or generation failures exit 1 unless stated otherwise above.
Examples
rux test
rux test --release
rux test -- Parser
rux test -- --exact Parser::ReadsNumbers
Environment variables
This command defines no command-specific environment variables.
The global color environment behavior is described under Global options.