http://www.perlmonks.org?node_id=587491


in reply to Running .t Tests in a web-based environment

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.