summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-19 14:26:18 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-20 16:50:27 +1100
commit429102e6bde396492e53a1984242de46e28dd9d1 (patch)
tree5ff6015871522479bcf72358fbea0e619038045b
parent77b77e6ba13137522b542d364891aba031a3ede8 (diff)
downloadsamba-429102e6bde396492e53a1984242de46e28dd9d1.tar.gz
samba-429102e6bde396492e53a1984242de46e28dd9d1.tar.bz2
samba-429102e6bde396492e53a1984242de46e28dd9d1.zip
subunit: fixed reporting of unexpected failures
-rw-r--r--selftest/Subunit.pm17
1 files changed, 10 insertions, 7 deletions
diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm
index 718b8ce43d..2a9fc0e48b 100644
--- a/selftest/Subunit.pm
+++ b/selftest/Subunit.pm
@@ -27,8 +27,6 @@ sub parse_results($$$)
{
my ($msg_ops, $statistics, $fh) = @_;
my $expected_fail = 0;
- my $unexpected_fail = 0;
- my $unexpected_err = 0;
my $open_tests = [];
while(<$fh>) {
@@ -72,7 +70,6 @@ sub parse_results($$$)
pop(@$open_tests); #FIXME: Check that popped value == $testname
$statistics->{TESTS_UNEXPECTED_FAIL}++;
$msg_ops->end_test($testname, "failure", 1, $reason);
- $unexpected_fail++;
} elsif ($result eq "skip") {
$statistics->{TESTS_SKIP}++;
# Allow tests to be skipped without prior announcement of test
@@ -85,7 +82,6 @@ sub parse_results($$$)
$statistics->{TESTS_ERROR}++;
pop(@$open_tests); #FIXME: Check that popped value == $testname
$msg_ops->end_test($testname, "error", 1, $reason);
- $unexpected_err++;
} elsif ($result eq "skip-testsuite") {
$msg_ops->skip_testsuite($testname);
} elsif ($result eq "testsuite-success") {
@@ -110,11 +106,18 @@ sub parse_results($$$)
$msg_ops->end_test(pop(@$open_tests), "error", 1,
"was started but never finished!");
$statistics->{TESTS_ERROR}++;
- $unexpected_err++;
}
- return 1 if $unexpected_err > 0;
- return 1 if $unexpected_fail > 0;
+ # if the Filter module is in use, it will have the right counts
+ if (defined($msg_ops->{total_error})) {
+ $statistics->{TESTS_ERROR} = $msg_ops->{total_error};
+ $statistics->{TESTS_UNEXPECTED_FAIL} = $msg_ops->{total_fail};
+ $statistics->{TESTS_EXPECTED_FAIL} = $msg_ops->{total_xfail};
+ }
+
+ return 1 if $statistics->{TESTS_ERROR} > 0;
+ return 1 if $statistics->{TESTS_UNEXPECTED_FAIL} > 0;
+
return 0;
}