Print to a log file:
#!/usr/bin/perl use strict; use warnings; use Test::More; my @valid = qw/ foo bar baz /; my @compare = qw/ foo qux baz /; my $log_file = 'log.txt'; my $err_file = 'err.txt'; Test::More->builder->output( $log_file ); Test::More->builder->failure_output( $err_file ); is_deeply( \@compare, \@valid, 'My Test' ); done_testing; __END__
$ cat log.txt not ok 1 - My Test 1..1 $
$ cat err.txt # Failed test 'My Test' # at 1140351.pl line 17. # Structures begin differing at: # $got->[1] = 'qux' # $expected->[1] = 'bar' # Looks like you failed 1 test of 1. $
E-mail from there would be up to you, or maybe there's a module already on CPAN for it.
In reply to Re: getting is_deeply test::more to print to log ( Test::More->builder->failure_output )
by 1nickt
in thread getting is_deeply test::more to print to log
by teamassociated
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |