Export Coverage Results

Based on single-file templates, coverage results from Testwell CTC++ can be reported in any text based format. You can adapt one of the example templates delivered or generate a new one.

With this approach, you can provide

  • high-level coverage for dashboards,
  • text reports to be easily managed in a code repository,
  • hierarchically structured exchange formats like XML or JSON for further processing to third-party tools.

Example: CSV reports

With option -template example_csv in your ctcreport call, you get a CSV report with coverage information per function:
File, Function, MC/DC Hits, MC/DC Total, MC/DC Coverage Ratio, Statement Hits, Statement Total, Statement Coverage Ratio
FLTK\fluid\code.cxx, is_id, 2, 2, 100%, 1, 1, 100%
FLTK\fluid\code.cxx, id::id, 2, 2, 100%, 1, 1, 100%
FLTK\fluid\code.cxx, id::~id, 0, 2, 0%, 0, 3, 0%
FLTK\fluid\code.cxx, unique_id, 24, 28, 85%, 29, 29, 100%
FLTK\fluid\code.cxx, indent, 4, 6, 66%, 5, 7, 71%
...

This template works for every combination of coverage measures chosen with -measure ….

You can copy and adapt the underlying template example_csv.csv from ctcreport folder, for example regarding field separator, field order, or detail level.

See Reporting Templates for details about the template structure.