selftest: Remove testsuite parsing.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 13 Sep 2010 22:04:54 +0000 (00:04 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 14 Sep 2010 08:54:28 +0000 (10:54 +0200)
selftest/Subunit.pm
selftest/Subunit/Filter.pm

index 0f1f2844d66f688ed9aa0e4538e78dafdb7c8569..6d50fb398880f9a9084639941fa77d7295469bd4 100644 (file)
@@ -34,7 +34,7 @@ sub parse_results($$)
                        $msg_ops->control_msg($_);
                        $msg_ops->start_test($1);
                        push (@$open_tests, $1);
-               } elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail|skip-testsuite|testsuite-failure|testsuite-xfail|testsuite-success|testsuite-error): (.*?)( \[)?([ \t]*)( multipart)?\n/) {
+               } elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail): (.*?)( \[)?([ \t]*)( multipart)?\n/) {
                        $msg_ops->control_msg($_);
                        my $result = $1;
                        my $testname = $2;
@@ -49,51 +49,39 @@ sub parse_results($$)
                                }
 
                                unless ($terminated) {
-                                       $msg_ops->end_test($testname, "error", 1,
+                                       $msg_ops->end_test($testname, "error",
                                                               "reason ($result) interrupted\n");
                                        return 1;
                                }
                        }
                        if ($result eq "success" or $result eq "successful") {
                                pop(@$open_tests); #FIXME: Check that popped value == $testname 
-                               $msg_ops->end_test($testname, "success", 0, $reason);
+                               $msg_ops->end_test($testname, "success", $reason);
                        } elsif ($result eq "xfail" or $result eq "knownfail") {
                                pop(@$open_tests); #FIXME: Check that popped value == $testname
-                               $msg_ops->end_test($testname, "xfail", 0, $reason);
+                               $msg_ops->end_test($testname, "xfail", $reason);
                                $expected_fail++;
                        } elsif ($result eq "failure" or $result eq "fail") {
                                pop(@$open_tests); #FIXME: Check that popped value == $testname
-                               $msg_ops->end_test($testname, "failure", 1, $reason);
+                               $msg_ops->end_test($testname, "failure", $reason);
                        } elsif ($result eq "skip") {
                                # Allow tests to be skipped without prior announcement of test
                                my $last = pop(@$open_tests);
                                if (defined($last) and $last ne $testname) {
                                        push (@$open_tests, $testname);
                                }
-                               $msg_ops->end_test($testname, "skip", 0, $reason);
+                               $msg_ops->end_test($testname, "skip", $reason);
                        } elsif ($result eq "error") {
                                pop(@$open_tests); #FIXME: Check that popped value == $testname
-                               $msg_ops->end_test($testname, "error", 1, $reason);
-                       } elsif ($result eq "skip-testsuite") {
-                               $msg_ops->skip_testsuite($testname);
-                       } elsif ($result eq "testsuite-success") {
-                               $msg_ops->end_testsuite($testname, "success", $reason);
-                       } elsif ($result eq "testsuite-failure") {
-                               $msg_ops->end_testsuite($testname, "failure", $reason);
-                       } elsif ($result eq "testsuite-xfail") {
-                               $msg_ops->end_testsuite($testname, "xfail", $reason);
-                       } elsif ($result eq "testsuite-error") {
-                               $msg_ops->end_testsuite($testname, "error", $reason);
+                               $msg_ops->end_test($testname, "error", $reason);
                        }
-               } elsif (/^testsuite: (.*)\n/) {
-                       $msg_ops->start_testsuite($1);
                } else {
                        $msg_ops->output_msg($_);
                }
        }
 
        while ($#$open_tests+1 > 0) {
-               $msg_ops->end_test(pop(@$open_tests), "error", 1,
+               $msg_ops->end_test(pop(@$open_tests), "error",
                                   "was started but never finished!\n");
        }
 }
index 1c484269950c13eefc6953991dc3afd694a42006..5ac304f1ee1777d3427a1a7eb016ec0ca8525a43 100644 (file)
@@ -29,9 +29,9 @@ sub start_test($$)
        Subunit::start_test($testname);
 }
 
-sub end_test($$$$$)
+sub end_test($$$$)
 {
-       my ($self, $testname, $result, $unexpected, $reason) = @_;
+       my ($self, $testname, $result, $reason) = @_;
 
        if (defined($self->{prefix})) {
                $testname = $self->{prefix}.$testname;
@@ -40,24 +40,6 @@ sub end_test($$$$$)
        Subunit::end_test($testname, $result, $reason);
 }
 
-sub skip_testsuite($;$)
-{
-       my ($self, $name, $reason) = @_;
-       Subunit::skip_testsuite($name, $reason);
-}
-
-sub start_testsuite($;$)
-{
-       my ($self, $name) = @_;
-       Subunit::start_testsuite($name);
-}
-
-sub end_testsuite($$;$)
-{
-       my ($self, $name, $result, $reason) = @_;
-       Subunit::end_testsuite($name, $result, $reason);
-}
-
 sub new {
        my ($class, $prefix) = @_;