Example of CTC++ Coverage XML Report

<?xml version="1.0" encoding="ISO-8859-1"?>

<ctc_xml_report>

<header_info>
<ctcpost_version>6.5</ctcpost_version>
<copyright>Copyright (c) 1993-2008 Testwell Oy</copyright>
<license_notes>
</license_notes>
<symbolfiles>
<symbolfile>
<name>MON.sym</name>
<modified>Thu Feb 07 13:59:53 2008</modified>
</symbolfile>
</symbolfiles>
<datafiles>
<datafile>
<name>MON.dat</name>
<modified>Thu Feb 07 14:03:02 2008</modified>
</datafile>
</datafiles>
<chosen_source_files>
</chosen_source_files>
<report_generated>Thu Feb 07 14:04:16 2008</report_generated>
<requested_coverage_view>As instrumented</requested_coverage_view>
<ctcpost_options>-x xmlreport.txt</ctcpost_options>
<execution_cost_function>clock</execution_cost_function>
<execution_cost_type>Clock ticks</execution_cost_type>
<execution_cost_scaling>1</execution_cost_scaling>
</header_info>

<ctcpost_notices>
</ctcpost_notices>

<file name="calc.c">
<instrumentation_mode>function-decision-multicondition-timing</instrumentation_mode>
<instrumentation_timestamp>Thu Feb 07 13:59:35 2008</instrumentation_timestamp>
<function name="is_prime">
<parameters>( unsigned val )</parameters>
<defined_at_line>4</defined_at_line>
<declared_in_file>c:\program files\testwell\ctc\examples\prime\calc.h</declared_in_file>
<declared_at_line>4</declared_at_line>
<category>standalone</category>
<call_count>3</call_count>
<total_execution_cost>0</total_execution_cost>
<average_execution_cost>0.0</average_execution_cost>
<body>
<probe type="function" count1="3" count2="0"
line="4" nesting="0" descr="FUNCTION is_prime()" />
<probe type="if" count1="1" count2="2"
line="8" nesting="1" descr="if (val == 1 || val == 2 || val == 3)" />
<probe type="multi_cond_t" count1="0" alarmed="1"
line="8" nesting="1" descr="T || _ || _" />
<probe type="multi_cond_t" count1="1"
line="8" nesting="1" descr="F || T || _" />
<probe type="multi_cond_t" count1="0" alarmed="1"
line="8" nesting="1" descr="F || F || T" />
<probe type="multi_cond_f" count2="2"
line="8" nesting="1" descr="F || F || F" />
<probe type="return" count1="1"
line="9" nesting="2" descr="return 1" />
<probe type="if" count1="1" count2="1"
line="10" nesting="1" descr="if (val % 2 == 0)" />
<probe type="return" count1="1"
line="11" nesting="2" descr="return 0" />
<probe type="for" count1="0" count2="1" alarmed="1"
line="12" nesting="1" descr="for (;divisor &lt; val / 2;)" />
<probe type="if" count1="0" count2="0" alarmed="1"
line="14" nesting="2" descr="if (val % divisor == 0)" />
<probe type="return" count1="0" alarmed="1"
line="15" nesting="3" descr="return 0" />
<probe type="return" count1="1"
line="17" nesting="1" descr="return 1" />
</body>
<function_summary>
<ter>65</ter>
<hits>11</hits>
<all>17</all>
</function_summary>
</function>
<file_summary>
<ter>65</ter>
<hits>11</hits>
<all>17</all>
</file_summary>
</file>

<file name="io.c">
<instrumentation_mode>function-decision-multicondition-timing</instrumentation_mode>
<instrumentation_timestamp>Thu Feb 07 13:59:46 2008</instrumentation_timestamp>
<function name="io_ask">
<parameters>( )</parameters>
<defined_at_line>5</defined_at_line>
<declared_in_file>c:\program files\testwell\ctc\examples\prime\io.h</declared_in_file>
<declared_at_line>4</declared_at_line>
<category>standalone</category>
<call_count>4</call_count>
<total_execution_cost>16583</total_execution_cost>
<average_execution_cost>4145.8</average_execution_cost>
<body>
<probe type="function" count1="4" count2="0"
line="5" nesting="0" descr="FUNCTION io_ask()" />
<probe type="if" count1="0" count2="4" alarmed="1"
line="11" nesting="1" descr="if (( amount = scanf ( &quot;%u&quot; , &amp; val ) ) &lt;= 0)" />
<probe type="return" count1="4"
line="14" nesting="1" descr="return val" />
</body>
<function_summary>
<ter>75</ter>
<hits>3</hits>
<all>4</all>
</function_summary>
</function>
<function name="io_report">
<parameters>( unsigned val , char * str )</parameters>
<defined_at_line>18</defined_at_line>
<declared_in_file>c:\program files\testwell\ctc\examples\prime\io.h</declared_in_file>
<declared_at_line>7</declared_at_line>
<category>standalone</category>
<call_count>3</call_count>
<total_execution_cost>0</total_execution_cost>
<average_execution_cost>0.0</average_execution_cost>
<body>
<probe type="function" count1="3" count2="3"
line="18" nesting="0" descr="FUNCTION io_report()" />
</body>
<function_summary>
<ter>100</ter>
<hits>1</hits>
<all>1</all>
</function_summary>
</function>
<file_summary>
<ter>80</ter>
<hits>4</hits>
<all>5</all>
</file_summary>
</file>

<file name="prime.c">
<instrumentation_mode>function-decision-multicondition-timing</instrumentation_mode>
<instrumentation_timestamp>Thu Feb 07 13:59:53 2008</instrumentation_timestamp>
<function name="main">
<parameters>( void )</parameters>
<defined_at_line>8</defined_at_line>
<declared_in_file>prime.c</declared_in_file>
<declared_at_line>8</declared_at_line>
<category>standalone</category>
<call_count>1</call_count>
<total_execution_cost>0</total_execution_cost>
<average_execution_cost>0.0</average_execution_cost>
<body>
<probe type="function" count1="1" count2="0"
line="8" nesting="0" descr="FUNCTION main()" />
<probe type="while" count1="3" count2="1"
line="12" nesting="1" descr="while (( prime_candidate = io_ask ( ) ) &gt; 0)" />
<probe type="if" count1="2" count2="1"
line="14" nesting="2" descr="if (is_prime ( prime_candidate ))" />
<probe type="else"
line="16" nesting="2" descr="else" />
<probe type="return" count1="1"
line="19" nesting="1" descr="return 0" />
</body>
<function_summary>
<ter>100</ter>
<hits>6</hits>
<all>6</all>
</function_summary>
</function>
<file_summary>
<ter>100</ter>
<hits>6</hits>
<all>6</all>
</file_summary>
</file>

<overall_summary>
<files>3</files>
<lines>59</lines>
<measurement_points>30</measurement_points>
<ter>75</ter>
<hits>21</hits>
<all>28</all>
<shown_coverage_views>multicondition</shown_coverage_views>
</overall_summary>

</ctc_xml_report>

The XML report contains the same information that there is in Execution Profile Listing and in Execution Timing listing in XML form.The XML report contains also some more information about the ctcpost run options, the instrumentation timestamps of each file, function parameters, if there was seen a separate declaration on the function where it was, function type (one of standalone, public, protected, private).

The XML report is meant to be a means to automate the coverage data further processing, for selecting the data of interest and working up some company-specific reports by an XML-based add-on tool of your own.