diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-20 15:54:08 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 06:28:48 +0100 |
commit | 1ae762d3bc924245aa96378929a9a048d385a61e (patch) | |
tree | c8973260f819b45c3a6f65e18eec15350d5977f9 /source4/selftest/output/plain.pm | |
parent | 70c9374305fdb39ca92b3490bfdbc23043960637 (diff) | |
download | samba-1ae762d3bc924245aa96378929a9a048d385a61e.tar.gz samba-1ae762d3bc924245aa96378929a9a048d385a61e.tar.bz2 samba-1ae762d3bc924245aa96378929a9a048d385a61e.zip |
r26549: Remove suite-specific bits.
(This used to be commit ac01d515b71ce44a0d98e50d58a76e1ce9e1f5d9)
Diffstat (limited to 'source4/selftest/output/plain.pm')
-rw-r--r-- | source4/selftest/output/plain.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/selftest/output/plain.pm b/source4/selftest/output/plain.pm index af353c3cff..086bd2b0e5 100644 --- a/source4/selftest/output/plain.pm +++ b/source4/selftest/output/plain.pm @@ -6,14 +6,16 @@ use Exporter; use strict; -sub new($$$$$$) { +sub new($$$$$$$) { my ($class, $summaryfile, $verbose, $immediate, $statistics, $totaltests) = @_; my $self = { verbose => $verbose, immediate => $immediate, statistics => $statistics, + start_time => time(), test_output => {}, suitesfailed => [], + suites_ok => 0, skips => {}, summaryfile => $summaryfile, index => 0, @@ -32,13 +34,13 @@ sub start_testsuite($$$) $state->{NAME} = $name; $state->{START_TIME} = time(); - my $duration = $state->{START_TIME} - $self->{statistics}->{START_TIME}; + my $duration = $state->{START_TIME} - $self->{start_time}; $self->{test_output}->{$name} = "" unless($self->{verbose}); my $out = ""; $out .= "[$self->{index}/$self->{totalsuites} in ".$duration."s"; - $out .= sprintf(", %d errors", $self->{statistics}->{SUITES_FAIL}) if ($self->{statistics}->{SUITES_FAIL} > 0); + $out .= sprintf(", %d errors", ($#{$self->{suitesfailed}}+1)) if ($#{$self->{suitesfailed}} > -1); $out .= "] $name\n", print "$out"; } @@ -68,13 +70,16 @@ sub end_testsuite($$$$$$) if ($unexpected) { $self->output_msg($state, "ERROR: $reason\n"); + push (@{$self->{suitesfailed}}, $name); + } else { + $self->{suites_ok}++; } if ($unexpected and $self->{immediate} and not $self->{verbose}) { $out .= $self->{test_output}->{$name}; - push (@{$self->{suitesfailed}}, $name); } + print $out; } @@ -151,12 +156,12 @@ sub summary($) print "\nA summary with detailed informations can be found in:\n $self->{summaryfile}\n"; - if ($self->{statistics}->{SUITES_FAIL} == 0) { + if ($#{$self->{suitesfailed}} == -1) { my $ok = $self->{statistics}->{TESTS_EXPECTED_OK} + $self->{statistics}->{TESTS_EXPECTED_FAIL}; - print "\nALL OK ($ok tests in $self->{statistics}->{SUITES_OK} testsuites)\n"; + print "\nALL OK ($ok tests in $self->{suites_ok} testsuites)\n"; } else { - print "\nFAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in $self->{statistics}->{SUITES_FAIL} testsuites)\n"; + print "\nFAILED ($self->{statistics}->{TESTS_UNEXPECTED_FAIL} failures and $self->{statistics}->{TESTS_ERROR} errors in ". ($#{$self->{suitesfailed}}+1) ." testsuites)\n"; } } |