.csexe File Format

While an instrumented AUT is executing, Coco periodically writes coverage data out to a file with .csexe extension. This file is also known as an Execution Report.

The file is human-readable, so you can open it in any text editor and make changes. The file must follow a specific format to be usable by other Coco tools. The type/meaning of each line in the file is determined by the first character of that line. Some line-types are only added by Coco while others can be added to the file by the end-user, either by writing directly to the file or calling functions in the CoverageScanner Library.

.csexe lines generated by Coco

Coco writes out lines that begin with :, \, /, =, and %, which encode the coverage data. These lines should not be modified by the user.

Lines beginning with # are internal comments which do not end up in any coverage report.

.csexe lines that can be manually added by the user

The most common use-case for adding lines to an execution report is when there are multiple named tests executed by a single executable. If this is the case, we need to add special lines to the file that tell Coco the name of the each test (before the coverage data), and the test result (after the coverage data).

First CharacterDescriptionCoverageScanner Library Function
*Test Case/Execution Name__coveragescanner_testname
<Comments in HTML that go into the test report (should appear before the !status line).__coveragescanner_add_html_comment
!Test Status/Result (PASSED|FAILED|INCIDENT|SKIPPED|CHECK_MANUALLY)__coveragescanner_teststate

Note that the library functions only set the value in memory. To write these data and the coverage data to the file, __coveragescanner_save also has to be called. For more information on using the library functions, see Support for Testing Frameworks.

Example

Here is a snippet of a .csexe file with multiple test cases.

*CppUnit/ParserTest/testAddVariable10000

# Measurements
=4.177096134
/32:1613022920:/usr/local/squish/coco/samples/parser/parser_v2/variablelist.cpp
\02FB2B1B0000000200002710-00002710-------+02FB0408000027113AFDAD0100002712
%8:1613022920:/usr/local/squish/coco/samples/parser/parser_v2/variablelist.cpp
:t0.000839602x0000000000000002t4.175307768x0000000000002710
!PASSED

*CppUnit/ParserTest/testAddVariable20000
# Measurements
=17.090952546
/32:1613022920:/usr/local/squish/coco/samples/parser/parser_v2/variablelist.cpp
\0BEC37330000000200004E20-00004E20-------+0BEBE91000004E21x00000000F0246A9900004E22
%8:1613022920:/usr/local/squish/coco/samples/parser/parser_v2/variablelist.cpp
:t0.001744744x0000000000000002t17.087914969x0000000000004E20
<html><body><p>This test took twice as long as <tt>testAddVariable10000</tt>.</p></body></html>
!PASSED

For another example, see Writing data directly to the .csexe file

Coco v7.3.0 ©2024 The Qt Company Ltd.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.