[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha7-1986-gb0654b3
Jelmer Vernooij
jelmer at samba.org
Wed Jun 3 15:24:45 GMT 2009
The branch, master has been updated
via b0654b332360437e046bbc921f91df8c5b5c57e2 (commit)
via 2e7022eda0adcc5bc7e4681497a52d05cb096e3f (commit)
from 7fddc71caa89ce5303b5f9fc84d2c50ed84f32de (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b0654b332360437e046bbc921f91df8c5b5c57e2
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Wed Jun 3 17:16:56 2009 +0200
selftest: Add script that can take a subunit stream and format it.
commit 2e7022eda0adcc5bc7e4681497a52d05cb096e3f
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Wed Jun 3 17:16:25 2009 +0200
selftest/plain: Allow caller to not specify the number of expected
testsuites to run.
-----------------------------------------------------------------------
Summary of changes:
selftest/format-subunit.pl | 68 ++++++++++++++++++++++++++++++++++++++++++++
selftest/output/plain.pm | 6 +++-
2 files changed, 73 insertions(+), 1 deletions(-)
create mode 100755 selftest/format-subunit.pl
Changeset truncated at 500 lines:
diff --git a/selftest/format-subunit.pl b/selftest/format-subunit.pl
new file mode 100755
index 0000000..000346a
--- /dev/null
+++ b/selftest/format-subunit.pl
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+# Pretty-format subunit output
+# Copyright (C) Jelmer Vernooij <jelmer at samba.org>
+# Published under the GNU GPL, v3 or later
+
+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);
+
+if (defined($ENV{RUN_FROM_BUILD_FARM}) and
+ ($ENV{RUN_FROM_BUILD_FARM} eq "yes")) {
+ $opt_format = "buildfarm";
+}
+
+my $msg_ops;
+
+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 "buildfarm") {
+ require output::buildfarm;
+ $msg_ops = new output::buildfarm($statistics);
+} elsif ($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; }, []);
+
+$msg_ops->summary();
+
+exit($expected_ret);
diff --git a/selftest/output/plain.pm b/selftest/output/plain.pm
index 2605603..509e066 100644
--- a/selftest/output/plain.pm
+++ b/selftest/output/plain.pm
@@ -65,7 +65,11 @@ sub start_testsuite($$)
$self->{test_output}->{$name} = "" unless($self->{verbose});
my $out = "";
- $out .= "[$self->{index}/$self->{totalsuites} in ".$duration."s";
+ $out .= "[$self->{index}";
+ if ($self->{totalsuites}) {
+ $out .= "/$self->{totalsuites}";
+ }
+ $out.= " in ".$duration."s";
$out .= sprintf(", %d errors", ($#{$self->{suitesfailed}}+1)) if ($#{$self->{suitesfailed}} > -1);
$out .= "] $name";
if ($self->{immediate}) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list