diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-06-05 14:06:32 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-06-11 19:59:58 +0200 |
commit | 8a76e4ab29264e0c2aa7b9f786fcaff42ae42ed9 (patch) | |
tree | 2e1271b2784b02a1831b224366b133af00a79a53 /selftest | |
parent | 4308e69084c3455072a4e256c84bf3b2b013f31e (diff) | |
download | samba-8a76e4ab29264e0c2aa7b9f786fcaff42ae42ed9.tar.gz samba-8a76e4ab29264e0c2aa7b9f786fcaff42ae42ed9.tar.bz2 samba-8a76e4ab29264e0c2aa7b9f786fcaff42ae42ed9.zip |
selftest/subunit: Remove prefix command.
Diffstat (limited to 'selftest')
-rw-r--r-- | selftest/Subunit.pm | 21 | ||||
-rw-r--r-- | selftest/output/buildfarm.pm | 12 | ||||
-rw-r--r-- | selftest/output/html.pm | 19 | ||||
-rw-r--r-- | selftest/output/plain.pm | 21 | ||||
-rw-r--r-- | selftest/output/subunit.pm | 6 | ||||
-rwxr-xr-x | selftest/selftest.pl | 1 |
6 files changed, 19 insertions, 61 deletions
diff --git a/selftest/Subunit.pm b/selftest/Subunit.pm index ddecfe4369..5ee8743c6c 100644 --- a/selftest/Subunit.pm +++ b/selftest/Subunit.pm @@ -29,7 +29,6 @@ sub parse_results($$$$) my $unexpected_ok = 0; my $expected_fail = 0; my $unexpected_fail = 0; - my $prefix = ""; my $unexpected_err = 0; my $orig_open_len = $#$open_tests; @@ -40,8 +39,6 @@ sub parse_results($$$$) push (@$open_tests, $1); } elsif (/^time: (\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)Z\n/) { $msg_ops->report_time(mktime($6, $5, $4, $3, $2, $1)); - } elsif (/^prefix: (.*)\n/) { - $prefix = $1; } elsif (/^(success|successful|failure|fail|skip|knownfail|error|xfail): (.*?)( \[)?([ \t]*)\n/) { $msg_ops->control_msg($_); my $result = $1; @@ -58,23 +55,23 @@ sub parse_results($$$$) unless ($terminated) { $statistics->{TESTS_ERROR}++; - $msg_ops->end_test($open_tests, $testname, $result, 1, "reason interrupted"); + $msg_ops->end_test($testname, $result, 1, "reason interrupted"); return 1; } } if ($result eq "success" or $result eq "successful") { pop(@$open_tests); #FIXME: Check that popped value == $testname $statistics->{TESTS_EXPECTED_OK}++; - $msg_ops->end_test($open_tests, $testname, $result, 0, $reason); + $msg_ops->end_test($testname, $result, 0, $reason); } elsif ($result eq "xfail" or $result eq "knownfail") { pop(@$open_tests); #FIXME: Check that popped value == $testname $statistics->{TESTS_EXPECTED_FAIL}++; - $msg_ops->end_test($open_tests, $testname, $result, 0, $reason); + $msg_ops->end_test($testname, $result, 0, $reason); $expected_fail++; } elsif ($result eq "failure" or $result eq "fail") { pop(@$open_tests); #FIXME: Check that popped value == $testname $statistics->{TESTS_UNEXPECTED_FAIL}++; - $msg_ops->end_test($open_tests, $testname, $result, 1, $reason); + $msg_ops->end_test($testname, $result, 1, $reason); $unexpected_fail++; } elsif ($result eq "skip") { $statistics->{TESTS_SKIP}++; @@ -82,11 +79,11 @@ sub parse_results($$$$) if (defined($last) and $last ne $testname) { push (@$open_tests, $testname); } - $msg_ops->end_test($open_tests, $testname, $result, 0, $reason); + $msg_ops->end_test($testname, $result, 0, $reason); } elsif ($result eq "error") { $statistics->{TESTS_ERROR}++; pop(@$open_tests); #FIXME: Check that popped value == $testname - $msg_ops->end_test($open_tests, $testname, $result, 1, $reason); + $msg_ops->end_test($testname, $result, 1, $reason); $unexpected_err++; } } else { @@ -136,10 +133,4 @@ sub report_time($) printf "time: %04d-%02d-%02d %02d:%02d:%02dZ\n", $year+1900, $mon, $mday, $hour, $min, $sec; } -sub prefix($) -{ - my ($prefix) = @_; - print "prefix: $prefix\n"; -} - 1; diff --git a/selftest/output/buildfarm.pm b/selftest/output/buildfarm.pm index 701444359b..a9923e9fd1 100644 --- a/selftest/output/buildfarm.pm +++ b/selftest/output/buildfarm.pm @@ -87,24 +87,16 @@ sub end_testsuite($$$$$$) sub start_test($$$) { - my ($self, $parents, $testname) = @_; - - if ($#$parents == -1) { - $self->start_testsuite($testname); - } + my ($self, $testname) = @_; } sub end_test($$$$$) { - my ($self, $parents, $testname, $result, $unexpected, $reason) = @_; + my ($self, $testname, $result, $unexpected, $reason) = @_; if ($unexpected) { $self->{test_output}->{$self->{NAME}} .= "UNEXPECTED($result): $testname\n"; } - - if ($#$parents == -1) { - $self->end_testsuite($testname, $result, $unexpected, $reason); - } } sub summary($) diff --git a/selftest/output/html.pm b/selftest/output/html.pm index d4d8204ea8..c3ed4ca5e7 100644 --- a/selftest/output/html.pm +++ b/selftest/output/html.pm @@ -94,6 +94,8 @@ sub start_testsuite($$) { my ($self, $name) = @_; + $self->{START_TIME} = $self->{last_time}; + $self->{local_statistics} = { success => 0, skip => 0, @@ -200,26 +202,15 @@ sub report_time($$) sub start_test($$) { - my ($self, $parents, $testname) = @_; - - if ($#$parents == -1) { - $self->{START_TIME} = $self->{last_time}; - $self->start_testsuite($testname); - return; - } + my ($self, $testname) = @_; $self->{active_test} = $testname; $self->{msg} = ""; } -sub end_test($$$$$$) +sub end_test($$$$) { - my ($self, $parents, $testname, $result, $unexpected, $reason) = @_; - - if ($#$parents == -1) { - $self->end_testsuite($testname, $result, $unexpected, $reason); - return; - } + my ($self, $testname, $result, $unexpected, $reason) = @_; print TEST "<tr>"; diff --git a/selftest/output/plain.pm b/selftest/output/plain.pm index 9d92a3e071..2427136073 100644 --- a/selftest/output/plain.pm +++ b/selftest/output/plain.pm @@ -133,26 +133,13 @@ sub end_testsuite($$$$$) sub start_test($$$) { - my ($self, $parents, $testname) = @_; - - if ($#$parents == -1) { - $self->start_testsuite($testname); - } + my ($self, $testname) = @_; } sub end_test($$$$$) { - my ($self, $parents, $testname, $result, $unexpected, $reason) = @_; + my ($self, $testname, $result, $unexpected, $reason) = @_; - if ($#$parents == -1) { - if ($result eq "skip") { - $self->skip_testsuite($testname, $reason); - } else { - $self->end_testsuite($testname, $result, $unexpected, $reason); - } - return; - } - my $append = ""; unless ($unexpected) { @@ -167,9 +154,7 @@ sub end_test($$$$$) return; } - my $fullname = join(".", @$parents).".$testname"; - - $append = "UNEXPECTED($result): $testname ($fullname)\n"; + $append = "UNEXPECTED($result): $testname\n"; $self->{test_output}->{$self->{NAME}} .= $append; diff --git a/selftest/output/subunit.pm b/selftest/output/subunit.pm index 5bce99f68f..3f2d0cf8a6 100644 --- a/selftest/output/subunit.pm +++ b/selftest/output/subunit.pm @@ -69,16 +69,16 @@ sub end_testsuite($$$$$$) Subunit::end_test($name, $result, $reason); } -sub start_test($$$) +sub start_test($$) { - my ($self, $parents, $testname) = @_; + my ($self, $testname) = @_; Subunit::start_test($testname); } sub end_test($$$$$) { - my ($self, $parents, $testname, $result, $unexpected, $reason) = @_; + my ($self, $testname, $result, $unexpected, $reason) = @_; if ($result eq "fail" and not $unexpected) { $result = "xfail"; } diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 2387904b7a..150a365123 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -217,7 +217,6 @@ sub run_testsuite($$$$$) my $pcap_file = setup_pcap($name); Subunit::report_time(time()); - Subunit::prefix($name); Subunit::start_test($name); my $ret = system("$cmd | $RealBin/filter-subunit.pl --prefix \"$name.\" 2>&1"); |