1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

subunit.pm: Pass through milliseconds in time reports.

This commit is contained in:
Jelmer Vernooij 2010-09-13 23:22:35 +02:00
parent 9f3a43c018
commit 49411fa107
3 changed files with 10 additions and 12 deletions

View File

@ -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;

View File

@ -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()

View File

@ -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;