Command-Line Reference

All flags are passed directly to the test executable:

./my_tests [flags...]

Run ./my_tests -h to print the built-in help screen (also lists any plugin-provided flags).

Query Flags (do not run tests)

-h

Print help screen and exit.

-lg

Print all group names, space-separated.

-ln

Print all test names as group.name, space-separated.

-ll

Print test locations as group.name.file.line.

-lo

Print ordered test locations as group.name.file.line.

-lgl

Print group source locations as group.file.line. Each entry points to the TEST_GROUP declaration rather than an individual test.

Output Flags

-c

Colorize output: green for pass, red for fail.

-v

Verbose: print each test name as it runs.

-vv

Very verbose: print internal framework state.

Plugin Flags

Plugin flags begin with -p. The plugin must be installed in main() to parse them.

-p<plugin>

Invoke the named plugin flag. Each plugin registered in main() receives every -p-prefixed argument and may act on flags it recognises.

-pjunit

Write JUnit XML output files (requires JUnitOutputPlugin). See JUnit XML Output.

-ptap

Write TAP version 13 output to stdout (requires TapOutputPlugin). See TAP Output.

Filter Flags

Multiple filter flags can be combined; all must match for a test to run.

Include filters (substring match by default)

-g <group>

Run tests whose group name contains <group>.

-n <name>

Run tests whose test name contains <name>.

-t <group>.<name>

Run tests whose group contains <group> and name contains <name>.

Include filters (exact match)

-sg <group>

Run tests whose group exactly equals <group>.

-sn <name>

Run tests whose test name exactly equals <name>.

-st <group>.<name>

Run tests where both group and name exactly equal the given values.

Exclude filters (substring match)

-xg <group>

Exclude tests whose group contains <group>.

-xn <name>

Exclude tests whose name contains <name>.

-xt <group>.<name>

Exclude tests whose group and name both contain the respective substrings.

Exclude filters (exact match)

-xsg <group>

Exclude tests whose group exactly equals <group>.

-xsn <name>

Exclude tests whose name exactly equals <name>.

-xst <group>.<name>

Exclude tests where both group and name exactly equal the given values.

Copy-paste filter

Verbose output (-v) prints lines like TEST(Widget, CanBeSet). You can paste this directly on the command line to run only that test:

./my_tests "TEST(Widget, CanBeSet)"
./my_tests "SKIPPED_TEST(Widget, Skipped)"

This performs an exact match on both group and name.

Execution Flags

-b

Run tests in reverse registration order.

-s [seed]

Shuffle test execution order randomly. Optional seed (integer > 0) makes the order reproducible; if omitted, seed is time-based and printed to console.

-r[#]

Repeat the full test suite # times. If # is omitted, repeats twice. Useful for detecting order-dependent failures.

-rs

Run skipped tests (SKIPPED_TEST) as if they were normal tests.

-f

Crash on first failure instead of continuing (useful with a debugger).

-e

Do not rethrow unexpected exceptions as failures (catch and continue).