Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
6c67d11f
Commit
6c67d11f
authored
Nov 03, 2007
by
skozlov/ksm@mysql.com/virtop.localdomain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#3949. Added an option for support "combinations" of mysqld arguments for a suite
parent
8f8fa8c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
0 deletions
+104
-0
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+99
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+5
-0
No files found.
mysql-test/lib/mtr_cases.pl
View file @
6c67d11f
...
...
@@ -214,17 +214,44 @@ sub collect_one_suite($$)
mtr_verbose
("
Collecting:
$suite
");
my
$combination_file
=
"
combinations
";
my
$combinations
=
[]
;
my
$suitedir
=
"
$::glob_mysql_test_dir
";
# Default
my
$combination_file
=
"
$::glob_mysql_test_dir/
$combination_file
";
if
(
$suite
ne
"
main
"
)
{
$suitedir
=
mtr_path_exists
("
$suitedir
/suite/
$suite
",
"
$suitedir
/
$suite
");
mtr_verbose
("
suitedir:
$suitedir
");
$combination_file
=
"
$suitedir
/
$combination_file
";
}
my
$testdir
=
"
$suitedir
/t
";
my
$resdir
=
"
$suitedir
/r
";
if
(
!
@::opt_combination
)
{
# Read combinations file
if
(
open
(
COMB
,
$combination_file
)
)
{
while
(
<
COMB
>
)
{
chomp
;
s/\ +/ /g
;
push
(
@$combinations
,
$_
)
unless
(
$_
eq
'');
}
close
COMB
;
}
}
else
{
# take the combination from command-line
@$combinations
=
@::opt_combination
;
}
# Remember last element position
my
$begin_index
=
$#
{
@$cases
}
+
1
;
# ----------------------------------------------------------------------
# Build a hash of disabled testcases for this suite
# ----------------------------------------------------------------------
...
...
@@ -335,6 +362,78 @@ sub collect_one_suite($$)
closedir
TESTDIR
;
}
# ----------------------------------------------------------------------
# Proccess combinations only if new tests were added
# ----------------------------------------------------------------------
if
(
$combinations
&&
$begin_index
<=
$#
{
@$cases
})
{
my
$end_index
=
$#
{
@$cases
};
my
$is_copy
;
# Keep original master/slave options
my
@orig_opts
;
for
(
my
$idx
=
$begin_index
;
$idx
<=
$end_index
;
$idx
++
)
{
foreach
my
$param
(('
master_opt
','
slave_opt
','
slave_mi
'))
{
@
{
$orig_opts
[
$idx
]{
$param
}}
=
@
{
$cases
->
[
$idx
]
->
{
$param
}};
}
}
my
$comb_index
=
1
;
# Copy original test cases
foreach
my
$comb_set
(
@$combinations
)
{
for
(
my
$idx
=
$begin_index
;
$idx
<=
$end_index
;
$idx
++
)
{
my
$test
=
$cases
->
[
$idx
];
my
$copied_test
=
{};
foreach
my
$param
(
keys
%
{
$test
})
{
# Scalar. Copy as is.
$copied_test
->
{
$param
}
=
$test
->
{
$param
};
# Array. Copy reference instead itself
if
(
$param
=~
/(master_opt|slave_opt|slave_mi)/
)
{
my
$new_arr
=
[]
;
@$new_arr
=
@
{
$orig_opts
[
$idx
]{
$param
}};
$copied_test
->
{
$param
}
=
$new_arr
;
}
elsif
(
$param
=~
/(comment|combinations)/
)
{
$copied_test
->
{
$param
}
=
'';
}
}
if
(
$is_copy
)
{
push
(
@$cases
,
$copied_test
);
$test
=
$cases
->
[
$#
{
@$cases
}];
}
foreach
my
$comb_opt
(
split
(
/ /
,
$comb_set
))
{
push
(
@
{
$test
->
{'
master_opt
'}},
$comb_opt
);
push
(
@
{
$test
->
{'
slave_opt
'}},
$comb_opt
);
# Enable rpl if added option is --binlog-format and test case supports that
if
(
$comb_opt
=~
/^--binlog-format=.+$/
)
{
my
@opt_pairs
=
split
(
/=/
,
$comb_opt
);
if
(
$test
->
{'
binlog_format
'}
=~
/^$opt_pairs[1]$/
||
$test
->
{'
binlog_format
'}
eq
'')
{
$test
->
{'
skip
'}
=
0
;
$test
->
{'
comment
'}
=
'';
}
else
{
$test
->
{'
skip
'}
=
1
;
$test
->
{'
comment
'}
=
"
Requiring binlog format '
$test
->{'binlog_format'}'
";;
}
}
}
$test
->
{'
combination
'}
=
$comb_set
;
}
$is_copy
=
1
;
$comb_index
++
;
}
}
return
$cases
;
}
...
...
mysql-test/mysql-test-run.pl
View file @
6c67d11f
...
...
@@ -164,6 +164,8 @@ our $opt_bench= 0;
our
$opt_small_bench
=
0
;
our
$opt_big_test
=
0
;
our
@opt_combination
;
our
@opt_extra_mysqld_opt
;
our
$opt_compress
;
...
...
@@ -529,6 +531,7 @@ sub command_line_setup () {
'
skip-im
'
=>
\
$opt_skip_im
,
'
skip-test=s
'
=>
\
$opt_skip_test
,
'
big-test
'
=>
\
$opt_big_test
,
'
combination=s
'
=>
\
@opt_combination
,
# Specify ports
'
master_port=i
'
=>
\
$opt_master_myport
,
...
...
@@ -5134,6 +5137,8 @@ Options to control what test suites or cases to run
skip-im Don't start IM, and skip the IM test cases
big-test Set the environment variable BIG_TEST, which can be
checked from test cases.
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
combination.
Options that specify ports
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment