summaryrefslogtreecommitdiff
path: root/selftest/selftest.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-22 11:30:34 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-22 17:48:23 -0700
commit31d5ac05402ed9ac8158d143283c7f8b2d7bb7b4 (patch)
tree072359171a72ba718c0298232e83e45157b25809 /selftest/selftest.pl
parent54f0da368f35ce7d7fd4b093b865ffea284d826b (diff)
downloadsamba-31d5ac05402ed9ac8158d143283c7f8b2d7bb7b4.tar.gz
samba-31d5ac05402ed9ac8158d143283c7f8b2d7bb7b4.tar.bz2
samba-31d5ac05402ed9ac8158d143283c7f8b2d7bb7b4.zip
selftest: Let tests add prefix to tests by themselve.
Diffstat (limited to 'selftest/selftest.pl')
-rwxr-xr-xselftest/selftest.pl35
1 files changed, 12 insertions, 23 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index a21ecbabe4..3bad138f5c 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -238,28 +238,22 @@ sub run_testsuite($$$$$)
Subunit::start_testsuite($name);
Subunit::progress_push();
Subunit::report_time(time());
+ system($cmd);
+ Subunit::report_time(time());
+ Subunit::progress_pop();
- open(RESULTS, "$cmd 2>&1|");
-
- Subunit::filter_add_prefix("$name\.", *RESULTS);
-
- my $ret = 0;
-
- unless (close(RESULTS)) {
- if ($!) {
- Subunit::progress_pop();
- Subunit::end_testsuite($name, "error", "Unable to run $cmd: $!");
- return 0;
- } else {
- $ret = $?;
- }
- }
-
- if ($ret & 127) {
+ if ($? == -1) {
Subunit::progress_pop();
- Subunit::end_testsuite($name, "error", sprintf("Testsuite died with signal %d, %s coredump", ($ret & 127), ($ret & 128) ? "with": "without"));
+ Subunit::end_testsuite($name, "error", "Unable to run $cmd: $!");
+ return 0;
+ } elsif ($? & 127) {
+ Subunit::end_testsuite($name, "error",
+ sprintf("%s died with signal %d, %s coredump\n", $cmd, ($? & 127), ($? & 128) ? 'with' : 'without'));
return 0;
}
+
+ my $exitcode = $? >> 8;
+
my $envlog = getlog_env($envname);
if ($envlog ne "") {
print "envlog: $envlog\n";
@@ -268,10 +262,6 @@ sub run_testsuite($$$$$)
print "command: $cmd\n";
printf "expanded command: %s\n", expand_environment_strings($cmd);
- my $exitcode = $ret >> 8;
-
- Subunit::report_time(time());
- Subunit::progress_pop();
if ($exitcode == 0) {
Subunit::end_testsuite($name, "success");
} else {
@@ -933,7 +923,6 @@ $envvarstr
foreach (@todo) {
$i++;
my $cmd = $$_[2];
- $cmd =~ s/([\(\)])/\\$1/g;
my $name = $$_[0];
my $envname = $$_[1];