mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MTR: MTR_COMBINATIONS envvar for tests
MTR_COMBINATIONS contains comma-separated list of currently applied combinations "x,y,...". MTR_COMBINATION_X, MTR_COMBINATION_Y, ... are set to 1 for this list of combinations. Fixed dead check: non-existent element $tinfo->{combination}. Better use this clause: use warnings FATAL => 'uninitialized'; But this must be very well tested.
This commit is contained in:
parent
36c0bec2c7
commit
ce78bafe7a
1 changed files with 24 additions and 6 deletions
|
@ -3758,14 +3758,32 @@ sub run_testcase ($$) {
|
||||||
$ENV{'MTR_TEST_NAME'} = $tinfo->{name};
|
$ENV{'MTR_TEST_NAME'} = $tinfo->{name};
|
||||||
resfile_report_test($tinfo) if $opt_resfile;
|
resfile_report_test($tinfo) if $opt_resfile;
|
||||||
|
|
||||||
# Allow only alpanumerics pluss _ - + . in combination names,
|
for my $key (grep { /^MTR_COMBINATION/ } keys %ENV)
|
||||||
# or anything beginning with -- (the latter comes from --combination)
|
|
||||||
my $combination= $tinfo->{combination};
|
|
||||||
if ($combination && $combination !~ /^\w[-\w\.\+]*$/
|
|
||||||
&& $combination !~ /^--/)
|
|
||||||
{
|
{
|
||||||
mtr_error("Combination '$combination' contains illegal characters");
|
delete $ENV{$key};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ref $tinfo->{combinations} eq 'ARRAY')
|
||||||
|
{
|
||||||
|
for (my $i = 0; $i < @{$tinfo->{combinations}}; ++$i )
|
||||||
|
{
|
||||||
|
my $combination = $tinfo->{combinations}->[$i];
|
||||||
|
# Allow only alphanumerics plus _ - + . in combination names,
|
||||||
|
# or anything beginning with -- (the latter comes from --combination)
|
||||||
|
if ($combination && $combination !~ /^\w[-\w\.\+]*$/
|
||||||
|
&& $combination !~ /^--/)
|
||||||
|
{
|
||||||
|
mtr_error("Combination '$combination' contains illegal characters");
|
||||||
|
}
|
||||||
|
$ENV{"MTR_COMBINATION_". uc(${combination})} = 1;
|
||||||
|
}
|
||||||
|
$ENV{"MTR_COMBINATIONS"} = join(',', @{$tinfo->{combinations}});
|
||||||
|
}
|
||||||
|
elsif (exists $tinfo->{combinations})
|
||||||
|
{
|
||||||
|
die 'Unexpected type of $tinfo->{combinations}';
|
||||||
|
}
|
||||||
|
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
# Init variables that can change between each test case
|
# Init variables that can change between each test case
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue