Commit a3208c0f authored by unknown's avatar unknown

mysql-test-run.pl, mtr_cases.pl

  - Back porting of some changes in later releases
  - Corrected valgrind support
  - Removed work around for TZ needed in VisualStudio 6
  - Don't restart master to add special settings from "<testcase>-master.opt",
    if same settngs as running master, feature request in bug#12433
  - With --reorder, keep tests with same *-master.opt content together,
    to save even more master restarts


mysql-test/lib/mtr_misc.pl:
  Added functions to compare lists of options
mysql-test/lib/mtr_cases.pl:
  Removed special code for Windows as in VC6 we unset
  TZ to avoid library bug
mysql-test/mysql-test-run.pl:
  Handle pseudo option --timezone=<spec> that sets TZ
parent 3c83b827
......@@ -85,11 +85,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
......@@ -189,8 +202,8 @@ sub collect_one_test_case($$$$$$) {
my $slave_sh= "$testdir/$tname-slave.sh";
my $disabled_file= "$testdir/$tname.disabled";
$tinfo->{'master_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
$tinfo->{'slave_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
$tinfo->{'master_opt'}= [];
$tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
if ( -f $master_opt_file )
......@@ -213,7 +226,6 @@ sub collect_one_test_case($$$$$$) {
if ( defined $value )
{
$tinfo->{'timezone'}= $value;
$tinfo->{'skip'}= 1 if $::glob_win32; # FIXME server unsets TZ
last MASTER_OPT;
}
......
......@@ -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;
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment