26 May 2011

Multi-file code coverage viewing tool

posted by John Clements

I’m very pleased to announce the availability of a multi-file code coverage viewer, written by Jonathan Walsh.

Torn between separating your test cases into another file and actually seeing the coverage? Well, go ahead and pull them apart, because the multi-file coverage tool displays coverage information for the files required by the present one, including both percentage covered (on a line-by-line basis) and optionally a list of uncovered lines (no more inching through your code, looking for the red highlighting.

Back End:

One reason I expect this tool to be long-term robust is that it makes absolutely no changes to the back-end; that is, it just uses the existing code coverage framework. The only thing going on here is that the tool provides a way to store, load, and display this information. This means that the tool displays coverage for un-compiled files only. We thought about fiddling with this, but finally decided that the existing behavior was probably about as useful as anything else we’d come up with, and a lot more robust.

URL for docs:


As you might expect, it’s a one-line install:

#lang racket

(require (planet jowalsh/code-coverage))

Please let us know about bugs you discover!

Made with Frog, a static-blog generator written in Racket.
Source code for this blog.