28. C Coverage Export Details#

28.1. Introduction#

Format of CSV files exported by rsSimExportCCoverageDetails

This section describes the contents of the CSV files generated by rsSimExportCCoverageDetails. A primary file contains target coverage information for C source code and an optional second file contains data for targets generated by macro expansion.

28.2. C Code Coverage File#

CSV file containing C code coverage information.

Each row of data in the primary output file contains the following columns:

  1. The target id number (1 … n, where n is the number of targets).

  2. A string describing the target kind:

    “s”

    Statement

    “dt”

    Decision true

    “df”

    Decision false

    “ct”

    Condition true

    “cf”

    Condition false

    “m”

    MC/DC

  3. For condition targets, this field contains the id number of the decision target which contains the condition target. For MC/DC targets, this field contains the id number of the corresponding condition-true target. For decision and statement targets, this field will be zero.

  4. The coverage status of the target (1 if covered, 0 if uncovered).

  5. The test number in which the target was covered (-1 if uncovered or unknown).

  6. The step number in which the target was covered (-1 if uncovered or unknown).

  7. The path to the model component containing the target. This is useful when the same source file is used in more than one S-function.

  8. The pathname of the C source file to which the target belongs.

  9. The starting line number of the target.

  10. The starting column number of the target.

  11. The ending line number of the target.

  12. The ending column of the target.

  13. If the target is not defined within a macro expansion, this field will be zero. If the field is positive, it will contain an id number which can be used to find the macro expansion data in the macro data file.

  14. The starting line within the macro expansion of the target.

  15. The starting column within the macro expansion of the target.

  16. The ending line within the macro expansion of the target.

  17. The ending column within the macro expansion of the target.

Notes:

  • All strings are encoded as C literals.

  • All numbers are encoded as integers.

  • Target ids, macro ids, lines and columns are numbered starting with 1 (not zero).

  • For targets within macro expansions, the starting and ending source file locations will be the points where the macro expansion started and ended.

  • If the target is not defined within a macro expansion, then columns 13-17 will contain zeros.

  • If no macro data file is generated, then columns 13-17 will be omitted (the CSV data will contain only 12 columns).

28.3. Macro Information File#

CSV file containing macro information.

Each row of CSV data in the secondary macro information file contains the following columns:

  1. The id number of the macro expansion (1 … n, where n is the number of macro expansions).

  2. The name of the macro which was expanded.

  3. The file where the macro was defined.

  4. The line number where the macro was defined.

  5. The column number where the macro was defined (should always be 1).

  6. The line number where the macro definition ended.

  7. The column number where the macro definition ended.

  8. The file in which the macro invocation occurred.

  9. The line number at which the macro invocation started.

  10. The column number at which the macro invocation started.

  11. The line number at which the macro invocation ended.

  12. The column number at which the macro invocation ended.

  13. The text of the macro expansion, encoded as a C string literal.

Notes:

  • All strings are encoded as C literals.

  • All numbers are encoded as integers.

  • Macro ids, lines and columns are numbered starting with 1 (not zero).