summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-13 23:22:35 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-14 10:54:27 +0200
commit49411fa1079fc78cba4751d57a3c76096fc1b772 (patch)
treefd76af8f43ebf21ad138b9aa0f41f64a9ea4a77f
parent9f3a43c0182b8b13b2f4ff615b5aca816f4f05b3 (diff)
downloadsamba-49411fa1079fc78cba4751d57a3c76096fc1b772.tar.gz
samba-49411fa1079fc78cba4751d57a3c76096fc1b772.tar.bz2
samba-49411fa1079fc78cba4751d57a3c76096fc1b772.zip
subunit.pm: Pass through milliseconds in time reports.
-rw-r--r--lib/torture/torture.c3
-rw-r--r--selftest/Subunit.pm12
-rwxr-xr-xselftest/selftest.pl7
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/torture/torture.c b/lib/torture/torture.c
index 27b2bdcc93..0bf50ccbae 100644
--- a/lib/torture/torture.c
+++ b/lib/torture/torture.c
@@ -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;
diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm
index a3a2113e4e..693de1550e 100644
--- a/selftest/Subunit.pm
+++ b/selftest/Subunit.pm
@@ -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()
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 00db9518cc..75110708cc 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -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;