mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge neptunus.(none):/home/msvensson/mysql/mysqltestrun_check_testcases/my51-mysqltestrun_check_testcases
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/rpl_loaddata_m.result: Auto merged mysql-test/r/sp-security.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/r/view_grant.result: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/read_only.test: Auto merged mysql-test/t/sp-security.test: Auto merged mysql-test/t/trigger-compat.test: Auto merged mysql-test/t/view_grant.test: Auto merged mysql-test/r/trigger-compat.result: Merge 5.0 -> 5.1
This commit is contained in:
@ -246,6 +246,7 @@ our $opt_manager_port; # Does nothing now, we never use manager
|
||||
our $opt_old_master;
|
||||
|
||||
our $opt_record;
|
||||
our $opt_check_testcases;
|
||||
|
||||
our $opt_result_ext;
|
||||
|
||||
@ -571,6 +572,7 @@ sub command_line_setup () {
|
||||
|
||||
# Test case authoring
|
||||
'record' => \$opt_record,
|
||||
'check-testcases' => \$opt_check_testcases,
|
||||
|
||||
# ???
|
||||
'mysqld=s' => \@opt_extra_mysqld_opt,
|
||||
@ -2730,6 +2732,54 @@ sub im_stop($) {
|
||||
$instance_manager->{'pid'} = undef;
|
||||
}
|
||||
|
||||
#
|
||||
# Run include/check-testcase.test
|
||||
# Before a testcase, run in record mode, save result file to var
|
||||
# After testcase, run and compare with the recorded file, they should be equal!
|
||||
#
|
||||
sub run_check_testcase ($) {
|
||||
|
||||
my $mode= shift;
|
||||
|
||||
my $args;
|
||||
mtr_init_args(\$args);
|
||||
|
||||
mtr_add_arg($args, "--no-defaults");
|
||||
mtr_add_arg($args, "--silent");
|
||||
mtr_add_arg($args, "-v");
|
||||
mtr_add_arg($args, "--skip-safemalloc");
|
||||
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
|
||||
|
||||
mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
|
||||
mtr_add_arg($args, "--port=%d", $master->[0]->{'path_myport'});
|
||||
mtr_add_arg($args, "--database=test");
|
||||
mtr_add_arg($args, "--user=%s", $opt_user);
|
||||
mtr_add_arg($args, "--password=");
|
||||
|
||||
mtr_add_arg($args, "-R");
|
||||
mtr_add_arg($args, "$opt_vardir/tmp/check-testcase.result");
|
||||
|
||||
if ( $mode eq "before" )
|
||||
{
|
||||
mtr_add_arg($args, "--record");
|
||||
}
|
||||
|
||||
my $res = mtr_run_test($exe_mysqltest,$args,
|
||||
"include/check-testcase.test", "", "", "");
|
||||
|
||||
if ( $res == 1 and $mode = "after")
|
||||
{
|
||||
mtr_run("diff",["-u",
|
||||
"$opt_vardir/tmp/check-testcase.result",
|
||||
"$opt_vardir/tmp/check-testcase.reject"],
|
||||
"", "", "", "");
|
||||
}
|
||||
elsif ( $res )
|
||||
{
|
||||
mtr_error("Could not execute 'check-testcase' $mode testcase");
|
||||
}
|
||||
}
|
||||
|
||||
sub run_mysqltest ($) {
|
||||
my $tinfo= shift;
|
||||
|
||||
@ -2983,7 +3033,18 @@ sub run_mysqltest ($) {
|
||||
mtr_add_arg($args, "--record");
|
||||
}
|
||||
|
||||
return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
|
||||
if ( $opt_check_testcases )
|
||||
{
|
||||
run_check_testcase("before");
|
||||
}
|
||||
|
||||
my $res = mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
|
||||
|
||||
if ( $opt_check_testcases )
|
||||
{
|
||||
run_check_testcase("after");
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -3067,6 +3128,7 @@ Options that specify ports
|
||||
Options for test case authoring
|
||||
|
||||
record TESTNAME (Re)genereate the result file for TESTNAME
|
||||
check-testcases Check testcases for sideeffects
|
||||
|
||||
Options that pass on options
|
||||
|
||||
|
Reference in New Issue
Block a user