From bf907d2c4a7c9c4d95d2af644eb5f8dc97e073c3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 21 Sep 2010 20:36:50 -0700 Subject: selftest: Support running individual tests using idlists, for testsuites that support them. --- selftest/selftest.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'selftest') 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 () { - 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 = ; $name =~ s/\n//g; my $env = ; @@ -642,7 +643,7 @@ sub read_testlist($) my $cmdline = ; $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); -- cgit