test#

Build (if needed) and run tests via ctest.

clibra test --preset debug                      # build then run all tests
clibra test --preset debug --type unit          # only unit-labeled tests
clibra test --preset debug --filter '^io_'      # tests matching a regex
clibra test --preset debug --no-build           # skip build, run ctest only

Requires LIBRA_TESTS to be ON in the preset’s CMake cache. clibra test first builds the all-tests target, then runs ctest. Use --no-build to skip the build step and run ctest directly against already-built test binaries.

Selecting tests#

--type filters by test label and accepts all (the default, no filtering), unit, integration, or regression; the non-all values map to ctest -L <label>. --filter <regex> restricts the run to tests whose names match the expression (ctest --tests-regex). The two can be combined.

Run control#

--parallel <N> runs N tests concurrently (defaults to the logical CPU count). --stop-on-failure halts at the first failing test. --rerun-failed runs only the tests that failed on the previous invocation. --valgrind runs the suite under Valgrind’s memcheck tool and requires Valgrind to be installed. -v/--verbose prints the underlying build and test commands.

CMake equivalent#

cmake --build --preset <name> --target all-tests
ctest --preset <name> [--parallel <N>] [-L <label>] [--tests-regex <re>]

Flag reference#

clibra test#

Build (if needed) and run tests via ctest. Requires LIBRA_TESTS=ON in the resolved preset’s CMake cache

Usage: clibra test [OPTIONS]

Options:#

  • --type <TYPE> — Filter by test type. Defaults to no filtering

    Default value: all

    Possible values: all, unit, integration, regression

  • --filter <FILTER> — Run only tests matching this regex (ctest –tests-regex)

  • --stop-on-failure — Stop at the first test failure

  • --rerun-failed — Rerun only failed tests

  • --valgrind — Run all tests under valgrind. Requires valgrind to be installed

  • --parallel <PARALLEL> — Run N tests in parallel. Defaults to # of logical CPUs

    Default value: 4

  • --no-build — Skip the build step; run ctest directly

  • -D <VAR=VALUE> — Forward -DVAR=VALUE to the CMake configure step when active. Ignored (with a warning) if the build directory exists and neither –reconfigure nor –fresh is given

  • -r, --reconfigure — Force the configure step even if the build directory exists

  • -f, --fresh — Reconfigure with a –fresh cmake build directory

  • -v, --verbose — Run the build and/or tests in verbose mode, printing commands