diff options
Diffstat (limited to 'source4/selftest/output/buildfarm.pm')
-rw-r--r-- | source4/selftest/output/buildfarm.pm | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source4/selftest/output/buildfarm.pm b/source4/selftest/output/buildfarm.pm index 7d6c3a987a..efb1e3ef5b 100644 --- a/source4/selftest/output/buildfarm.pm +++ b/source4/selftest/output/buildfarm.pm @@ -7,10 +7,10 @@ use Exporter; use strict; -sub new($$) { - my ($class) = @_; - my $self = { - start => time(), +sub new($$$$) { + my ($class, $statistics) = @_; + my $self = { + statistics => $statistics, test_output => {} }; bless($self, $class); @@ -21,11 +21,12 @@ sub start_testsuite($$) my ($self, $state) = @_; my $out = ""; + my $duration = $state->{START_TIME} - $self->{statistics}->{START_TIME}; $out .= "--==--==--==--==--==--==--==--==--==--==--\n"; $out .= "Running test $state->{NAME} (level 0 stdout)\n"; $out .= "--==--==--==--==--==--==--==--==--==--==--\n"; $out .= scalar(localtime())."\n"; - $out .= "SELFTEST RUNTIME: " . ($state->{START_TIME} - $self->{START_TIME}) . "s\n"; + $out .= "SELFTEST RUNTIME: " . $duration . "s\n"; $out .= "NAME: $state->{NAME}\n"; $out .= "CMD: $state->{CMD}\n"; @@ -58,7 +59,7 @@ sub end_testsuite($$$$$) if ($ret == $expected_ret) { $out .= "ALL OK\n"; } else { - $out .= "ERROR: $ret"; + $out .= "ERROR: $ret\n"; $out .= $self->{test_output}->{$state->{NAME}}; } @@ -84,7 +85,11 @@ sub start_test($$$) sub end_test($$$$$$) { - my ($self, $state, $testname, $result, $expected, $reason) = @_; + my ($self, $state, $testname, $result, $unexpected, $reason) = @_; + + return unless ($unexpected); + + $self->{test_output}->{$state->{NAME}} .= "UNEXPECTED($result): $testname\n"; } sub summary($) @@ -99,11 +104,11 @@ sub missing_env($$$) print "FAIL: $name (ENV[$envname] not available!)\n"; } -sub skip_testsuite($$) +sub skip_testsuite($$$$) { - my ($self, $name) = @_; + my ($self, $envname, $name, $reason) = @_; - print "SKIPPED: $name\n"; + # Ignore skipped tests } 1; |