Options for controlling test output verbosity at run-time.
Description
The µTest++ framework provides flexible command-line options to control the verbosity of test output, allowing users to tailor the level of detail to their specific requirements and workflow.
By default, the reporter presents detailed results only for failed test cases, while successful test cases are summarised in a single line, indicating the total number of passed and failed checks.
- Example
test 1
Start 1: minimal-test
1: Test command:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin/minimal-test
"one" "two" 1: Working Directory:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin
1: Test timeout computed to be: 10000000
1: Built with clang Apple LLVM 15.0.0 (clang-1500.0.40.1), with exceptions.
1:
1: • Minimal - test suite started
1:
1: ✓ Check various conditions - test case passed (2 checks)
1:
1: ✓ Minimal - test suite passed (2 checks in 1 test case)
1/12 Test #1: minimal-test ..................... Passed 0 sec
Verbosity
To adjust the verbosity, the following command-line options are available:
--verbose
– display all expectations, regardless of outcome--quiet
– display only the test suite totals--silent
– suppress all output and return only the exit code
These options enable developers to focus on the information most relevant to their needs, whether that is comprehensive diagnostics during development or succinct summaries for automated builds.
The examples provided illustrate the output produced in each mode, demonstrating how µTest++ adapts its reporting to support professional and efficient testing workflows across all files and folders.
The source code for this test is located in the tests/src/minimal-test.cpp
file.
Verbose mode
In verbose mode, the µTest++ reporter provides detailed output for every expectation, irrespective of whether it passes or fails.
- Example
test 2
Start 2: minimal-test --verbose
2: Test command:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin/minimal-test
"one" "two" "--verbose" 2: Working Directory:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin
2: Test timeout computed to be: 10000000
2: Built with clang Apple LLVM 15.0.0 (clang-1500.0.40.1), with exceptions.
2:
2: • Minimal - test suite started
2:
2: • Check various conditions - test case started
2: ✓ answer is 42
2: ✓ condition is true
2: ✓ Check various conditions - test case passed (2 checks)
2:
2: ✓ Minimal - test suite passed (2 checks in 1 test case)
2/12 Test #2: minimal-test --verbose ........... Passed 0 sec
Quiet mode
In quiet mode, the µTest++ reporter displays only the overall totals for the test suite.
- Example
test 3
Start 3: minimal-test --quiet
3: Test command:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin/minimal-test
"one" "two" "--quiet" 3: Working Directory:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin
3: Test timeout computed to be: 10000000
3:
3: ✓ Minimal - test suite passed (2 checks in 1 test case)
3/12 Test #3: minimal-test --quiet ............. Passed 0 sec
Silent mode
In silent mode, the µTest++ reporter suppresses all output, and the framework returns only the exit code.
- Example
test 4
Start 4: minimal-test --silent
4: Test command:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin/minimal-test
"one" "two" "--silent" 4: Working Directory:
/Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git/tests/build/native-cmake-sys-release/platform-bin
4: Test timeout computed to be: 10000000
4:
4/12 Test #4: minimal-test --silent ............ Passed 0 sec
Generated via docusaurus-plugin-doxygen by Doxygen 1.14.0.