Example of CTC++ Coverage XML Report

<?xml version="1.0" encoding="ISO-8859-1"?>
<ctc_xml_report>
 <header_info>
  <ctcpost_version>7.0</ctcpost_version>
  <copyright>Copyright (c) 1993-2011 Testwell Oy</copyright>
  <license_notes>
  </license_notes>
  <symbolfiles>
   <symbolfile>
    <name>MON.sym</name>
    <modified>Fri Jul 01 08:22:06 2011</modified>
   </symbolfile>
  </symbolfiles>
  <datafiles>
   <datafile>
    <name>MON.dat</name>
    <modified>Fri Jul 01 08:23:00 2011</modified>
   </datafile>
  </datafiles>
  <chosen_source_files>
  </chosen_source_files>
  <unchosen_source_files>
  </unchosen_source_files>
  <report_generated>Fri Aug 05 09:59:07 2011</report_generated>
  <requested_coverage_view>As instrumented</requested_coverage_view>
  <ctcpost_options>-x xmlreport2.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="prime.c">
  <instrumentation_mode>multicondition+inclusive_timing</instrumentation_mode>
  <instrumentation_timestamp>Fri Jul 01 08:22:04 2011</instrumentation_timestamp>
  <sym_rewrite_count>2</sym_rewrite_count>
  <sym_update_count>0</sym_update_count>
  <data_rewrite_count>2</data_rewrite_count>
  <data_update_count>1</data_update_count>
  <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>2</call_count>
   <total_execution_cost>33957</total_execution_cost>
   <average_execution_cost>16978.5</average_execution_cost>
   <max_execution_cost>17541</max_execution_cost>
   <body>
    <probe type="function" count1="2"
       line="8" sc_count="0" nesting="0" descr="FUNCTION main()" />
    <probe type="while" count1="6" count2="2"
       line="12" sc_count="1" nesting="1" descr="while (( prime_candidate = io_ask ( ) ) &gt; 0)" />
    <probe type="if" count1="4" count2="2"
       line="14" sc_count="1" nesting="2" descr="if (is_prime ( prime_candidate ))" />
    <probe type="block_end"
       line="15" sc_count="2" nesting="2" descr="}" />
    <probe type="else"
       line="16" sc_count="2" nesting="2" descr="else" />
    <probe type="block_end"
       line="17" sc_count="3" nesting="2" descr="}" />
    <probe type="block_end"
       line="18" sc_count="3" nesting="1" descr="}" />
    <probe type="return" count1="2"
       line="19" sc_count="4" nesting="1" descr="return 0" />
    <probe type="function_end_nr"
       line="20" sc_count="4" nesting="0" descr="FUNCTION main()" />
   </body>
   <function_summary>
    <ter>100</ter>
    <hits>6</hits>
    <all>6</all>
    <statement_ter>100</statement_ter>
    <statement_hits>6</statement_hits>
    <statement_all>6</statement_all>
   </function_summary>
  </function>
  <file_summary>
   <ter>100</ter>
   <hits>6</hits>
   <all>6</all>
   <statement_ter>100</statement_ter>
   <statement_hits>6</statement_hits>
   <statement_all>6</statement_all>
  </file_summary>
 </file>
 <file name="io.c">
  <instrumentation_mode>multicondition+inclusive_timing</instrumentation_mode>
  <instrumentation_timestamp>Fri Jul 01 08:22:05 2011</instrumentation_timestamp>
  <sym_rewrite_count>2</sym_rewrite_count>
  <sym_update_count>0</sym_update_count>
  <data_rewrite_count>2</data_rewrite_count>
  <data_update_count>1</data_update_count>
  <function name="io_ask">
   <parameters>( )</parameters>
   <defined_at_line>5</defined_at_line>
   <declared_in_file>f:\ctcwork\v70\doc\ug-examples\io.h</declared_in_file>
   <declared_at_line>4</declared_at_line>
   <category>standalone</category>
   <call_count>8</call_count>
   <total_execution_cost>33953</total_execution_cost>
   <average_execution_cost>4244.1</average_execution_cost>
   <max_execution_cost>9217</max_execution_cost>
   <body>
    <probe type="function" count1="8"
       line="5" sc_count="0" nesting="0" descr="FUNCTION io_ask()" />
    <probe type="if" count1="0" count2="8" alarmed="1"
       line="11" sc_count="3" nesting="1" descr="if (( amount = scanf ( &quot;%u&quot; , &amp; val ) ) &lt;= 0)" />
    <probe type="block_end"
       line="13" sc_count="4" nesting="1" descr="}" />
    <probe type="return" count1="8"
       line="14" sc_count="5" nesting="1" descr="return val" />
    <probe type="function_end_nr"
       line="15" sc_count="5" nesting="0" descr="FUNCTION io_ask()" />
   </body>
   <function_summary>
    <ter>75</ter>
    <hits>3</hits>
    <all>4</all>
    <statement_ter>83</statement_ter>
    <statement_hits>5</statement_hits>
    <statement_all>6</statement_all>
   </function_summary>
  </function>
  <function name="io_report">
   <parameters>( unsigned val , char * str )</parameters>
   <defined_at_line>18</defined_at_line>
   <declared_in_file>f:\ctcwork\v70\doc\ug-examples\io.h</declared_in_file>
   <declared_at_line>7</declared_at_line>
   <category>standalone</category>
   <call_count>6</call_count>
   <total_execution_cost>4</total_execution_cost>
   <average_execution_cost>0.7</average_execution_cost>
   <max_execution_cost>1</max_execution_cost>
   <body>
    <probe type="function" count1="6"
       line="18" sc_count="5" nesting="0" descr="FUNCTION io_report()" />
    <probe type="function_end" count1="6"
       line="21" sc_count="6" nesting="0" descr="FUNCTION io_report()" />
   </body>
   <function_summary>
    <ter>100</ter>
    <hits>2</hits>
    <all>2</all>
    <statement_ter>100</statement_ter>
    <statement_hits>1</statement_hits>
    <statement_all>1</statement_all>
   </function_summary>
  </function>
  <file_summary>
   <ter>83</ter>
   <hits>5</hits>
   <all>6</all>
   <statement_ter>86</statement_ter>
   <statement_hits>6</statement_hits>
   <statement_all>7</statement_all>
  </file_summary>
 </file>
 <file name="calc.c">
  <instrumentation_mode>multicondition+inclusive_timing</instrumentation_mode>
  <instrumentation_timestamp>Fri Jul 01 08:22:06 2011</instrumentation_timestamp>
  <sym_rewrite_count>2</sym_rewrite_count>
  <sym_update_count>0</sym_update_count>
  <data_rewrite_count>2</data_rewrite_count>
  <data_update_count>1</data_update_count>
  <function name="is_prime">
   <parameters>( unsigned val )</parameters>
   <defined_at_line>4</defined_at_line>
   <declared_in_file>f:\ctcwork\v70\doc\ug-examples\calc.h</declared_in_file>
   <declared_at_line>4</declared_at_line>
   <category>standalone</category>
   <call_count>6</call_count>
   <total_execution_cost>0</total_execution_cost>
   <average_execution_cost>0.0</average_execution_cost>
   <max_execution_cost>0</max_execution_cost>
   <body>
    <probe type="function" count1="6"
       line="4" sc_count="0" nesting="0" descr="FUNCTION is_prime()" />
    <probe type="if" count1="2" count2="4"
       line="8" sc_count="1" nesting="1" descr="if (val == 1 || val == 2 || val == 3)" />
    <probe type="multi_cond_t" count1="0" alarmed="1"
       line="8" sc_count="1" nesting="1" eval_no="1" descr="T || _ || _" />
    <probe type="multi_cond_t" count1="2"
       line="8" sc_count="1" nesting="1" eval_no="2" descr="F || T || _" />
    <probe type="multi_cond_t" count1="0" alarmed="1"
       line="8" sc_count="1" nesting="1" eval_no="3" descr="F || F || T" />
    <probe type="multi_cond_f" count2="4"
       line="8" sc_count="1" nesting="1" eval_no="4" descr="F || F || F" />
    <probe type="return" count1="2"
       line="9" sc_count="2" nesting="2" descr="return 1" />
    <probe type="block_end"
       line="9" sc_count="2" nesting="1" descr="}" />
    <probe type="if" count1="2" count2="2"
       line="10" sc_count="2" nesting="1" descr="if (val % 2 == 0)" />
    <probe type="return" count1="2"
       line="11" sc_count="3" nesting="2" descr="return 0" />
    <probe type="block_end"
       line="11" sc_count="3" nesting="1" descr="}" />
    <probe type="for" count1="0" count2="2" alarmed="1"
       line="12" sc_count="5" nesting="1" descr="for (;divisor &lt; val / 2;)" />
    <probe type="if" count1="0" count2="0" alarmed="1"
       line="14" sc_count="5" nesting="2" descr="if (val % divisor == 0)" />
    <probe type="return" count1="0" alarmed="1"
       line="15" sc_count="6" nesting="3" descr="return 0" />
    <probe type="block_end"
       line="15" sc_count="6" nesting="2" descr="}" />
    <probe type="block_end"
       line="16" sc_count="6" nesting="1" descr="}" />
    <probe type="return" count1="2"
       line="17" sc_count="7" nesting="1" descr="return 1" />
    <probe type="function_end_nr"
       line="18" sc_count="7" nesting="0" descr="FUNCTION is_prime()" />
   </body>
   <function_summary>
    <ter>65</ter>
    <hits>11</hits>
    <all>17</all>
    <statement_ter>82</statement_ter>
    <statement_hits>9</statement_hits>
    <statement_all>11</statement_all>
   </function_summary>
  </function>
  <file_summary>
   <ter>65</ter>
   <hits>11</hits>
   <all>17</all>
   <statement_ter>82</statement_ter>
   <statement_hits>9</statement_hits>
   <statement_all>11</statement_all>
  </file_summary>
 </file>
 <overall_summary>
  <shown_coverage_views>multicondition</shown_coverage_views>
  <files>3</files>
  <lines>59</lines>
  <measurement_points>27</measurement_points>
  <ter>76</ter>
  <hits>22</hits>
  <all>29</all>
  <statement_ter>88</statement_ter>
  <statement_hits>21</statement_hits>
  <statement_all>24</statement_all>
 </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 stand-alone, public, protected, private). The XML report contains also information about where are the boundaries of control structures like if (cond) {then-part} else {else-part} and counting of the number of statements that they contain.

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.