summaryrefslogtreecommitdiff
path: root/selftest/selftest.pl
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2019-02-18 15:34:51 +1300
committerAndrew Bartlett <abartlet@samba.org>2019-02-20 00:37:14 +0100
commitbcd007532820a077320fe21f246c5ba0195e87d5 (patch)
treebc1d8091c69063bb479983f1fb1b51fb9266d5e5 /selftest/selftest.pl
parentec51bfca4e77e57d81c0a7ed8e1fecb83d8aecfc (diff)
downloadsamba-bcd007532820a077320fe21f246c5ba0195e87d5.tar.gz
selftest: Abort if we fail to startup testenv with '--one' option
The --one selftest.pl option means abort when the first test fails. However, when 'make test' fails to startup a testenv, it'll try to continue and run other tests by default. When '--one' is used, selftest.pl can just die() at that point. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest/selftest.pl')
-rwxr-xr-xselftest/selftest.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 9aea62a3d2a..ec44b89dac7 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -944,7 +944,11 @@ sub setup_env($$)
$testenv_vars->{target} = $target;
}
if (not defined($testenv_vars)) {
- warn("$opt_target can't start up known environment '$envname'");
+ if ($opt_one) {
+ die("$opt_target can't start up known environment '$envname'");
+ } else {
+ warn("$opt_target can't start up known environment '$envname'");
+ }
}
}