2 # Subunit output for selftest
3 # Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package output::subunit;
23 use FindBin qw($RealBin);
24 use lib "$RealBin/..";
26 use Subunit qw(parse_results);
38 my ($self, $time) = @_;
39 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time);
40 printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec;
43 sub start_testsuite($$)
45 my ($self, $name) = @_;
47 $self->{NAME} = $name;
49 print "test: $self->{NAME}\n";
54 my ($self, $output) = @_;
61 my ($self, $output) = @_;
64 sub end_testsuite($$$$$$)
66 my ($self, $name, $result, $unexpected, $reason) = @_;
68 if ($result eq "failure" and not $unexpected) { $result = "xfail"; }
71 print "$result: $name [ $reason ]\n";
73 print "$result: $name\n";
79 my ($self, $parents, $testname) = @_;
81 print "test: $testname\n";
86 my ($self, $parents, $testname, $result, $unexpected, $reason) = @_;
88 if ($result eq "fail" and not $unexpected) { $result = "xfail"; }
91 print "$result: $testname [ $reason ]\n";
93 print "$result: $testname\n";
102 sub skip_testsuite($$$$)
104 my ($self, $name, $reason) = @_;
106 print "skip: $name\n";