Skip to content

Reports

Elwardi edited this page Oct 12, 2025 · 4 revisions

Generate Test Reports

Catch2 is capable of generating reports in many formats. foamUT v2.0.0 provides the --report flag to automatically generate JSON reports.

Using the --report flag

Generate JSON reports with a single flag:

# Generate reports for serial tests
./foamut --report

# Generate reports for parallel tests
./foamut --parallel --report

Reports are generated in the reports/ directory with the following structure:

  • One report per OpenFOAM case and library
  • Serial reports: reports/{libName}_{caseName}_serial.json
  • Parallel reports: reports/{libName}_{caseName}_parallel/ (one per process)

The reports include:

  • Catch2 version information
  • OpenFOAM version information
  • Test results, assertions, and timing data

Custom Catch2 Reporters

You can also use Catch2's built-in reporters directly:

# XML format
./foamut -r xml::out=output.xml

# JUnit format (for CI integration)
./foamut -r junit::out=junit.xml

# Console with colors
./foamut -r console::out=console.txt

See Catch2 reporters documentation for all available formats.

CI/Automation Usage

In CI environments, generate and store reports as artifacts:

# Run tests and generate reports
./foamut --report
./foamut --parallel --report

# Reports are in reports/ directory
# Upload them as CI artifacts for later analysis

Legacy HTML Reports

Note: The legacy Alltest.report script and XML/XSLT conversion are deprecated in v2.0.0. Use --report for JSON output or Catch2's native reporters for other formats.

Example of legacy HTML report: file

Clone this wiki locally