X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=selftest%2Fformat-subunit.pl;h=472f51a815badbee4c66f964f225fb8b02d716ed;hp=000346a9affd2b5f75b2cac92f248b4d76bd4cbf;hb=3bb3667b4378702ba63352bfc172869379249302;hpb=b0654b332360437e046bbc921f91df8c5b5c57e2 diff --git a/selftest/format-subunit.pl b/selftest/format-subunit.pl index 000346a9aff..472f51a815b 100755 --- a/selftest/format-subunit.pl +++ b/selftest/format-subunit.pl @@ -3,6 +3,38 @@ # Copyright (C) Jelmer Vernooij # Published under the GNU GPL, v3 or later +=pod + +=head1 NAME + +format-subunit [--format=] [--immediate] < instream > outstream + +=head1 SYNOPSIS + +Format the output of a subunit stream. + +=head1 OPTIONS + +=over 4 + +=item I<--immediate> + +Show errors as soon as they happen rather than at the end of the test run. + +=item I<--format>=FORMAT + +Choose the format to print. Currently supported are plain or html. + +=head1 LICENSE + +GNU General Public License, version 3 or later. + +=head1 AUTHOR + +Jelmer Vernooij + +=cut + use Getopt::Long; use strict; use FindBin qw($RealBin $Script); @@ -25,13 +57,11 @@ my $result = GetOptions ( exit(1) if (not $result); -if (defined($ENV{RUN_FROM_BUILD_FARM}) and - ($ENV{RUN_FROM_BUILD_FARM} eq "yes")) { - $opt_format = "buildfarm"; -} - my $msg_ops; +# we want unbuffered output +$| = 1; + my $statistics = { SUITES_FAIL => 0, @@ -43,25 +73,18 @@ my $statistics = { TESTS_SKIP => 0, }; -if ($opt_format eq "buildfarm") { - require output::buildfarm; - $msg_ops = new output::buildfarm($statistics); -} elsif ($opt_format eq "plain") { +if ($opt_format eq "plain") { require output::plain; $msg_ops = new output::plain("$opt_prefix/summary", $opt_verbose, $opt_immediate, $statistics, undef); } elsif ($opt_format eq "html") { require output::html; mkdir("test-results", 0777); $msg_ops = new output::html("test-results", $statistics); -} elsif ($opt_format eq "subunit") { - require output::subunit; - $msg_ops = new output::subunit(); } else { die("Invalid output format '$opt_format'"); } -my $expected_ret = parse_results( - $msg_ops, $statistics, *STDIN, sub { return 0; }, []); +my $expected_ret = parse_results($msg_ops, $statistics, *STDIN); $msg_ops->summary();