summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-21 20:36:50 -0700
committerJelmer Vernooij <jelmer@samba.org>2010-09-21 22:54:35 -0700
commitbf907d2c4a7c9c4d95d2af644eb5f8dc97e073c3 (patch)
treebb6f70614e572b009ec65cd5799ed4cc7b8975dc /selftest
parent1783d0d6fcf20e568a1187b1e28cbf1d60c54d34 (diff)
downloadsamba-bf907d2c4a7c9c4d95d2af644eb5f8dc97e073c3.tar.gz
samba-bf907d2c4a7c9c4d95d2af644eb5f8dc97e073c3.tar.bz2
samba-bf907d2c4a7c9c4d95d2af644eb5f8dc97e073c3.zip
selftest: Support running individual tests using idlists, for testsuites that support them.
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 14ed26f551..37433de42d 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -633,8 +633,9 @@ sub read_testlist($)
open(IN, $filename) or die("Unable to open $filename: $!");
while (<IN>) {
- if (/-- TEST(-LOADLIST)? --\n/) {
+ if (/-- TEST(-LOADLIST|IDLIST)? --\n/) {
my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
+ my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
my $name = <IN>;
$name =~ s/\n//g;
my $env = <IN>;
@@ -642,7 +643,7 @@ sub read_testlist($)
my $cmdline = <IN>;
$cmdline =~ s/\n//g;
if (should_run_test($name) == 1) {
- push (@ret, [$name, $env, $cmdline, $supports_loadlist]);
+ push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]);
}
} else {
print;
@@ -946,12 +947,16 @@ $envvarstr
# Generate a file with the individual tests to run, if the
# test runner for this test suite supports it.
- if ($$_[3] and $individual_tests and $individual_tests->{$name}) {
- my ($fh, $listid_file) = tempfile(UNLINK => 0);
- foreach my $test (@{$individual_tests->{$name}}) {
- print $fh "$test\n";
+ if ($individual_tests and $individual_tests->{$name}) {
+ if ($$_[3]) {
+ my ($fh, $listid_file) = tempfile(UNLINK => 0);
+ foreach my $test (@{$individual_tests->{$name}}) {
+ print $fh "$test\n";
+ }
+ $cmd .= " --load-list=$listid_file";
+ } elsif ($$_[4]) {
+ $cmd .= join(' ', @{$individual_tests->{$name}});
}
- $cmd .= " --load-list=$listid_file";
}
run_testsuite($envname, $name, $cmd, $i, $suitestotal);