Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Running .t Tests in a web-based environment

by adrianh (Chancellor)
on Dec 03, 2006 at 10:30 UTC ( #587491=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://587491]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2018-02-22 21:37 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (299 votes). Check out past polls.