Annotated differences report

The pc_covdiff script generates a source code differences report that includes coverage information. This allows you to see the coverage of the lines of code that you have just changed without having to consider the coverage for the unchanged portion. The syntax is:

% yourdiff <name>    | pc_covdiff
                      [-context=<lines>]
                      [-format={diff|side-by-side|new-only}]
                      [-lines=<boolean>] [-tabs=<stops>]
                      [-width=<width>]
                      [
-force-merge]
                      [
-apply-adjustments=no]
                      -file=<name> <file>.
pcv ...

The stdin for the pc_covdiff script is a description in diff(1) format of the changes made to a file specified in <name>. The value for yourdiff depends on the code management tool you are using. If you are using RCS, for example, yourdiff is rcsdiff.

Specify the same file for the -file option. This script calls the pc_annotate report script, so you can use any form of the file name that pc_annotate recognizes. List the .pcv files that contain the coverage data for the new version of the file. If you specify the -force-merge option here, the script passes it to pc_annotate.

You can use this script only on one file at a time. You cannot run it from the PureCoverage Viewer.

The other options control the format of the output. There are two output styles: diff and sdiff. In sdiff style, the old and new versions of the source are displayed side-by-side, with a column between them indicating whether the lines were added, deleted, or changed. In diff style, the old and new are listed sequentially, with code lines indicating what happened. The default is sdiff.

The option -format allows you to specify the style:

-format=diff

diff style

-format=side-by-side

sdiff style

-format=new-only

sdiff style, but without the "old" column

In both diff and sdiff styles, the tabs are stripped. Use the -tabs option if your text editor normally expands tabs to a value other than 8 character stops.

In both styles, you can request that additional context lines be included in the output. The default is 2, but set it to 0 if you want to produce output understandable to other tools that read diff.

In sdiff style, use the -lines option (default TRUE) to indicate whether line numbers should be included in the output.

In sdiff style, you can use the option -width to specify the width of each column of source. Normally, width is adjusted automatically to accommodate the input. If you specify an explicit value, the sources are truncated if they are too wide. Note that the width is for each column of the source, not the overall width, which includes other items such as coverage counts, the dividing column, and line numbers, depending on the options that you use.

Sample report