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