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);
36 sub start_testsuite($$)
38 my ($self, $name) = @_;
40 $self->{NAME} = $name;
42 print "test: $self->{NAME}\n";
47 my ($self, $output) = @_;
54 my ($self, $output) = @_;
57 sub end_testsuite($$$$$$)
59 my ($self, $name, $result, $unexpected, $reason) = @_;
61 if ($result eq "failure" and not $unexpected) { $result = "xfail"; }
64 print "$result: $name [ $reason ]\n";
66 print "$result: $name\n";
72 my ($self, $parents, $testname) = @_;
74 print "test: $testname\n";
79 my ($self, $parents, $testname, $result, $unexpected, $reason) = @_;
81 if ($result eq "fail" and not $unexpected) { $result = "xfail"; }
84 print "$result: $testname [ $reason ]\n";
86 print "$result: $testname\n";
95 sub skip_testsuite($$$$)
97 my ($self, $name, $reason) = @_;
99 print "skip: $name\n";