1 # Perl module for parsing and generating the Subunit protocol
2 # Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29 print "test: $testname\n";
38 print "$result: $name [\n";
40 if (substr($reason, -1, 1) ne "\n") { print "\n"; }
43 print "$result: $name\n";
50 $time = Time
::HiRes
::time() unless (defined($time));
51 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime($time);
52 $sec = ($time - int($time) + $sec);
53 my $msg = sprintf("%f", $sec);
54 if (substr($msg, 1, 1) eq ".") {
57 printf "time: %04d-%02d-%02d %02d:%02d:%s\n", $year+1900, $mon+1, $mday, $hour, $min, $msg;
62 print "progress: pop\n";
67 print "progress: push\n";
72 my ($count, $whence) = @_;
74 unless(defined($whence)) {
78 print "progress: $whence$count\n";
81 # The following are Samba extensions:
83 sub start_testsuite
($)
86 print "testsuite: $name\n";
89 sub skip_testsuite
($;$)
91 my ($name, $reason) = @_;
93 print "skip-testsuite: $name [\n$reason\n]\n";
95 print "skip-testsuite: $name\n";
99 sub end_testsuite
($$;$)
105 print "testsuite-$result: $name [\n";
109 print "testsuite-$result: $name\n";