Support reporting current time in selftest output.
[ira/wip.git] / selftest / output / html.pm
index e490765d06adee5ef53cf54ac0f3e43644a300fa..d4d8204ea889eb6393d1cfafbd10c1ada47b5e4d 100644 (file)
@@ -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;
        }