Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Test::More to only report fails?

by hippo (Bishop)
on Nov 06, 2021 at 16:33 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found