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 Subunit::report_time($time);
42 sub start_testsuite($$)
44 my ($self, $name) = @_;
46 $self->{NAME} = $name;
48 Subunit::start_test($self->{NAME});
53 my ($self, $output) = @_;
60 my ($self, $output) = @_;
63 sub end_testsuite($$$$$$)
65 my ($self, $name, $result, $unexpected, $reason) = @_;
67 if ($result eq "failure" and not $unexpected) { $result = "xfail"; }
69 Subunit::end_test($name, $result, $reason);
74 my ($self, $testname) = @_;
76 Subunit::start_test($testname);
81 my ($self, $testname, $result, $unexpected, $reason) = @_;
83 if ($result eq "fail" and not $unexpected) { $result = "xfail"; }
85 Subunit::end_test($testname, $result, $reason);
93 sub skip_testsuite($$$$)
95 my ($self, $name, $reason) = @_;
97 Subunit::start_test($name);
98 Subunit::end_test($name, "skip", $reason);