Source markers
The source markers provide a way to select the source lines that are to be marked in the report file and called out in the statistics calculation for code coverage. These are based on the indicators in the source like a comment, numeric sequence, a range of statements, and a string at a specific place in the source listing. An indicator marks a statement or section of statements that have been changed or added as a result of a defect fix or enhancement. A source marker definition consists of the following elements:
- Marker type
- Single source line or a section of source lines
- SINGLE
- SECTIONBEGIN
- SECTIONEND
- Selection
- INCLUDE or EXCLUDE
- Start column
- Marker search starts at this column in a source line
- End column
- Marker search ends at this column in a source line
- Indicator
- Character (xxxx) or hex (X'nnnn')
- Multiple markers can be defined.
- Section source markers must come in pairs, such as SECTIONBEGIN and SECTIONEND.
The following table shows a sample of source markers:
Marker type | Selection | Start column | End column | Indicator |
---|---|---|---|---|
SINGLE | INCLUDE | 73 | 80 | PMR12345 |
SINGLE | EXCLUDE | 7 | 72 | MOVE |
SECTIONBEGIN | INCLUDE | 7 | 80 | DEFECT123BEGIN |
SECTIONEND | INCLUDE | 7 | 80 | DEFECT123END |
The first entry in the table indicates to mark as included in the report file and call out in the statistics calculation only statements that have the string PMR12345 in columns 73 - 80.
The second entry in the table indicates to mark as excluded in the report file and call out in the statistics calculation only statements that have the string MOVE in columns 7 - 72.
The third and fourth entries in the table indicate to mark as included only the statements beginning with the first statement that has the string DEFECT123BEGIN between columns 7 - 80 until the statement that has the string DEFECT123END between columns 7 - 80.
The following example corresponds to the values in the above table.
<SOURCEMARKER>
<MARKERTYPE>SINGLE</MARKERTYPE>
<SELECTION>INCLUDE</SELECTION>
<STARTCOLUMN>73</STARTCOLUMN>
<ENDCOLUMN>80</ENDCOLUMN>
<MARKERVALUE>C'PMR12345'</MARKERVALUE>
</SOURCEMARKER>
<SOURCEMARKER>
<MARKERTYPE>SINGLE</MARKERTYPE>
<SELECTION>EXCLUDE</SELECTION>
<STARTCOLUMN>7</STARTCOLUMN>
<ENDCOLUMN>72</ENDCOLUMN>
<MARKERVALUE>C'MOVE'</MARKERVALUE>
</SOURCEMARKER>
<SOURCEMARKER>
<MARKERTYPE>SECTIONBEGIN</MARKERTYPE>
<SELECTION>INCLUDE</SELECTION>
<STARTCOLUMN>7</STARTCOLUMN>
<ENDCOLUMN>80</ENDCOLUMN>
<MARKERVALUE>DEFECT123BEGIN</MARKERVALUE>
</SOURCEMARKER>
<SOURCEMARKER>
<MARKERTYPE>SECTIONEND</MARKERTYPE>
<SELECTION>INCLUDE</SELECTION>
<STARTCOLUMN>7</STARTCOLUMN>
<ENDCOLUMN>80</ENDCOLUMN>
<MARKERVALUE>DEFECT123END</MARKERVALUE>
</SOURCEMARKER>
Based on the Selection options in the example above, the report marks the sections of the source that matches the specified selection.