Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Test::More to only report fails?

by hippo (Bishop)
on Nov 06, 2021 at 16:33 UTC ( #11138513=note: print w/replies, xml ) Need Help??


in reply to Test::More to only report fails?

I have a test suite which runs daily and I obviously don't want to be bothered hearing from it if everything passes :-). To that end I have used the facilities of TAP::Harness so that it only reports failures. Here's the (freshly anonymised) code:

use strict; use warnings; use TAP::Harness; use Data::Dumper; chdir "$ENV{HOME}/src/mymods/Foo" or die "Cannot access start dir"; my $harness = TAP::Harness->new ({verbosity => -3, lib => [ qw/lib/ ]} +); my $res = $harness->runtests (glob ('t/*.t')); exit 0 if $res->all_passed; # Problems my $fail_count = $res->failed; my $total_run = $res->total; print "Failed $fail_count out of $total_run tests run.\n"; print "\tFailed: $_\n" for $res->failed;

This has been running daily from cron for a couple of years. Not quite what you asked for but perhaps a feasible alternative. HTH.


🦛

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-05-21 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?