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
275e7ac4
Commit
275e7ac4
authored
Mar 09, 2006
by
kent@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
0903941d
e32054e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
11 deletions
+92
-11
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+15
-2
mysql-test/lib/mtr_misc.pl
mysql-test/lib/mtr_misc.pl
+42
-0
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+35
-9
No files found.
mysql-test/lib/mtr_cases.pl
View file @
275e7ac4
...
...
@@ -155,11 +155,24 @@ sub collect_test_cases ($) {
if
(
$::opt_reorder
)
{
@$cases
=
sort
{
if
(
$a
->
{'
master_restart
'}
and
$b
->
{'
master_restart
'}
or
!
$a
->
{'
master_restart
'}
and
!
$b
->
{'
master_restart
'}
)
if
(
!
$a
->
{'
master_restart
'}
and
!
$b
->
{'
master_restart
'}
)
{
return
$a
->
{'
name
'}
cmp
$b
->
{'
name
'};
}
if
(
$a
->
{'
master_restart
'}
and
$b
->
{'
master_restart
'}
)
{
my
$cmp
=
mtr_cmp_opts
(
$a
->
{'
master_opt
'},
$b
->
{'
master_opt
'});
if
(
$cmp
==
0
)
{
return
$a
->
{'
name
'}
cmp
$b
->
{'
name
'};
}
else
{
return
$cmp
;
}
}
if
(
$a
->
{'
master_restart
'}
)
{
return
1
;
# Is greater
...
...
mysql-test/lib/mtr_misc.pl
View file @
275e7ac4
...
...
@@ -13,6 +13,9 @@ sub mtr_add_arg ($$@);
sub
mtr_path_exists
(@);
sub
mtr_script_exists
(@);
sub
mtr_exe_exists
(@);
sub
mtr_copy_dir
($$);
sub
mtr_same_opts
($$);
sub
mtr_cmp_opts
($$);
##############################################################################
#
...
...
@@ -108,5 +111,44 @@ sub mtr_exe_exists (@) {
}
}
sub
mtr_copy_dir
($$)
{
my
$srcdir
=
shift
;
my
$dstdir
=
shift
;
# Create destination directory
mkpath
(
$dstdir
);
find
(
\&
mtr_copy_one_file
,
$dstdir
);
}
sub
mtr_copy_one_file
{
print
$
File::Find::
name
,
"
\n
";
}
sub
mtr_same_opts
($$)
{
my
$l1
=
shift
;
my
$l2
=
shift
;
return
mtr_cmp_opts
(
$l1
,
$l2
)
==
0
;
}
sub
mtr_cmp_opts
($$)
{
my
$l1
=
shift
;
my
$l2
=
shift
;
my
@l1
=
@$l1
;
my
@l2
=
@$l2
;
return
-
1
if
@l1
<
@l2
;
return
1
if
@l1
>
@l2
;
while
(
@l1
)
# Same length
{
my
$e1
=
shift
@l1
;
my
$e2
=
shift
@l2
;
my
$cmp
=
(
$e1
cmp
$e2
);
return
$cmp
if
$cmp
!=
0
;
}
return
0
;
# They are the same
}
1
;
mysql-test/mysql-test-run.pl
View file @
275e7ac4
...
...
@@ -464,9 +464,9 @@ sub initial_setup () {
if
(
$glob_cygwin_perl
)
{
# Windows programs like 'mysqld' needs Windows paths
$glob_mysql_test_dir
=
`
cygpath -m
$glob_mysql_test_dir
`;
$glob_mysql_test_dir
=
`
cygpath -m
"
$glob_mysql_test_dir
"
`;
my
$shell
=
$ENV
{'
SHELL
'}
||
"
/bin/bash
";
$glob_cygwin_shell
=
`
cygpath -w
$shell
`;
# The Windows path c:\...
$glob_cygwin_shell
=
`
cygpath -w
"
$shell
"
`;
# The Windows path c:\...
chomp
(
$glob_mysql_test_dir
);
chomp
(
$glob_cygwin_shell
);
}
...
...
@@ -973,7 +973,8 @@ sub executable_setup () {
$exe_mysqld
=
mtr_exe_exists
("
$path_client_bindir
/mysqld-max
",
"
$path_client_bindir
/mysqld-nt
",
"
$path_client_bindir
/mysqld
",
"
$path_client_bindir
/mysqld-debug
",);
"
$path_client_bindir
/mysqld-debug
",
"
$path_client_bindir
/mysqld-max
");
$path_language
=
mtr_path_exists
("
$glob_basedir
/share/english/
");
$path_charsetsdir
=
mtr_path_exists
("
$glob_basedir
/share/charsets
");
$exe_my_print_defaults
=
...
...
@@ -1837,13 +1838,37 @@ sub run_testcase ($) {
if
(
!
$glob_use_running_server
and
!
$glob_use_embedded_server
)
{
if
(
$tinfo
->
{'
master_restart
'}
or
$master
->
[
0
]
->
{'
running_master_is_special
'}
or
# Stop if cluster is started but test cases does not need cluster
(
$opt_with_ndbcluster
&&
$tinfo
->
{'
ndb_test
'}
!=
$using_ndbcluster_master
)
)
# We try to find out if we are to restart the server
my
$do_restart
=
0
;
# Assumes we don't have to
if
(
$tinfo
->
{'
master_sh
'}
)
{
$do_restart
=
1
;
# Always restart if script to run
}
elsif
(
$opt_with_ndbcluster
and
$tinfo
->
{'
ndb_test
'}
!=
$using_ndbcluster_master
)
{
$do_restart
=
1
;
# Restart without cluster
}
elsif
(
$master
->
[
0
]
->
{'
running_master_is_special
'}
and
$master
->
[
0
]
->
{'
running_master_is_special
'}
->
{'
timezone
'}
eq
$tinfo
->
{'
timezone
'}
and
mtr_same_opts
(
$master
->
[
0
]
->
{'
running_master_is_special
'}
->
{'
master_opt
'},
$tinfo
->
{'
master_opt
'})
)
{
# If running master was started with special settings, but
# the current test requuires the same ones, we *don't* restart.
$do_restart
=
0
;
}
elsif
(
$tinfo
->
{'
master_restart
'}
or
$master
->
[
0
]
->
{'
running_master_is_special
'}
)
{
$do_restart
=
1
;
}
if
(
$do_restart
)
{
stop_masters
();
$master
->
[
0
]
->
{'
running_master_is_special
'}
=
0
;
# Forget why we stopped
delete
$master
->
[
0
]
->
{'
running_master_is_special
'};
# Forget history
}
# ----------------------------------------------------------------------
...
...
@@ -1930,7 +1955,8 @@ sub run_testcase ($) {
if
(
$tinfo
->
{'
master_restart
'}
)
{
$master
->
[
0
]
->
{'
running_master_is_special
'}
=
1
;
# Save this test case information, so next can examine it
$master
->
[
0
]
->
{'
running_master_is_special
'}
=
$tinfo
;
}
}
elsif
(
!
$opt_skip_im
and
$tinfo
->
{'
component_id
'}
eq
'
im
'
)
...
...
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