Commit 7f452a07 authored by unknown's avatar unknown

Merge pilot.(none):/data/msvensson/mysql/wl3933/my51-wl3933-new2

into  pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint


mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
  Auto merged
mysql-test/suite/ndb/r/ndb_backup_print.result:
  Auto merged
mysql-test/suite/ndb/t/loaddata_autocom_ndb.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_alter_table3.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_autodiscover3.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_backup_print.test:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/ndb/t/ndb_basic.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_binlog_log_bin.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_binlog_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_bitfield.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_blob.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_blob_partition.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cache_multi2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_charset.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_condition_pushdown.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_config.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_config2.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_cursor.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_database.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_alter.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_backuprestore.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_basic.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_ddl.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_disk2memory.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_dump.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_dd_sql_features.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_gis.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index_ordered.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_index_unique.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_insert.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_limit.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_loaddatalocal.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_lock.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_minmax.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_multi.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_error.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_key.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_list.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_partition_range.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_read_multi_range.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_rename.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_replace.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore_partition.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_restore_print.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_row_format.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_single_user.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_sp.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_subquery.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_temporary.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_transaction.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_trigger.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_truncate.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_types.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_update.test:
  Auto merged
mysql-test/suite/ndb/t/ndb_view.test:
  Auto merged
mysql-test/suite/ndb/t/ndbapi.test:
  Auto merged
mysql-test/suite/ndb/t/ps_7ndb.test:
  Auto merged
mysql-test/suite/ndb/t/strict_autoinc_5ndb.test:
  Auto merged
mysql-test/suite/rpl/r/rpl_000015.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_change_master.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_deadlock_innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_empty_master_crash.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_incident.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_known_bugs_detection.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_loaddata.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_log_pos.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_redirect.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_replicate_do.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_rotate_logs.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_log.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_max_relay_size.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_reset_slave.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_row_until.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_server_id1.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_server_id2.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_skip_error.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_slave_status.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_ssl.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_ssl1.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_log.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_stm_until.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_udf.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_000015.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_change_master.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_commit_after_flush.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_delete_no_where.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_empty_master_crash.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_innodb.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_insert_ignore.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_log_pos.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_multi_update2.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_multi_update3.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_redirect.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_relayrotate.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_replicate_do.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_001.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_UUID.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_blob_innodb.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_blob_myisam.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_charset.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_func003.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_log.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_log_innodb.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_sp003.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_row_until.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_server_id1.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_server_id2.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_skip_error.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_slave_status.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_ssl.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_ssl1.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_stm_log.test:
  Auto merged
mysql-test/suite/rpl/t/rpl_stm_until.test:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test:
  Auto merged
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test:
  Auto merged
BitKeeper/deleted/.del-binlog_row_blackhole.test:
  Auto merged
BitKeeper/deleted/.del-binlog_row_blackhole.result:
  Auto merged
BitKeeper/deleted/.del-ndb_binlog_basic2.result:
  Auto merged
BitKeeper/deleted/.del-ndb_binlog_basic2.test:
  Auto merged
mysql-test/t/disabled.def:
  Merge
parents 0314c73a a40e44ef
......@@ -23,7 +23,8 @@ use IO::File();
use strict;
sub collect_test_cases ($);
sub collect_one_test_case ($$$$$$$);
sub collect_one_suite ($$);
sub collect_one_test_case ($$$$$$$$$);
sub mtr_options_from_test_file($$);
......@@ -34,7 +35,120 @@ sub mtr_options_from_test_file($$);
##############################################################################
sub collect_test_cases ($) {
my $suite= shift; # Test suite name
my $suites= shift; # Semicolon separated list of test suites
my $cases = []; # Array of hash
foreach my $suite (split(",", $suites))
{
collect_one_suite($suite, $cases);
}
if ( @::opt_cases )
{
# Check that the tests specified was found
# in at least one suite
foreach my $tname ( @::opt_cases )
{
my $found= 0;
foreach my $test ( @$cases )
{
if ( mtr_match_extension($test->{'name'}, $tname) )
{
$found= 1;
}
}
if ( not $found )
{
mtr_error("Could not find $tname in any suite");
}
}
}
if ( $::opt_reorder )
{
# Reorder the test cases in an order that will make them faster to run
my %sort_criteria;
# Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, et c.
foreach my $tinfo (@$cases)
{
my @criteria = ();
# Look for tests that muct be in run in a defined order
# that is defined by test having the same name except for
# the ending digit
# Put variables into hash
my $test_name= $tinfo->{'name'};
my $depend_on_test_name;
if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
{
my $base_name= $1;
my $idx= $2;
mtr_verbose("$test_name => $base_name idx=$idx");
if ( $idx > 1 )
{
$idx-= 1;
$base_name= "$base_name$idx";
mtr_verbose("New basename $base_name");
}
foreach my $tinfo2 (@$cases)
{
if ( $tinfo2->{'name'} eq $base_name )
{
mtr_verbose("found dependent test $tinfo2->{'name'}");
$depend_on_test_name=$base_name;
}
}
}
if ( defined $depend_on_test_name )
{
mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
$sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
}
else
{
#
# Append the criteria for sorting, in order of importance.
#
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
$sort_criteria{$test_name} = join(" ", @criteria);
}
}
@$cases = sort {
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
if ( $::opt_script_debug )
{
# For debugging the sort-order
foreach my $tinfo (@$cases)
{
print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
}
}
}
return $cases;
}
sub collect_one_suite($$)
{
my $suite= shift; # Test suite name
my $cases= shift; # List of test cases
mtr_verbose("Collecting: $suite");
my $testdir;
my $resdir;
......@@ -50,12 +164,8 @@ sub collect_test_cases ($) {
$resdir= "$::glob_mysql_test_dir/suite/$suite/r";
}
my $cases = []; # Array of hash, will be array of C struct
opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
# ----------------------------------------------------------------------
# Disable some tests listed in disabled.def
# Build a hash of disabled testcases for this suite
# ----------------------------------------------------------------------
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
......@@ -71,11 +181,19 @@ sub collect_test_cases ($) {
close DISABLED;
}
# Read suite.opt file
my $suite_opt_file= "$testdir/suite.opt";
my $suite_opts= [];
if ( -f $suite_opt_file )
{
$suite_opts= mtr_get_opts_from_file($suite_opt_file);
}
if ( @::opt_cases )
{
# Collect in specified order, no sort
foreach my $tname ( @::opt_cases )
{
# Run in specified order, no sort
my $elem= undef;
my $component_id= undef;
......@@ -122,7 +240,8 @@ sub collect_test_cases ($) {
}
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
mtr_error("Test case $tname is not found");
# Silently skip, could exist in another suite
next;
}
elsif ( $mysqld_test_exists )
{
......@@ -136,13 +255,15 @@ sub collect_test_cases ($) {
}
}
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
$component_id);
collect_one_test_case($testdir,$resdir,$suite,$tname,
$elem,$cases,\%disabled,$component_id,
$suite_opts);
}
closedir TESTDIR;
}
else
{
opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
foreach my $elem ( sort readdir(TESTDIR) )
{
my $component_id= undef;
......@@ -165,87 +286,13 @@ sub collect_test_cases ($) {
next if $::opt_do_test and
! defined mtr_match_prefix($elem,$::opt_do_test);
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
$component_id);
collect_one_test_case($testdir,$resdir,$suite,$tname,
$elem,$cases,\%disabled,$component_id,
$suite_opts);
}
closedir TESTDIR;
}
# Reorder the test cases in an order that will make them faster to run
if ( $::opt_reorder )
{
my %sort_criteria;
# Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, et c.
foreach my $tinfo (@$cases)
{
my @criteria = ();
# Look for tests that muct be in run in a defined order
# that is defined by test having the same name except for
# the ending digit
# Put variables into hash
my $test_name= $tinfo->{'name'};
my $depend_on_test_name;
if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
{
my $base_name= $1;
my $idx= $2;
mtr_verbose("$test_name => $base_name idx=$idx");
if ( $idx > 1 )
{
$idx-= 1;
$base_name= "$base_name$idx";
mtr_verbose("New basename $base_name");
}
foreach my $tinfo2 (@$cases)
{
if ( $tinfo2->{'name'} eq $base_name )
{
mtr_verbose("found dependent test $tinfo2->{'name'}");
$depend_on_test_name=$base_name;
}
}
}
if ( defined $depend_on_test_name )
{
mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
$sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
}
else
{
#
# Append the criteria for sorting, in order of importance.
#
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
$sort_criteria{$test_name} = join(" ", @criteria);
}
}
@$cases = sort {
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
if ( $::opt_script_debug )
{
# For debugging the sort-order
foreach my $tinfo (@$cases)
{
print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
}
}
}
return $cases;
}
......@@ -257,14 +304,16 @@ sub collect_test_cases ($) {
##############################################################################
sub collect_one_test_case($$$$$$$) {
sub collect_one_test_case($$$$$$$$$) {
my $testdir= shift;
my $resdir= shift;
my $suite= shift;
my $tname= shift;
my $elem= shift;
my $cases= shift;
my $disabled=shift;
my $component_id= shift;
my $suite_opts= shift;
my $path= "$testdir/$elem";
......@@ -279,7 +328,7 @@ sub collect_one_test_case($$$$$$$) {
my $tinfo= {};
$tinfo->{'name'}= $tname;
$tinfo->{'name'}= "$suite.$tname";
$tinfo->{'result_file'}= "$resdir/$tname.result";
$tinfo->{'component_id'} = $component_id;
push(@$cases, $tinfo);
......@@ -334,6 +383,15 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
# Add suite opts
foreach my $opt ( @$suite_opts )
{
mtr_verbose($opt);
push(@{$tinfo->{'master_opt'}}, $opt);
push(@{$tinfo->{'slave_opt'}}, $opt);
}
# Add master opts
if ( -f $master_opt_file )
{
......@@ -394,6 +452,7 @@ sub collect_one_test_case($$$$$$$) {
}
}
# Add slave opts
if ( -f $slave_opt_file )
{
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
......
......@@ -48,30 +48,15 @@ sub mtr_verbose (@);
# We can't use diff -u or diff -a as these are not portable
sub mtr_show_failed_diff ($) {
my $result_file_name= shift;
my $tinfo= shift;
# The reject and log files have been dumped to
# to filenames based on the result_file's name
my $tname= basename($result_file_name);
$tname=~ s/\..*$//;
my $reject_file= "r/$tname.reject";
my $result_file= "r/$tname.result";
my $log_file= "$::opt_vardir/log/$tname.log";
my $eval_file= "r/$tname.eval";
if ( $::opt_suite ne "main" )
{
$reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file";
$result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file";
$eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file";
$log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file";
}
if ( -f $eval_file )
{
$result_file= $eval_file;
}
my $base_file= mtr_match_extension($tinfo->{'result_file'},
"result"); # Trim extension
my $reject_file= "$base_file.reject";
my $result_file= "$base_file.result";
my $log_file= "$base_file.log";
my $diffopts= $::opt_udiff ? "-u" : "-c";
......
......@@ -132,7 +132,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
our $default_vardir;
our $opt_usage;
our $opt_suite;
our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
our $opt_verbose= 0; # Verbose output, enable with --verbose
......@@ -404,7 +404,7 @@ sub main () {
else
{
# Figure out which tests we are going to run
my $tests= collect_test_cases($opt_suite);
my $tests= collect_test_cases($opt_suites);
# Turn off NDB and other similar options if no tests use it
my ($need_ndbcluster,$need_im);
......@@ -458,7 +458,7 @@ sub main () {
run_report_features();
}
run_suite($opt_suite, $tests);
run_tests($tests);
}
mtr_exit(0);
......@@ -474,7 +474,6 @@ sub command_line_setup () {
# These are defaults for things that are set on the command line
$opt_suite= "main"; # Special default suite
my $opt_comment;
$opt_master_myport= 9306;
......@@ -534,7 +533,7 @@ sub command_line_setup () {
'skip-slave-binlog' => \$opt_skip_slave_binlog,
'do-test=s' => \$opt_do_test,
'start-from=s' => \$opt_start_from,
'suite=s' => \$opt_suite,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \$opt_skip_rpl,
'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
......@@ -2806,19 +2805,17 @@ sub run_benchmarks ($) {
##############################################################################
#
# Run the test suite
# Run the tests
#
##############################################################################
sub run_suite () {
my ($suite, $tests)= @_;
sub run_tests () {
my ($tests)= @_;
mtr_print_thick_line();
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
mtr_report("Starting Tests in the '$suite' suite");
mtr_report_tests_not_skipped_though_disabled($tests);
mtr_print_header();
......@@ -3281,18 +3278,14 @@ sub run_testcase_check_skip_test($)
sub do_before_run_mysqltest($)
{
my $tinfo= shift;
my $tname= $tinfo->{'name'};
# Remove old files produced by mysqltest
my $result_dir= "r";
if ( $opt_suite ne "main" )
{
$result_dir= "suite/$opt_suite/r";
}
unlink("$result_dir/$tname.reject");
unlink("$result_dir/$tname.progress");
unlink("$result_dir/$tname.log");
unlink("$result_dir/$tname.warnings");
my $base_file= mtr_match_extension($tinfo->{'result_file'},
"result"); # Trim extension
unlink("$base_file.reject");
unlink("$base_file.progress");
unlink("$base_file.log");
unlink("$base_file.warnings");
if (!$opt_extern)
{
......@@ -3311,7 +3304,6 @@ sub do_before_run_mysqltest($)
sub do_after_run_mysqltest($)
{
my $tinfo= shift;
my $tname= $tinfo->{'name'};
# Save info from this testcase run to mysqltest.log
mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
......@@ -3635,7 +3627,7 @@ sub report_failure_and_restart ($) {
my $tinfo= shift;
mtr_report_test_failed($tinfo);
mtr_show_failed_diff($tinfo->{'result_file'});
mtr_show_failed_diff($tinfo);
print "\n";
if ( $opt_force )
{
......@@ -3774,15 +3766,7 @@ sub mysqld_arguments ($$$$) {
if ( $mysql_version_id >= 50036)
{
# By default, prevent the started mysqld to access files outside of vardir
my $secure_file_dir= $opt_vardir;
if ( $opt_suite ne "main" )
{
# When running a suite other than default allow the mysqld
# access to subdirs of mysql-test/ in order to make it possible
# to "load data" from the suites data/ directory.
$secure_file_dir= $glob_mysql_test_dir;
}
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir);
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
}
if ( $mysql_version_id >= 50000 )
......@@ -5159,7 +5143,9 @@ Options to control what test suites or cases to run
ndb-extra Run extra tests from ndb directory
do-test=PREFIX Run test cases which name are prefixed with PREFIX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
suite=NAME Run the test suite named NAME. The default is "main"
suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
list of suite names.
The default is: "$opt_suites"
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
......
--secure-file-priv=$MYSQL_TEST_DIR
--secure-file-priv=$MYSQL_TEST_DIR
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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