summaryrefslogtreecommitdiff
path: root/selftest/output
diff options
context:
space:
mode:
Diffstat (limited to 'selftest/output')
-rw-r--r--selftest/output/html.pm10
-rw-r--r--selftest/output/plain.pm13
-rw-r--r--selftest/output/subunit.pm7
3 files changed, 26 insertions, 4 deletions
diff --git a/selftest/output/html.pm b/selftest/output/html.pm
index e490765d06..d4d8204ea8 100644
--- a/selftest/output/html.pm
+++ b/selftest/output/html.pm
@@ -138,7 +138,7 @@ sub end_testsuite($$$$)
print TEST "</table>\n";
- print TEST "<div class=\"duration\">Duration: " . (time() - $self->{START_TIME}) . "s</div>\n";
+ print TEST "<div class=\"duration\">Duration: " . ($self->{last_time} - $self->{START_TIME}) . "s</div>\n";
$self->print_html_footer(*TEST);
@@ -192,12 +192,18 @@ sub end_testsuite($$$$)
print INDEX "</tr>\n";
}
+sub report_time($$)
+{
+ my ($self, $time) = @_;
+ $self->{last_time} = $time;
+}
+
sub start_test($$)
{
my ($self, $parents, $testname) = @_;
if ($#$parents == -1) {
- $self->{START_TIME} = time();
+ $self->{START_TIME} = $self->{last_time};
$self->start_testsuite($testname);
return;
}
diff --git a/selftest/output/plain.pm b/selftest/output/plain.pm
index 5312a9e27b..26056038f5 100644
--- a/selftest/output/plain.pm
+++ b/selftest/output/plain.pm
@@ -29,7 +29,7 @@ sub new($$$$$$$) {
verbose => $verbose,
immediate => $immediate,
statistics => $statistics,
- start_time => time(),
+ start_time => undef,
test_output => {},
suitesfailed => [],
suites_ok => 0,
@@ -41,6 +41,15 @@ sub new($$$$$$$) {
bless($self, $class);
}
+sub report_time($$)
+{
+ my ($self, $time) = @_;
+ unless ($self->{start_time}) {
+ $self->{start_time} = $time;
+ }
+ $self->{last_time} = $time;
+}
+
sub output_msg($$);
sub start_testsuite($$)
@@ -49,7 +58,7 @@ sub start_testsuite($$)
$self->{index}++;
$self->{NAME} = $name;
- $self->{START_TIME} = time();
+ $self->{START_TIME} = $self->{last_time};
my $duration = $self->{START_TIME} - $self->{start_time};
diff --git a/selftest/output/subunit.pm b/selftest/output/subunit.pm
index 720fe7285c..e99b76c1b9 100644
--- a/selftest/output/subunit.pm
+++ b/selftest/output/subunit.pm
@@ -33,6 +33,13 @@ sub new($) {
bless($self, $class);
}
+sub report_time($$)
+{
+ my ($self, $time) = @_;
+ my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time);
+ printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec;
+}
+
sub start_testsuite($$)
{
my ($self, $name) = @_;