Running report scripts

The PureCoverage report scripts are located in the directory <purecovhome>/scripts. To run scripts from a shell or makefile, you can include this directory on your $PATH, make symbolic links from /usr/local/bin to the script, or invoke the scripts by absolute pathname.

You can also run the report scripts from within the Viewer. Select File > Run Script. This opens the Script dialog:

Select the script name from the script selection list. Enter any arguments, being sure to escape any character that has a special meaning to the shell. The script works on the data files currently being viewed, and shows the adjustments that are currently displayed.

The Script Output window displays the results:

You can also run custom scripts in the Viewer, provided that they use stdin as the source of their export data. Install your custom script in the directory <purecovhome>/scripts. The next time you start the Viewer, the custom script name appears in the Script dialog, where you can select it.

To run the pc_diff or pc_build_diff script from the Viewer, use "-" (for stdin) as one of the arguments, and the name of the file to be compared as the other. You cannot run the pc_covdiff script from the Viewer.

A report script that you run from the dialog produces output in the Script Output window that is similar to the output when you invoke scripts using the command:

% purecov -export prog.pcv | <report_script>

To save a report, select File > Save as . . . in the Script Output window.