diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-26 23:28:36 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:43:39 +0100 |
commit | a7eedba7c4c86356a8453158e59eb95471dd270f (patch) | |
tree | 1165fee40e8b01068b4555a262172bc41bd4d61a /source4/selftest/output | |
parent | 9d4addadc089b52867c98d714894192e832a27d2 (diff) | |
download | samba-a7eedba7c4c86356a8453158e59eb95471dd270f.tar.gz samba-a7eedba7c4c86356a8453158e59eb95471dd270f.tar.bz2 samba-a7eedba7c4c86356a8453158e59eb95471dd270f.zip |
r25743: Write short summary of failed tests and skipped tests to file.
(This used to be commit 22cb93e5c00c9bd2a9288ba13336389d45c9987f)
Diffstat (limited to 'source4/selftest/output')
-rw-r--r-- | source4/selftest/output/plain.pm | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/source4/selftest/output/plain.pm b/source4/selftest/output/plain.pm index 59b89f84c9..6b196090a1 100644 --- a/source4/selftest/output/plain.pm +++ b/source4/selftest/output/plain.pm @@ -6,14 +6,16 @@ use Exporter; use strict; -sub new($$$$) { - my ($class, $verbose, $immediate, $statistics) = @_; +sub new($$$$$) { + my ($class, $summaryfile, $verbose, $immediate, $statistics) = @_; my $self = { verbose => $verbose, immediate => $immediate, statistics => $statistics, test_output => {}, - suitesfailed => [] + suitesfailed => [], + skips => {}, + summaryfile => $summaryfile, }; bless($self, $class); } @@ -102,12 +104,21 @@ sub summary($) { my ($self) = @_; + open(SUMMARY, ">$self->{summaryfile}"); + + if ($#{$self->{suitesfailed}} > -1) { + print SUMMARY "= Failed tests =\n"; + } + if (not $self->{immediate} and not $self->{verbose}) { foreach (@{$self->{suitesfailed}}) { print "===============================================================================\n"; print "FAIL: $_\n"; print $self->{test_output}->{$_}; print "\n"; + + print SUMMARY "= $_ =\n"; + print SUMMARY $self->{test_output}->{$_}."\n\n"; } } @@ -118,17 +129,25 @@ sub summary($) } else { print "FAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n"; } + + print SUMMARY "= Skipped tests =\n"; + foreach my $reason (keys %{$self->{skips}}) { + print SUMMARY "$reason\n"; + foreach my $name (@{$self->{skips}->{$reason}}) { + print SUMMARY "\t$name\n"; + } + print SUMMARY "\n"; + } + close(SUMMARY); + + print "A summary can be found in $self->{summaryfile}\n"; } sub skip_testsuite($$) { my ($self, $name, $reason) = @_; - if ($reason) { - print "SKIPPED: $name [$reason]\n"; - } else { - print "SKIPPED: $name\n"; - } + push (@{$self->{skips}->{$reason}}, $name); } 1; |