summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource4/selftest/selftest.pl13
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/selftest/selftest.pl b/source4/selftest/selftest.pl
index 104fc7d15f..b60613da64 100755
--- a/source4/selftest/selftest.pl
+++ b/source4/selftest/selftest.pl
@@ -134,6 +134,7 @@ my $ldap = undef;
my $opt_analyse_cmd = undef;
my $opt_resetup_env = undef;
my $opt_bindir = undef;
+my $opt_no_lazy_setup = undef;
my $srcdir = ".";
my $builddir = ".";
@@ -454,6 +455,7 @@ my $result = GetOptions (
'testenv' => \$opt_testenv,
'ldap:s' => \$ldap,
'analyse-cmd=s' => \$opt_analyse_cmd,
+ 'no-lazy-setup' => \$opt_no_lazy_setup,
'resetup-environment' => \$opt_resetup_env,
'bindir:s' => \$opt_bindir,
);
@@ -647,6 +649,7 @@ my @todo = ();
my $testsdir = "$srcdir/selftest";
$ENV{CONFIGURATION} = "--configfile=$conffile";
+my %required_envs = ();
if ($opt_quick) {
open(IN, "$testsdir/tests_quick.sh|");
@@ -661,8 +664,10 @@ while (<IN>) {
$env =~ s/\n//g;
my $cmdline = <IN>;
$cmdline =~ s/\n//g;
- push (@todo, [$name, $env, $cmdline])
- if (not defined($tests) or $name =~ /$tests/);
+ if (not defined($tests) or $name =~ /$tests/) {
+ $required_envs{$env} = 1;
+ push (@todo, [$name, $env, $cmdline]);
+ }
} else {
print;
}
@@ -777,6 +782,10 @@ if ($from_build_farm) {
$msg_ops = $plain_msg_ops;
}
+if ($opt_no_lazy_setup) {
+ setup_env($_) foreach (keys %required_envs);
+}
+
if ($opt_testenv) {
my $testenv_name = $ENV{SELFTEST_TESTENV};
$testenv_name = "dc" unless defined($testenv_name);