Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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.


Comment on Re: Running .t Tests in a web-based environment
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://587491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-12-21 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (102 votes), past polls