The Multi-File Code Coverage Tool allows coverage information gathered from a single program evaluation to be displayed on multiple source files in multiple DrRacket windows.
Multi-File Code Coverage is a Planet package, however it only adds a tool rather than providing functions. To install evaluate the following program:
... and then restart DrRacket. The "Multi-File Coverage" button should now be visible as seen below.
First ensure that you have "Syntactic Test Suite Coverage" enabled in the "Language->Choose Language..." dialog. You may need to click the "Show Details" button to see the expanded options. Then run the program you wish to collect multi-file coverage information for. Finally, click the "Multi-File Coverage" button. This will send the coverage information to other open files and apply code coverage highlighting to them. The Covered Files Dialog will also appear containing the list of files covered by the program you just ran.
You may then select one, or more, of the covered files to open and switch focus to. Additionally, by clicking the "Open With Uncovered Lines Dialog", instead of just "Open", each selected file will spawn the Uncovered Lines Dialog with a list of lines containing unevaluated expressions.
The Covered Files Dialog appears after clicking the "Multi-File Coverage" button. It displays a list of files covered by the currently in-focus program and allows the selection of a file to open and switch focus to.
Covered Files Dialog
The percent in parentheses, next to each file in the Covered Files Dialog, is the percent of covered lines in that file. So 100% indicates that every line in that file is covered. Blank lines and comments are also counted as covered lines.
An asterisk may appear next to a file in the Covered Files Dialog. This indicates that the file has been modified since multi-file coverage information was last collected, which may have invalidated its coverage info. To ensure that all coverage information is valid run the program you are collecting multi-file code coverage for again.
The Uncovered Lines Dialog contains a list of line numbers, for an individual file, that are not fully covered.
Uncovered Lines Dialog
Whenever the "Multi-File Coverage" button is clicked the multi-file code coverage information is saved to a file. This file is named <file name>.rktcov and saved in the "compiled" directory next to the source file.
Only un-compiled files will appear in the Covered Files Dialog. To ensure that all your covered files appear delete any "compiled" directories next to your source files. Then run your program again and click the "Multi-File Coverage" button.