You might want to take a look at Test::TAP::Model and friends to present the test result. My local Module::Build subclass has:
sub _do_action_with_tap_model {
my ( $self, $action ) = @_;
require Test::TAP::Model::Visual;
require Test::TAP::HTMLMatrix;
require File::Path;
File::Path::mkpath( 'html/t' );
my $model = Test::TAP::Model::Visual->new
or croak "could not make Test::TAP::Model::Visual";
{
require Test::Harness;
no warnings 'redefine';
my $original = \&Test::Harness::runtests;
local *Test::Harness::runtests = sub {
local *Test::Harness::runtests = $original;
$model->run_tests( @_ )
};
print "starting $action with html test results\n";
$self->$action( @_ );
print "finished $action with html test results\n";
}
my $html_matrix = Test::TAP::HTMLMatrix->new( $model )
or croak "could not make Test::TAP::HTMLMatrix";
open( my $fh, '>', 'html/t/index.html' ) or croak "open failed ($!
+)";
print $fh $html_matrix->html or croak "print failed ($!)";
close $fh or croak "close failed ($!)";
print "test results written to html/t/index.html\n";
}
sub ACTION_testhtml {
my $self = shift;
$self->_do_action_with_tap_model( 'ACTION_test' );
}
sub ACTION_smoke {
my $self = shift;
$self->_do_action_with_tap_model( 'ACTION_testcover' );
}
While allows me to do things like ./Build testhtml to get pretty HTML results in html/t.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|