summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-06-12 14:34:24 +0200
committerJelmer Vernooij <jelmer@samba.org>2009-06-12 14:34:24 +0200
commit718f9be8a2530a11e1cb16b68511b4c910a1c320 (patch)
treeca4a286b38f54c896b6931c5f1a4dc11159f328d /selftest
parent13e1654c4a1f8cf2ec38d4d56ae79790b7926c62 (diff)
downloadsamba-718f9be8a2530a11e1cb16b68511b4c910a1c320.tar.gz
samba-718f9be8a2530a11e1cb16b68511b4c910a1c320.tar.bz2
samba-718f9be8a2530a11e1cb16b68511b4c910a1c320.zip
selftest: Add option to strip output of succeeded tests, and use it on
the buildfarm. The matches the behaviour we had earlier in the previous output format.
Diffstat (limited to 'selftest')
-rw-r--r--selftest/Subunit/Filter.pm20
-rwxr-xr-xselftest/filter-subunit.pl5
2 files changed, 22 insertions, 3 deletions
diff --git a/selftest/Subunit/Filter.pm b/selftest/Subunit/Filter.pm
index 443baeb7dd..93b690df8e 100644
--- a/selftest/Subunit/Filter.pm
+++ b/selftest/Subunit/Filter.pm
@@ -54,7 +54,11 @@ sub report_time($$)
sub output_msg($$)
{
my ($self, $msg) = @_;
- print $msg;
+ unless(defined($self->{output})) {
+ print $msg;
+ } else {
+ $self->{output}.=$msg;
+ }
}
sub start_test($$)
@@ -65,6 +69,10 @@ sub start_test($$)
$testname = $self->{prefix}.$testname;
}
+ if ($self->{strip_ok_output}) {
+ $self->{output} = "";
+ }
+
Subunit::start_test($testname);
}
@@ -87,6 +95,13 @@ sub end_test($$$$$)
$reason .= $xfail_reason;
}
+ if ($self->{strip_ok_output}) {
+ unless ($result eq "success" or $result eq "xfail" or $result eq "skip") {
+ print $self->{output}
+ }
+ }
+ $self->{output} = undef;
+
Subunit::end_test($testname, $result, $reason);
}
@@ -120,11 +135,12 @@ sub testsuite_count($$)
}
sub new {
- my ($class, $prefix, $expected_failures) = @_;
+ my ($class, $prefix, $expected_failures, $strip_ok_output) = @_;
my $self = {
prefix => $prefix,
expected_failures => $expected_failures,
+ strip_ok_output => $strip_ok_output,
xfail_added => 0,
};
bless($self, $class);
diff --git a/selftest/filter-subunit.pl b/selftest/filter-subunit.pl
index 1c25db6f59..5a2e5e38ef 100755
--- a/selftest/filter-subunit.pl
+++ b/selftest/filter-subunit.pl
@@ -62,10 +62,12 @@ use Subunit::Filter;
my $opt_expected_failures = undef;
my $opt_help = 0;
my $opt_prefix = undef;
+my $opt_strip_ok_output = 0;
my @expected_failures = ();
my $result = GetOptions(
'expected-failures=s' => \$opt_expected_failures,
+ 'strip-passed-output' => \$opt_strip_ok_output,
'prefix=s' => \$opt_prefix,
'help' => \$opt_help,
);
@@ -89,7 +91,8 @@ my $statistics = {
TESTS_SKIP => 0,
};
-my $msg_ops = new Subunit::Filter($opt_prefix, \@expected_failures);
+my $msg_ops = new Subunit::Filter($opt_prefix, \@expected_failures,
+ $opt_strip_ok_output);
parse_results($msg_ops, $statistics, *STDIN);