Monday, March 30, 2009
Testing is Great Fun, but what is the point if you can't impress your boss with a great-looking report?
I remember looking at the smoke-test-reports for Pugs several months ago, wondering "How did they make these great test reports?"
Well, it's pretty easy. Yuval Kogman, a prolific Perl module author, has created Test::TAP::HTMLMatrix.
This image is a screenshot of the kind of reports you can get from Test::TAP::HTMLMatrix. Each test name is hyperlinked to the test file itself. This example was created with the following script:
# make a successful test run
my $model_ok = Test::TAP::Model::Visual->new_with_tests(
my $v = Test::TAP::HTMLMatrix->new(
Test::TAP::Model::Consolidated->new( $model_ok )
# this is the most popular view:
I run it like this:
perl smoke.pl > smoke.html