summaryrefslogtreecommitdiff
path: root/selftest/Subunit.pm
diff options
context:
space:
mode:
authorAndrew Kroeger <andrew@id10ts.net>2009-09-04 16:42:28 -0500
committerAndrew Tridgell <tridge@samba.org>2009-09-05 10:06:29 +1000
commit5afa115f2ad150563fdf8ba978e5f165d75eba4b (patch)
treef96079bd0243a4a2d6f4bd75b2366d5dac03515c /selftest/Subunit.pm
parentab6e82910af87ca4c4572d973fb657c4004b443b (diff)
downloadsamba-5afa115f2ad150563fdf8ba978e5f165d75eba4b.tar.gz
selftest: Account for 0-based months in date parsing and printing.
All: Please find attached 2 patches to correct date/time parsing and output in the Subunit processing. The first patch corrects the logic to account for months being 0-based. The second corrects the time formatting, as it is dealing with local, not "Z"ulu (UTC) time. Sincerely, Andrew Kroeger >From 3cf81eea1309084a973359c7f6a2375d5d20a3f0 Mon Sep 17 00:00:00 2001 From: Andrew Kroeger <andrew@id10ts.net> Date: Fri, 4 Sep 2009 01:24:00 -0500 Subject: [PATCH] selftest: Account for 0-based months in date parsing and printing.
Diffstat (limited to 'selftest/Subunit.pm')
-rw-r--r--selftest/Subunit.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm
index ecd712a9a3b..9d67c8137af 100644
--- a/selftest/Subunit.pm
+++ b/selftest/Subunit.pm
@@ -36,8 +36,8 @@ sub parse_results($$$)
$msg_ops->control_msg($_);
$msg_ops->start_test($1);
push (@$open_tests, $1);
- } elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)Z\n/) {
- $msg_ops->report_time(mktime($6, $5, $4, $3, $2, $1-1900));
+ } 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]*)\n/) {
$msg_ops->control_msg($_);
my $result = $1;
@@ -170,7 +170,7 @@ sub report_time($)
{
my ($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;
+ printf "time: %04d-%02d-%02d %02d:%02d:%02d\n", $year+1900, $mon+1, $mday, $hour, $min, $sec;
}
# The following are Samba extensions: