summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-08-14 13:04:21 +1000
committerAndrew Tridgell <tridge@samba.org>2009-08-14 13:05:06 +1000
commit2d7b457e26985c444588546cc2d250c4cd2e2e32 (patch)
tree640e9464b03a50ef2d0e98a37cd24373302b450f /selftest
parent7a82aed71b74af8bc2a8a4381541adbb22452d20 (diff)
downloadsamba-2d7b457e26985c444588546cc2d250c4cd2e2e32.tar.gz
samba-2d7b457e26985c444588546cc2d250c4cd2e2e32.tar.bz2
samba-2d7b457e26985c444588546cc2d250c4cd2e2e32.zip
fixed TESTS= in make test to allow multiple tests
Now you can do: make test TESTS="test1 test2" and it will run those two tests, each matching tests using a case insensitive substring match
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl18
1 files changed, 16 insertions, 2 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 75afbdd9a9..1cae9eaa7d 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -348,7 +348,7 @@ exit(1) if (not $result);
ShowHelp() if ($opt_help);
-my $tests = shift;
+my @tests = @ARGV;
# quick hack to disable rpc validation when using valgrind - its way too slow
unless (defined($ENV{VALGRIND})) {
@@ -591,6 +591,20 @@ my $testsdir = "$srcdir/selftest";
my %required_envs = ();
+sub should_run_test($)
+{
+ my $name = shift;
+ if ($#tests == -1) {
+ return 1;
+ }
+ for (my $i=0; $i <= $#tests; $i++) {
+ if ($name =~ /$tests[$i]/i) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
sub read_testlist($)
{
my ($filename) = @_;
@@ -606,7 +620,7 @@ sub read_testlist($)
$env =~ s/\n//g;
my $cmdline = <IN>;
$cmdline =~ s/\n//g;
- if (not defined($tests) or $name =~ /$tests/) {
+ if (should_run_test($name) == 1) {
$required_envs{$env} = 1;
push (@ret, [$name, $env, $cmdline]);
}