Skip to main content

Command Line Options

Options for controlling test output verbosity at run-time.

Description

The µTest++ framework offers flexible control over test-output verbosity, 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
 $ minimal-test one two --reporter=tap
 
 TAP version 14
 # Subtest: Minimal
 
  # Subtest: Check various conditions
  1..0
  ok 1 - Check various conditions # { passed, 2 checks }
 
  1..1
 ok 1 - Minimal # { passed, 2 checks in 1 test case, time: X.XXX ms }
 
 1..1
 # { total: 2 checks passed, 0 failed, in 1 test case, 1 test suite, time: X.XXX ms }

Reporter

By default, the µTest++ output follows the TAP rules.

For compatibility reasons, the proprietary format implemented by the initial releases will also be retained, but it is not recommended for new projects.

If needed, more reporting formats (like JUnit, JSON, etc.) can be added.

To explicitly ask for a specific format:

  • --reporter=tap - the default TAP reporter
  • --reporter=human - the human-readable reporter

Verbosity

By default, µTest++ displays a summary line for each passing test case and full expectation details for each failing one.

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 example is in tests/sources/minimal-test/src/main.cpp.

Verbose mode

In verbose mode, the µTest++ reporter provides detailed output for every expectation, irrespective of whether it passes or fails.

Example
 $ minimal-test one two --verbose --reporter=tap
 
 TAP version 14
 # Subtest: Minimal
 
  # Subtest: Check various conditions
  ok 1 - answer is 42
  ok 2 - condition is true
  1..2
  ok 1 - Check various conditions # { passed, 2 checks }
 
  1..1
 ok 1 - Minimal # { passed, 2 checks in 1 test case, time: X.XXX ms }
 
 1..1
 # { total: 2 checks passed, 0 failed, in 1 test case, 1 test suite, time: X.XXX ms }

Quiet mode

In quiet mode, the µTest++ reporter displays only the overall session totals.

Example
 $ minimal-test one two --quiet --reporter=tap
 
 TAP version 14
 
 1..0
 # { total: 2 checks passed, 0 failed, in 1 test case, 1 test suite, time: X.XXX ms }

Silent mode

In silent mode, the µTest++ reporter suppresses all output, and the framework returns only the exit code.


Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.