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
01412f2b
Commit
01412f2b
authored
Aug 23, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Break out functions do_before_run_mysqltest and do_after_run_mysqltest
parent
89bf4bb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
46 deletions
+48
-46
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+48
-46
No files found.
mysql-test/mysql-test-run.pl
View file @
01412f2b
...
@@ -2157,7 +2157,10 @@ sub run_suite () {
...
@@ -2157,7 +2157,10 @@ sub run_suite () {
foreach
my
$tinfo
(
@$tests
)
foreach
my
$tinfo
(
@$tests
)
{
{
next
if
run_testcase_check_skip_test
(
$tinfo
);
if
(
run_testcase_check_skip_test
(
$tinfo
))
{
next
;
}
mtr_timer_start
(
$glob_timers
,"
testcase
",
60
*
$opt_testcase_timeout
);
mtr_timer_start
(
$glob_timers
,"
testcase
",
60
*
$opt_testcase_timeout
);
run_testcase
(
$tinfo
);
run_testcase
(
$tinfo
);
...
@@ -2482,6 +2485,47 @@ sub run_testcase_check_skip_test($)
...
@@ -2482,6 +2485,47 @@ sub run_testcase_check_skip_test($)
}
}
sub
do_before_run_mysqltest
($)
{
my
$tinfo
=
shift
;
my
$tname
=
$tinfo
->
{'
name
'};
# Remove old reject file
if
(
$opt_suite
eq
"
main
"
)
{
unlink
("
r/
$tname
.reject
");
}
else
{
unlink
("
suite/
$opt_suite
/r/
$tname
.reject
");
}
# MASV cleanup...
mtr_tonewfile
(
$path_current_test_log
,"
$tname
\n
");
# Always tell where we are
# output current test to ndbcluster log file to enable diagnostics
mtr_tofile
(
$file_ndb_testrun_log
,"
CURRENT TEST
$tname
\n
");
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
if
(
$master
->
[
1
]
->
{'
pid
'}
)
{
mtr_tofile
(
$master
->
[
1
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
}
}
sub
do_after_run_mysqltest
($)
{
my
$tinfo
=
shift
;
my
$tname
=
$tinfo
->
{'
name
'};
#MASV cleanup
# Save info from this testcase run to mysqltest.log
my
$testcase_log
=
mtr_fromfile
(
$path_timefile
)
if
-
f
$path_timefile
;
mtr_tofile
(
$path_mysqltest_log
,"
CURRENT TEST
$tname
\n
");
mtr_tofile
(
$path_mysqltest_log
,
$testcase_log
);
}
##############################################################################
##############################################################################
#
#
...
@@ -2502,13 +2546,6 @@ sub run_testcase_check_skip_test($)
...
@@ -2502,13 +2546,6 @@ sub run_testcase_check_skip_test($)
sub
run_testcase
($)
{
sub
run_testcase
($)
{
my
$tinfo
=
shift
;
my
$tinfo
=
shift
;
my
$tname
=
$tinfo
->
{'
name
'};
mtr_tonewfile
(
$path_current_test_log
,"
$tname
\n
");
# Always tell where we are
# output current test to ndbcluster log file to enable diagnostics
mtr_tofile
(
$file_ndb_testrun_log
,"
CURRENT TEST
$tname
\n
");
my
$master_restart
=
run_testcase_need_master_restart
(
$tinfo
);
my
$master_restart
=
run_testcase_need_master_restart
(
$tinfo
);
my
$slave_restart
=
run_testcase_need_slave_restart
(
$tinfo
);
my
$slave_restart
=
run_testcase_need_slave_restart
(
$tinfo
);
...
@@ -2517,26 +2554,7 @@ sub run_testcase ($) {
...
@@ -2517,26 +2554,7 @@ sub run_testcase ($) {
run_testcase_stop_servers
(
$tinfo
,
$master_restart
,
$slave_restart
);
run_testcase_stop_servers
(
$tinfo
,
$master_restart
,
$slave_restart
);
}
}
# ----------------------------------------------------------------------
# Prepare to start masters. Even if we use embedded, we want to run
# the preparation.
# ----------------------------------------------------------------------
mtr_tofile
(
$master
->
[
0
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
if
(
$master
->
[
1
]
->
{'
pid
'}
)
{
mtr_tofile
(
$master
->
[
1
]
->
{'
path_myerr
'},"
CURRENT_TEST:
$tname
\n
");
}
# ----------------------------------------------------------------------
# If any mysqld servers running died, we have to know
# ----------------------------------------------------------------------
my
$died
=
mtr_record_dead_children
();
my
$died
=
mtr_record_dead_children
();
# ----------------------------------------------------------------------
# Start masters needed by the testcase
# ----------------------------------------------------------------------
if
(
$died
or
$master_restart
or
$slave_restart
)
if
(
$died
or
$master_restart
or
$slave_restart
)
{
{
run_testcase_start_servers
(
$tinfo
);
run_testcase_start_servers
(
$tinfo
);
...
@@ -2546,28 +2564,14 @@ sub run_testcase ($) {
...
@@ -2546,28 +2564,14 @@ sub run_testcase ($) {
# If --start-and-exit or --start-dirty given, stop here to let user manually
# If --start-and-exit or --start-dirty given, stop here to let user manually
# run tests
# run tests
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
if
(
$opt_start_and_exit
or
$opt_start_dirty
)
if
(
$opt_start_and_exit
or
$opt_start_dirty
)
{
{
mtr_report
("
\n
Servers started, exiting
");
mtr_report
("
\n
Servers started, exiting
");
exit
(
0
);
exit
(
0
);
}
}
# ----------------------------------------------------------------------
# Run the test case
# ----------------------------------------------------------------------
{
# remove the old reject file
if
(
$opt_suite
eq
"
main
"
)
{
{
unlink
("
r/
$tname
.reject
");
do_before_run_mysqltest
(
$tinfo
);
}
else
{
unlink
("
suite/
$opt_suite
/r/
$tname
.reject
");
}
unlink
(
$path_timefile
);
my
$res
=
run_mysqltest
(
$tinfo
);
my
$res
=
run_mysqltest
(
$tinfo
);
mtr_report_test_name
(
$tinfo
);
mtr_report_test_name
(
$tinfo
);
...
@@ -2603,10 +2607,8 @@ sub run_testcase ($) {
...
@@ -2603,10 +2607,8 @@ sub run_testcase ($) {
report_failure_and_restart
(
$tinfo
);
report_failure_and_restart
(
$tinfo
);
}
}
# Save info from this testcase run to mysqltest.log
my
$testcase_log
=
mtr_fromfile
(
$path_timefile
)
if
-
f
$path_timefile
;
do_after_run_mysqltest
(
$tinfo
);
mtr_tofile
(
$path_mysqltest_log
,"
CURRENT TEST
$tname
\n
");
mtr_tofile
(
$path_mysqltest_log
,
$testcase_log
);
}
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
...
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