summaryrefslogtreecommitdiff
path: root/source4/selftest/output
diff options
context:
space:
mode:
Diffstat (limited to 'source4/selftest/output')
-rw-r--r--source4/selftest/output/buildfarm.pm12
-rw-r--r--source4/selftest/output/html.pm8
-rw-r--r--source4/selftest/output/plain.pm19
3 files changed, 24 insertions, 15 deletions
diff --git a/source4/selftest/output/buildfarm.pm b/source4/selftest/output/buildfarm.pm
index 81ffd5012c..af61376446 100644
--- a/source4/selftest/output/buildfarm.pm
+++ b/source4/selftest/output/buildfarm.pm
@@ -7,11 +7,11 @@ use Exporter;
use strict;
-sub new($$$$) {
- my ($class, $statistics) = @_;
+sub new($$$) {
+ my ($class) = @_;
my $self = {
- statistics => $statistics,
- test_output => {}
+ test_output => {},
+ start_time => time()
};
bless($self, $class);
}
@@ -24,7 +24,7 @@ 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};
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
$out .= "Running test $name (level 0 stdout)\n";
$out .= "--==--==--==--==--==--==--==--==--==--==--\n";
@@ -103,6 +103,8 @@ sub end_test($$$$$$)
sub summary($)
{
my ($self) = @_;
+
+ print "DURATION: " . (time() - $self->{start_time}) . " seconds\n";
}
sub skip_testsuite($$$$)
diff --git a/source4/selftest/output/html.pm b/source4/selftest/output/html.pm
index 13d2f10938..1e2dacac6f 100644
--- a/source4/selftest/output/html.pm
+++ b/source4/selftest/output/html.pm
@@ -9,13 +9,13 @@ use warnings;
use FindBin qw($RealBin);
-sub new($$$$) {
+sub new$($$$) {
my ($class, $dirname, $statistics) = @_;
my $self = {
dirname => $dirname,
- statistics => $statistics,
active_test => undef,
local_statistics => {},
+ statistics => {},
msg => "",
error_summary => {
skip => [],
@@ -248,7 +248,9 @@ sub summary($)
print INDEX "<tr>\n";
print INDEX " <td class=\"testSuiteTotal\">Total</td>\n";
- if ($st->{SUITES_FAIL} == 0) {
+ if ($st->{TESTS_UNEXPECTED_OK} == 0 and
+ $st->{TESTS_UNEXPECTED_FAIL} == 0 and
+ $st->{TESTS_ERROR} == 0) {
print INDEX " <td class=\"resultOk\">";
} else {
print INDEX " <td class=\"resultFailure\">";
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";
}
}