mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
selftest: change technique for running specific envs
Currently testsuites excluded with --exclude/--include-env are skipped when encountered in the middle of a run, so they are included in progress reporting, and the @todo list does not accurately show what will be done. This change skips them earlier, preventing them from being added to @todo, as is done with pattern-based including/excluding. As well as making the progress indicator more accurate, this means that selftest.pl can use @todo to determine when we are finished with an environment. Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Feb 21 07:47:58 CET 2018 on sn-devel-144
This commit is contained in:
parent
962e8a0ea7
commit
0b63f26bf7
@ -92,6 +92,12 @@ sub skip
|
||||
return "environment $envname is disabled as this build does not include an AD DC";
|
||||
}
|
||||
|
||||
if (@opt_include_env && !(grep {$_ eq $env_basename} @opt_include_env)) {
|
||||
return "environment $envname is disabled (via --include-env command line option) in this test run - skipping";
|
||||
} elsif (@opt_exclude_env && grep {$_ eq $env_basename} @opt_exclude_env) {
|
||||
return "environment $envname is disabled (via --exclude-env command line option) in this test run - skipping";
|
||||
}
|
||||
|
||||
return find_in_list(\@excludes, $name);
|
||||
}
|
||||
|
||||
@ -1102,39 +1108,13 @@ $envvarstr
|
||||
my $cmd = $$_[2];
|
||||
my $name = $$_[0];
|
||||
my $envname = $$_[1];
|
||||
my ($env_basename, $env_localpart) = split(/:/, $envname);
|
||||
my $envvars = "SKIP";
|
||||
my $envvars = setup_env($envname, $prefix);
|
||||
|
||||
if (@opt_include_env) {
|
||||
foreach my $env (@opt_include_env) {
|
||||
if ($env_basename eq $env) {
|
||||
$envvars = setup_env($envname, $prefix);
|
||||
}
|
||||
}
|
||||
} elsif (@opt_exclude_env) {
|
||||
my $excluded = 0;
|
||||
foreach my $env (@opt_exclude_env) {
|
||||
if ($env_basename eq $env) {
|
||||
$excluded = 1;
|
||||
}
|
||||
}
|
||||
if ($excluded == 0) {
|
||||
$envvars = setup_env($envname, $prefix);
|
||||
}
|
||||
} else {
|
||||
$envvars = setup_env($envname, $prefix);
|
||||
}
|
||||
|
||||
if (not defined($envvars)) {
|
||||
Subunit::start_testsuite($name);
|
||||
Subunit::end_testsuite($name, "error",
|
||||
"unable to set up environment $envname - exiting");
|
||||
next;
|
||||
} elsif ($envvars eq "SKIP") {
|
||||
Subunit::start_testsuite($name);
|
||||
Subunit::end_testsuite($name, "skip",
|
||||
"environment $envname is disabled (via --exclude-env / --include-env command line options) in this test run - skipping");
|
||||
next;
|
||||
} elsif ($envvars eq "UNKNOWN") {
|
||||
Subunit::start_testsuite($name);
|
||||
Subunit::end_testsuite($name, "skip",
|
||||
|
Loading…
Reference in New Issue
Block a user