From b607f9968818811759ee744afeebab4880d2c5de Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 28 Mar 2010 21:42:34 +0200 Subject: Remove extension from format-subunit. --- selftest/format-subunit | 91 ++++++++++++++++++++++++++++++++++++++++++++++ selftest/format-subunit.pl | 91 ---------------------------------------------- 2 files changed, 91 insertions(+), 91 deletions(-) create mode 100755 selftest/format-subunit delete mode 100755 selftest/format-subunit.pl (limited to 'selftest') diff --git a/selftest/format-subunit b/selftest/format-subunit new file mode 100755 index 0000000000..472f51a815 --- /dev/null +++ b/selftest/format-subunit @@ -0,0 +1,91 @@ +#!/usr/bin/perl +# Pretty-format subunit output +# 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); +use lib "$RealBin"; +use Subunit qw(parse_results); + +my $opt_format = "plain"; +my $opt_help = undef; +my $opt_verbose = 0; +my $opt_immediate = 0; +my $opt_prefix = "."; + +my $result = GetOptions ( + 'help|h|?' => \$opt_help, + 'format=s' => \$opt_format, + 'verbose' => \$opt_verbose, + 'immediate' => \$opt_immediate, + 'prefix:s' => \$opt_prefix, + ); + +exit(1) if (not $result); + +my $msg_ops; + +# we want unbuffered output +$| = 1; + +my $statistics = { + SUITES_FAIL => 0, + + TESTS_UNEXPECTED_OK => 0, + TESTS_EXPECTED_OK => 0, + TESTS_UNEXPECTED_FAIL => 0, + TESTS_EXPECTED_FAIL => 0, + TESTS_ERROR => 0, + TESTS_SKIP => 0, +}; + +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); +} else { + die("Invalid output format '$opt_format'"); +} + +my $expected_ret = parse_results($msg_ops, $statistics, *STDIN); + +$msg_ops->summary(); + +exit($expected_ret); diff --git a/selftest/format-subunit.pl b/selftest/format-subunit.pl deleted file mode 100755 index 472f51a815..0000000000 --- a/selftest/format-subunit.pl +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/perl -# Pretty-format subunit output -# 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); -use lib "$RealBin"; -use Subunit qw(parse_results); - -my $opt_format = "plain"; -my $opt_help = undef; -my $opt_verbose = 0; -my $opt_immediate = 0; -my $opt_prefix = "."; - -my $result = GetOptions ( - 'help|h|?' => \$opt_help, - 'format=s' => \$opt_format, - 'verbose' => \$opt_verbose, - 'immediate' => \$opt_immediate, - 'prefix:s' => \$opt_prefix, - ); - -exit(1) if (not $result); - -my $msg_ops; - -# we want unbuffered output -$| = 1; - -my $statistics = { - SUITES_FAIL => 0, - - TESTS_UNEXPECTED_OK => 0, - TESTS_EXPECTED_OK => 0, - TESTS_UNEXPECTED_FAIL => 0, - TESTS_EXPECTED_FAIL => 0, - TESTS_ERROR => 0, - TESTS_SKIP => 0, -}; - -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); -} else { - die("Invalid output format '$opt_format'"); -} - -my $expected_ret = parse_results($msg_ops, $statistics, *STDIN); - -$msg_ops->summary(); - -exit($expected_ret); -- cgit