Commit 49411fa1 authored by Jelmer Vernooij's avatar Jelmer Vernooij

subunit.pm: Pass through milliseconds in time reports.

parent 9f3a43c0
......@@ -71,7 +71,7 @@ struct torture_context *torture_context_child(struct torture_context *parent)
subtorture->results = talloc_reference(subtorture, parent->results);
return subtorture;
}
}
/**
create a temporary directory.
......@@ -343,7 +343,6 @@ static bool internal_torture_run_test(struct torture_context *context,
context->active_testname = talloc_asprintf(context, "%s-%s", old_testname, test->name);
}
context->active_tcase = tcase;
context->active_test = test;
......
......@@ -23,13 +23,6 @@ require Exporter;
use strict;
eval {
require Time::HiRes;
};
unless ($@) {
use Time::HiRes qw(time);
}
sub parse_results($$$)
{
my ($msg_ops, $statistics, $fh) = @_;
......@@ -41,8 +34,6 @@ sub parse_results($$$)
$msg_ops->control_msg($_);
$msg_ops->start_test($1);
push (@$open_tests, $1);
} elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)\n/) {
$msg_ops->report_time(mktime($6, $5, $4, $3, $2-1, $1-1900));
} elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail|skip-testsuite|testsuite-failure|testsuite-xfail|testsuite-success|testsuite-error): (.*?)( \[)?([ \t]*)( multipart)?\n/) {
$msg_ops->control_msg($_);
my $result = $1;
......@@ -179,7 +170,8 @@ sub report_time($)
{
my ($time) = @_;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time);
printf "time: %04d-%02d-%02d %02d:%02d:%02d\n", $year+1900, $mon+1, $mday, $hour, $min, $sec;
$sec = ($time - int($time) + $sec);
printf "time: %04d-%02d-%02d %02d:%02d:%02f\n", $year+1900, $mon+1, $mday, $hour, $min, $sec;
}
sub progress_pop()
......
......@@ -134,6 +134,13 @@ use Subunit qw(parse_results);
use Subunit::Filter;
use SocketWrapper;
eval {
require Time::HiRes;
};
unless ($@) {
use Time::HiRes qw(time);
}
my $opt_help = 0;
my $opt_target = "samba4";
my $opt_quick = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment