Skip to content

Commit ce78baf

Browse files
committed
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.
1 parent 36c0bec commit ce78baf

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

mysql-test/mysql-test-run.pl

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,14 +3758,32 @@ ($$)
37583758
$ENV{'MTR_TEST_NAME'} = $tinfo->{name};
37593759
resfile_report_test($tinfo) if $opt_resfile;
37603760

3761-
# Allow only alpanumerics pluss _ - + . in combination names,
3762-
# or anything beginning with -- (the latter comes from --combination)
3763-
my $combination= $tinfo->{combination};
3764-
if ($combination && $combination !~ /^\w[-\w\.\+]*$/
3765-
&& $combination !~ /^--/)
3761+
for my $key (grep { /^MTR_COMBINATION/ } keys %ENV)
37663762
{
3767-
mtr_error("Combination '$combination' contains illegal characters");
3763+
delete $ENV{$key};
37683764
}
3765+
3766+
if (ref $tinfo->{combinations} eq 'ARRAY')
3767+
{
3768+
for (my $i = 0; $i < @{$tinfo->{combinations}}; ++$i )
3769+
{
3770+
my $combination = $tinfo->{combinations}->[$i];
3771+
# Allow only alphanumerics plus _ - + . in combination names,
3772+
# or anything beginning with -- (the latter comes from --combination)
3773+
if ($combination && $combination !~ /^\w[-\w\.\+]*$/
3774+
&& $combination !~ /^--/)
3775+
{
3776+
mtr_error("Combination '$combination' contains illegal characters");
3777+
}
3778+
$ENV{"MTR_COMBINATION_". uc(${combination})} = 1;
3779+
}
3780+
$ENV{"MTR_COMBINATIONS"} = join(',', @{$tinfo->{combinations}});
3781+
}
3782+
elsif (exists $tinfo->{combinations})
3783+
{
3784+
die 'Unexpected type of $tinfo->{combinations}';
3785+
}
3786+
37693787
# -------------------------------------------------------
37703788
# Init variables that can change between each test case
37713789
# -------------------------------------------------------

0 commit comments

Comments
 (0)