Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Quiet test runner

by tomhukins (Curate)
on Sep 21, 2005 at 15:22 UTC ( #493839=note: print w/replies, xml ) Need Help??

in reply to Quiet test runner

I find this really useful, thanks. I'm using it as a consequence of the sitation I described in Reporting test failures within cron.

I noticed it doesn't work quite right if I run an incorrect number of tests. For example:

use Test::More tests => 3; ok 1, 'Happy'; ok 1, 'Cheerful';

We expect three tests but only run two, which both succeed. Fortunately, is_expected deals with this, but unfortunately show_details doesn't report the failure. The altered is_expected_test_result below fixes this reporting problem:

sub is_expected_test_result { my $test_result = shift; return $test_result->{ok} && ! is_unexpected_todo_success( $test_result ) && ! diagnostics( $_ ); }

I discovered this when running some Test::WWW::Mechanize tests against a server that stops responding, causing later tests not to run.

Replies are listed 'Best First'.
Re^2: Quiet test runner
by adrianh (Chancellor) on Sep 22, 2005 at 07:49 UTC

    Well spotted. Thanks.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2021-10-16 18:49 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (69 votes). Check out past polls.