Build differences summary report

This report shows how coverage has changed between builds of an application. The syntax is:

% pc_build_diff [-apply-adjustments=no] [-prefix=XXXX...]\
 old.
pcv new.pcv

The script exports each .pcv file, takes a diff of the resulting data, and prints a summary of the changes. The differences are calculated in terms of lines of code, so the script works only if the -g option was used to compile.

Any prefixes are stripped from the left side of directory names so that data from nightly build areas can be compared even though the root directory of the builds varies from day to day. You can specify multiple -prefix arguments, but one prefix at most will be applied to each directory name. The prefixes are applied in left-to-right order.

The prefix is a Perl regular expression anchored to the left by a caret (^).

Sample report

Suppose you do nightly builds or tests in directories named using the scheme /usr/home/builds/daily.<date>, and that one program you produce as part of this build is called myprog and is built in the myprog subdirectory of the build tree. Suppose further that there is some shared code used by this and other programs. So, in your filesystem, you have:

/usr/home/builds/daily.010408/myprog/main.c
/usr/home/builds/daily.010408/myprog/apply_patch.c
/usr/home/builds/daily.010408/myprog/myprog.pure.pcv
/usr/home/builds/daily.010408/shared/strings.c

as well as other source files. You also have the corresponding trees for other days on which you have done builds.

To compare coverage between the April 8 and April 9 builds, go to the /usr/home/builds directory, and run:

% pc_build_diff -prefix=".*daily......./" \ daily.01040{8,9}/myprog/myprog.pure.pcv

This generates the following report:

In the command, which is written here in csh {} syntax, the prefix .*daily......./ strips out the /usr/home/builds/daily.<date>/ part of the filenames. (The series of dots in this Perl expression matches the 7 characters of date specifications such as .960408.) The two .pcv files are then specified. The Unused and Change columns are measured in lines, so 10 fewer lines of strings.c were tested in the Apr 9 build. This works out to a decrease of 3% of the used lines. In main.c, 3 additional lines were used (3 fewer unused), but this is too small a number to influence the %used figure.

You must specify two filenames when using the pc_build_diff script. However, one of the filenames can be "-" to denote that exported information is to be supplied via stdin.