Report only failed tests in Test::More

89 views Asked by At

I have a lot of checks for random generated data. How can I get report message only for failed tests and show nothing if check is ok?

1

There are 1 answers

0
brian d foy On BEST ANSWER

You can use the fail routine. Make your checks outside of any Test::More code and use that result to decide if you output test messages.

foreach my $element ( @randomly_generated_data ) {
    my $result = ...; # your checks here
    next if $result;
    fail( 'Some message' );
    }