Commit 39b1dbc4 authored by Sergei Golubchik's avatar Sergei Golubchik

make %suites hash local to mtr_cases.pm

parent 6d48dfae
......@@ -66,6 +66,7 @@ require "mtr_misc.pl";
my $do_test_reg;
my $skip_test_reg;
my %suites;
my $default_suite_object = do 'My/Suite.pm';
sub init_pattern {
......@@ -317,11 +318,11 @@ sub collect_one_suite
#
# Load the Suite object
#
unless ($::suites{$suite}) {
unless ($suites{$suite}) {
if (-f "$suitedir/suite.pm") {
$::suites{$suite} = do "$suitedir/suite.pm";
$suites{$suite} = do "$suitedir/suite.pm";
} else {
$::suites{$suite} = $default_suite_object;
$suites{$suite} = $default_suite_object;
}
}
......@@ -377,7 +378,7 @@ sub collect_one_suite
my @case_names;
{
my $s= $::suites{$suite};
my $s= $suites{$suite};
$s = 'My::Suite' unless ref $s;
@case_names= $s->list_cases($testdir);
}
......@@ -712,7 +713,7 @@ sub collect_one_test_case {
name => "$suitename.$tname",
shortname => $tname,
path => "$testdir/$filename",
suite => $suitename,
suite => $suites{$suitename},
);
my $result_file= "$resdir/$tname.result";
......@@ -947,10 +948,10 @@ sub collect_one_test_case {
$tinfo->{template_path}= $config;
}
if (not ref $::suites{$tinfo->{suite}})
if (not ref $suites{$suitename})
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= $::suites{$tinfo->{suite}};
$tinfo->{'comment'}= $suites{$suitename};
return $tinfo;
}
......
......@@ -342,8 +342,6 @@ our $debug_compiled_binaries;
our %mysqld_variables;
our %suites;
my $source_dist= 0;
my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5);
......@@ -4074,7 +4072,7 @@ sub config_files($) {
my ($tinfo) = @_;
(
'my.cnf' => \&mycnf_create,
$suites{$tinfo->{suite}}->config_files()
$tinfo->{suite}->config_files()
);
}
......@@ -4105,7 +4103,7 @@ sub fix_servers($) {
SORT => 220,
START => undef,
},
$suites{$tinfo->{suite}}->servers()
$tinfo->{suite}->servers()
);
for ($config->groups()) {
while (my ($re,$prop) = each %servers) {
......@@ -4324,7 +4322,7 @@ sub run_testcase ($$) {
return 1;
}
my $test= $suites{$tinfo->{suite}}->start_test($tinfo);
my $test= $tinfo->{suite}->start_test($tinfo);
# Set only when we have to keep waiting after expectedly died server
my $keep_waiting_proc = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment