3 package output
::buildfarm
;
8 use FindBin
qw($RealBin);
11 use Subunit qw(parse_results);
24 sub start_testsuite
($$)
26 my ($self, $name) = @_;
29 $self->{NAME
} = $name;
30 $self->{START_TIME
} = time();
32 my $duration = $self->{START_TIME
} - $self->{start_time
};
33 $out .= "--==--==--==--==--==--==--==--==--==--==--\n";
34 $out .= "Running test $name (level 0 stdout)\n";
35 $out .= "--==--==--==--==--==--==--==--==--==--==--\n";
36 $out .= scalar(localtime())."\n";
37 $out .= "SELFTEST RUNTIME: " . $duration . "s\n";
38 $out .= "NAME: $name\n";
40 $self->{test_output
}->{$name} = "";
47 my ($self, $output) = @_;
49 $self->{test_output
}->{$self->{NAME
}} .= $output;
54 my ($self, $output) = @_;
56 $self->{test_output
}->{$self->{NAME
}} .= $output;
59 sub end_testsuite
($$$$$$)
61 my ($self, $name, $result, $unexpected, $reason) = @_;
64 $out .= "TEST RUNTIME: " . (time() - $self->{START_TIME
}) . "s\n";
66 if (not $unexpected) {
69 $out .= "ERROR: $reason\n";
70 $out .= $self->{test_output
}->{$name};
73 $out .= "==========================================\n";
74 if (not $unexpected) {
75 $out .= "TEST PASSED: $name\n";
77 $out .= "TEST FAILED: $name (status $reason)\n";
79 $out .= "==========================================\n";
86 my ($self, $parents, $testname) = @_;
88 if ($#$parents == -1) {
89 $self->start_testsuite($testname);
95 my ($self, $parents, $testname, $result, $unexpected, $reason) = @_;
98 $self->{test_output
}->{$self->{NAME
}} .= "UNEXPECTED($result): $testname\n";
101 if ($#$parents == -1) {
102 $self->end_testsuite($testname, $result, $unexpected, $reason);
110 print "DURATION: " . (time() - $self->{start_time
}) . " seconds\n";
113 sub skip_testsuite
($$$$)
115 my ($self, $name, $reason) = @_;
117 print "SKIPPED: $name\n";