Making adjustments using source code directives

To make adjustments by marking them in your code:

  1. Embed adjustment directives as comments in your source code.

  2. Then extract the directives and apply them in calculating coverage data.

Embedding adjustment directives

Each directive is a comment consisting of the keyword purecov followed by a colon (:), and then the type of adjustment.

Two styles of directives are available:

Extracting adjustments from source files

PureCoverage extracts adjustments from an individual file automatically when you open the Annotated Source window for that file.

To extract adjustments from all files referenced in the PureCoverage Viewer:

Extract the adjustments each time the source file is modified. You can do this automatically by adding the -extract option in the makefile as part of the cc -c step.

Whenever PureCoverage extracts adjustments, it outputs a short summary of the extraction process. For example:

% purecov -extract bim.c
Updating adjustments for /canonical/path/to/bim.c:
     23 lines of dead code
     42 manually tested lines

When you open the PureCoverage Viewer, PureCoverage applies the adjustments in ~/.purecov.adjust to the display. The adjustments are reflected in:

Saving adjustments

You can save the adjustments you have made in the source file and in the adjustments file ~/.purecov.adjust by selecting File > Save in the Annotated Source window.