summaryrefslogtreecommitdiff
path: root/source4/selftest/selftest.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-04-30 12:48:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:50 -0500
commitc0ac3d26abcb1c37707caa7ac8a167262aa9b9a9 (patch)
tree1b48d77f3e38e1bb5dd36e7c3e358088f89178a5 /source4/selftest/selftest.pl
parentb481b29a1a8279d70efa1e1b6e13520336336f53 (diff)
downloadsamba-c0ac3d26abcb1c37707caa7ac8a167262aa9b9a9.tar.gz
samba-c0ac3d26abcb1c37707caa7ac8a167262aa9b9a9.tar.bz2
samba-c0ac3d26abcb1c37707caa7ac8a167262aa9b9a9.zip
r22605: Set up all required environments before starting tests.
(This used to be commit adf835a32440b4a531ce27a78920df945eca1ba8)
Diffstat (limited to 'source4/selftest/selftest.pl')
-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);