How do I enable test logging?
Test logging is off by default for performance. The conceptual description lives in CMake setup§"Test logging"; this recipe is the operational counterpart. To actually run the tests once logging is configured, see How do I run the tests?.
Question
How do I enable test logging — choose a level — and turn it back off when I'm done?
Answer
Test logging is controlled by three ORES_TEST_LOG_* variables in
.env. The root CMakeLists.txt forwards every .env variable
verbatim to test processes, and .env is a CMake configure
dependency, so any change is picked up automatically on the next
build or test run — no manual re-configure needed.
The compass test pillar provides the toggle:
Enable — defaults to
debug; pass a level (trace,debug,info,warn,error) to override:./compass.sh test logging on ./compass.sh test logging on trace
This appends a
# Test loggingblock to.envsettingORES_TEST_LOG_ENABLED=true,ORES_TEST_LOG_LEVEL=<level>andORES_TEST_LOG_CONSOLE=true.Disable — strips the block; absence means disabled:
./compass.sh test logging off
Inspect — show the current settings:
./compass.sh test logging status
One-off override — the same variables can be set in the process environment for a single run without touching
.env(the runtime listener inores.testingreads them directly):ORES_TEST_LOG_ENABLED=true \ ORES_TEST_LOG_LEVEL=trace \ ORES_TEST_LOG_CONSOLE=true \ ctest --preset linux-clang-debug-ninja
compass env init --enable-logging [level] and --disable-logging
remain as aliases for the same operation.
Script
compass test logging in projects/ores.compass/src/compass.py,
delegating to _logging_only in env_init.py.
Tested by
Manual. The flags are consumed inside the per-component
CMakeLists.txt test targets and read at runtime by the test
harness; no dedicated CI check exercises them.
See also
- CMake setup§"Test logging" — the architectural description of the two switches and their defaults.
- How do I run the tests? — the run loop into which this logging feeds.
- How do I configure the project? — for the configure step generally.