|
|
@ -205,7 +205,7 @@ our $opt_client_debugger; |
|
|
|
my $config; # The currently running config |
|
|
|
my $current_config_name; # The currently running config file template |
|
|
|
|
|
|
|
our $opt_experimental; |
|
|
|
our @opt_experimentals; |
|
|
|
our $experimental_test_cases; |
|
|
|
|
|
|
|
my $baseport; |
|
|
@ -239,6 +239,7 @@ my $opt_start_dirty; |
|
|
|
my $opt_start_exit; |
|
|
|
my $start_only; |
|
|
|
my $opt_wait_all; |
|
|
|
my $opt_user_args; |
|
|
|
my $opt_repeat= 1; |
|
|
|
my $opt_retry= 3; |
|
|
|
my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2); |
|
|
@ -864,7 +865,7 @@ sub command_line_setup { |
|
|
|
'big-test' => \$opt_big_test, |
|
|
|
'combination=s' => \@opt_combinations, |
|
|
|
'skip-combinations' => \&collect_option, |
|
|
|
'experimental=s' => \$opt_experimental, |
|
|
|
'experimental=s' => \@opt_experimentals, |
|
|
|
'skip-im' => \&ignore_option, |
|
|
|
|
|
|
|
# Specify ports |
|
|
@ -939,6 +940,7 @@ sub command_line_setup { |
|
|
|
'start-dirty' => \$opt_start_dirty, |
|
|
|
'start-and-exit' => \$opt_start_exit, |
|
|
|
'start' => \$opt_start, |
|
|
|
'user-args' => \$opt_user_args, |
|
|
|
'wait-all' => \$opt_wait_all, |
|
|
|
'print-testcases' => \&collect_option, |
|
|
|
'repeat=i' => \$opt_repeat, |
|
|
@ -1050,43 +1052,47 @@ sub command_line_setup { |
|
|
|
mtr_print_thick_line('#'); |
|
|
|
} |
|
|
|
|
|
|
|
if ( $opt_experimental ) |
|
|
|
if ( @opt_experimentals ) |
|
|
|
{ |
|
|
|
# $^O on Windows considered not generic enough |
|
|
|
my $plat= (IS_WINDOWS) ? 'windows' : $^O; |
|
|
|
|
|
|
|
# read the list of experimental test cases from the file specified on |
|
|
|
# read the list of experimental test cases from the files specified on |
|
|
|
# the command line |
|
|
|
open(FILE, "<", $opt_experimental) or mtr_error("Can't read experimental file: $opt_experimental"); |
|
|
|
mtr_report("Using experimental file: $opt_experimental"); |
|
|
|
$experimental_test_cases = []; |
|
|
|
while(<FILE>) { |
|
|
|
chomp; |
|
|
|
# remove comments (# foo) at the beginning of the line, or after a |
|
|
|
# blank at the end of the line |
|
|
|
s/( +|^)#.*$//; |
|
|
|
# If @ platform specifier given, use this entry only if it contains |
|
|
|
# @<platform> or @!<xxx> where xxx != platform |
|
|
|
if (/\@.*/) |
|
|
|
{ |
|
|
|
next if (/\@!$plat/); |
|
|
|
next unless (/\@$plat/ or /\@!/); |
|
|
|
# Then remove @ and everything after it |
|
|
|
s/\@.*$//; |
|
|
|
} |
|
|
|
# remove whitespace |
|
|
|
s/^ +//; |
|
|
|
s/ +$//; |
|
|
|
# if nothing left, don't need to remember this line |
|
|
|
if ( $_ eq "" ) { |
|
|
|
next; |
|
|
|
foreach my $exp_file (@opt_experimentals) |
|
|
|
{ |
|
|
|
open(FILE, "<", $exp_file) |
|
|
|
or mtr_error("Can't read experimental file: $exp_file"); |
|
|
|
mtr_report("Using experimental file: $exp_file"); |
|
|
|
while(<FILE>) { |
|
|
|
chomp; |
|
|
|
# remove comments (# foo) at the beginning of the line, or after a |
|
|
|
# blank at the end of the line |
|
|
|
s/( +|^)#.*$//; |
|
|
|
# If @ platform specifier given, use this entry only if it contains |
|
|
|
# @<platform> or @!<xxx> where xxx != platform |
|
|
|
if (/\@.*/) |
|
|
|
{ |
|
|
|
next if (/\@!$plat/); |
|
|
|
next unless (/\@$plat/ or /\@!/); |
|
|
|
# Then remove @ and everything after it |
|
|
|
s/\@.*$//; |
|
|
|
} |
|
|
|
# remove whitespace |
|
|
|
s/^ +//; |
|
|
|
s/ +$//; |
|
|
|
# if nothing left, don't need to remember this line |
|
|
|
if ( $_ eq "" ) { |
|
|
|
next; |
|
|
|
} |
|
|
|
# remember what is left as the name of another test case that should be |
|
|
|
# treated as experimental |
|
|
|
print " - $_\n"; |
|
|
|
push @$experimental_test_cases, $_; |
|
|
|
} |
|
|
|
# remember what is left as the name of another test case that should be |
|
|
|
# treated as experimental |
|
|
|
print " - $_\n"; |
|
|
|
push @$experimental_test_cases, $_; |
|
|
|
close FILE; |
|
|
|
} |
|
|
|
close FILE; |
|
|
|
} |
|
|
|
|
|
|
|
foreach my $arg ( @ARGV ) |
|
|
@ -1360,13 +1366,24 @@ sub command_line_setup { |
|
|
|
$start_only= 1; |
|
|
|
} |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
|
|
# Check use of user-args |
|
|
|
# -------------------------------------------------------------------------- |
|
|
|
|
|
|
|
if ($opt_user_args) { |
|
|
|
mtr_error("--user-args only valid with --start options") |
|
|
|
unless $start_only; |
|
|
|
mtr_error("--user-args cannot be combined with named suites or tests") |
|
|
|
if $opt_suites || @opt_cases; |
|
|
|
} |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
|
|
# Check use of wait-all |
|
|
|
# -------------------------------------------------------------------------- |
|
|
|
|
|
|
|
if ($opt_wait_all && ! $start_only) |
|
|
|
{ |
|
|
|
mtr_error("--wait-all can only be used with --start or --start-dirty"); |
|
|
|
mtr_error("--wait-all can only be used with --start options"); |
|
|
|
} |
|
|
|
|
|
|
|
# -------------------------------------------------------------------------- |
|
|
@ -2802,6 +2819,7 @@ sub default_mysqld { |
|
|
|
my $config= My::ConfigFactory->new_config |
|
|
|
( { |
|
|
|
basedir => $basedir, |
|
|
|
testdir => $glob_mysql_test_dir, |
|
|
|
template_path => "include/default_my.cnf", |
|
|
|
vardir => $opt_vardir, |
|
|
|
tmpdir => $opt_tmpdir, |
|
|
@ -3410,6 +3428,7 @@ sub run_testcase ($) { |
|
|
|
$config= My::ConfigFactory->new_config |
|
|
|
( { |
|
|
|
basedir => $basedir, |
|
|
|
testdir => $glob_mysql_test_dir, |
|
|
|
template_path => $tinfo->{template_path}, |
|
|
|
extra_template_path => $tinfo->{extra_template_path}, |
|
|
|
vardir => $opt_vardir, |
|
|
@ -4313,7 +4332,7 @@ sub mysqld_arguments ($$$) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( $mysql_version_id >= 50106 ) |
|
|
|
if ( $mysql_version_id >= 50106 && !$opt_user_args) |
|
|
|
{ |
|
|
|
# Turn on logging to file |
|
|
|
mtr_add_arg($args, "--log-output=file"); |
|
|
@ -4356,7 +4375,7 @@ sub mysqld_arguments ($$$) { |
|
|
|
} |
|
|
|
} |
|
|
|
$opt_skip_core = $found_skip_core; |
|
|
|
if ( !$found_skip_core ) |
|
|
|
if ( !$found_skip_core && !$opt_user_args ) |
|
|
|
{ |
|
|
|
mtr_add_arg($args, "%s", "--core-file"); |
|
|
|
} |
|
|
@ -4364,7 +4383,7 @@ sub mysqld_arguments ($$$) { |
|
|
|
# Enable the debug sync facility, set default wait timeout. |
|
|
|
# Facility stays disabled if timeout value is zero. |
|
|
|
mtr_add_arg($args, "--loose-debug-sync-timeout=%s", |
|
|
|
$opt_debug_sync_timeout); |
|
|
|
$opt_debug_sync_timeout) unless $opt_user_args; |
|
|
|
|
|
|
|
return $args; |
|
|
|
} |
|
|
@ -4662,6 +4681,9 @@ sub envsubst { |
|
|
|
|
|
|
|
|
|
|
|
sub get_extra_opts { |
|
|
|
# No extra options if --user-args |
|
|
|
return \@opt_extra_mysqld_opt if $opt_user_args; |
|
|
|
|
|
|
|
my ($mysqld, $tinfo)= @_; |
|
|
|
|
|
|
|
my $opts= |
|
|
@ -5534,8 +5556,13 @@ Misc options |
|
|
|
startup settings for the first specified test case |
|
|
|
Example: |
|
|
|
$0 --start alias & |
|
|
|
start-and-exit Same as --start, but mysql-test-run terminates and |
|
|
|
leaves just the server running |
|
|
|
start-dirty Only start the servers (without initialization) for |
|
|
|
the first specified test case |
|
|
|
user-args In combination with start* and no test name, drops |
|
|
|
arguments to mysqld except those speficied with |
|
|
|
--mysqld (if any) |
|
|
|
wait-all If --start or --start-dirty option is used, wait for all |
|
|
|
servers to exit before finishing the process |
|
|
|
fast Run as fast as possible, dont't wait for servers |
|
|
|