summaryrefslogtreecommitdiff
path: root/source4/selftest/selftest.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-02 11:16:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:28 -0500
commit3e7fbae72cf2358a324fd5d796be52ac8e80c101 (patch)
tree3622c842c8cd9c933fe84db2c1fea69e97f5e990 /source4/selftest/selftest.pl
parentb53ecda303d7c156c913300578d6dffa277aaf16 (diff)
downloadsamba-3e7fbae72cf2358a324fd5d796be52ac8e80c101.tar.gz
samba-3e7fbae72cf2358a324fd5d796be52ac8e80c101.tar.bz2
samba-3e7fbae72cf2358a324fd5d796be52ac8e80c101.zip
r24887: Support reading testlists from other locations (e.g. Samba3)
(This used to be commit 88537c5affb91050b1cce244688d99624d0f6c7d)
Diffstat (limited to 'source4/selftest/selftest.pl')
-rwxr-xr-xsource4/selftest/selftest.pl55
1 files changed, 36 insertions, 19 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index 39755e692d..db5bd2cf27 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -138,6 +138,7 @@ my $opt_resetup_env = undef;
my $opt_bindir = undef;
my $opt_no_lazy_setup = undef;
my $opt_format = "plain";
+my @opt_testlists = ();
my $srcdir = ".";
my $builddir = ".";
@@ -270,6 +271,7 @@ Usage: $Script [OPTIONS] PREFIX
Generic options:
--help this help page
--target=samba4|samba3|win Samba version to target
+ --testlist=FILE file to read available tests from
Paths:
--prefix=DIR prefix to run tests in [st]
@@ -321,6 +323,7 @@ my $result = GetOptions (
'resetup-environment' => \$opt_resetup_env,
'bindir:s' => \$opt_bindir,
'format=s' => \$opt_format,
+ 'testlist=s' => \@opt_testlists
);
exit(1) if (not $result);
@@ -533,28 +536,42 @@ $ENV{CONFIGURATION} = "--configfile=$conffile";
my %required_envs = ();
-if ($opt_quick) {
- open(IN, "$testsdir/tests_quick.sh|");
-} else {
- open(IN, "$testsdir/tests_all.sh|");
-}
-while (<IN>) {
- if ($_ eq "-- TEST --\n") {
- my $name = <IN>;
- $name =~ s/\n//g;
- my $env = <IN>;
- $env =~ s/\n//g;
- my $cmdline = <IN>;
- $cmdline =~ s/\n//g;
- if (not defined($tests) or $name =~ /$tests/) {
- $required_envs{$env} = 1;
- push (@todo, [$name, $env, $cmdline]);
+sub read_testlist($)
+{
+ my ($filename) = @_;
+
+ my @ret = ();
+ open(IN, $filename) or die("Unable to open $filename: $!");
+
+ while (<IN>) {
+ if ($_ eq "-- TEST --\n") {
+ my $name = <IN>;
+ $name =~ s/\n//g;
+ my $env = <IN>;
+ $env =~ s/\n//g;
+ my $cmdline = <IN>;
+ $cmdline =~ s/\n//g;
+ if (not defined($tests) or $name =~ /$tests/) {
+ $required_envs{$env} = 1;
+ push (@ret, [$name, $env, $cmdline]);
+ }
+ } else {
+ print;
}
- } else {
- print;
}
+ close(IN) or die("Error creating recipe");
+ return @ret;
+}
+
+if ($opt_quick) {
+ @todo = read_testlist("$testsdir/tests_quick.sh|");
+} else {
+ @todo = read_testlist("$testsdir/tests_all.sh|");
+}
+
+foreach (@opt_testlists) {
+ push(@todo, read_testlist($_));
}
-close(IN) or die("Error creating recipe");
my $suitestotal = $#todo + 1;
my $i = 0;