From 36495cba3ba65bb92d7388c67aae9ba056611ac0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 11 Jun 2006 15:49:34 +0200 Subject: [PATCH] Add more checks to determine if test can be skipped becuase the feature it uses are not supported. Check for big-test, ndb-extra, require_manager and binlog format row/stmt --- mysql-test/lib/mtr_cases.pl | 56 ++++++++++++++++++++++++++++++++++++ mysql-test/mysql-test-run.pl | 17 +++++++++++ 2 files changed, 73 insertions(+) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index bb1004523d7..3cf20f89356 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -457,6 +457,31 @@ sub collect_one_test_case($$$$$$$) { # selected test cases # push(@{$tinfo->{'master_opt'}}, "--skip-innodb"); } + + if ( $tinfo->{'big_test'} and ! $::opt_big_test ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test need 'big-test' option"; + } + + if ( $tinfo->{'ndb_extra'} and ! $::opt_ndb_extra_test ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test need 'ndb_extra' option"; + } + + if ( $tinfo->{'require_manager'} ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test need the _old_ manager(to be removed)"; + } + + if ( defined $tinfo->{'binlog_format'} and + ! ( $tinfo->{'binlog_format'} eq $::used_binlog_format ) ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Not running with binlog format '$tinfo->{'binlog_format'}'"; + } } # We can't restart a running server that may be in use @@ -470,6 +495,7 @@ sub collect_one_test_case($$$$$$$) { } + sub mtr_options_from_test_file($$$) { my $tinfo= shift; my $file= shift; @@ -486,6 +512,36 @@ sub mtr_options_from_test_file($$$) { $tinfo->{'innodb_test'} = 1; } + # Check if test need rowbased logging + if ( defined mtr_match_substring($_,"include/have_binlog_format_row.inc")) + { + $tinfo->{'binlog_format'} = "row"; + } + + # Check if test need rowbased logging + if ( defined mtr_match_substring($_,"include/have_binlog_format_statement.inc")) + { + $tinfo->{'binlog_format'} = "stmt"; + } + + # Check if test need "big test" + if ( defined mtr_match_substring($_,"include/big_test.inc")) + { + $tinfo->{'big_test'} = 1; + } + + # Check if test need "ndb_extra" + if ( defined mtr_match_substring($_,"include/have_ndb_extra.inc")) + { + $tinfo->{'ndb_extra'} = 1; + } + + # Check if test need "manager", the old one + if ( defined mtr_match_substring($_,"require_manager;")) + { + $tinfo->{'require_manager'} = 1; + } + # If test sources another file, open it as well my $value= mtr_match_prefix($_, "--source"); if ( defined $value) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 499dc8ace1c..843fcb4d681 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -329,6 +329,8 @@ our $file_ndb_testrun_log; our @data_dir_lst; +our $used_binlog_format; + ###################################################################### # # Function declarations @@ -707,6 +709,21 @@ sub command_line_setup () { } } + # -------------------------------------------------------------------------- + # Find out type of logging that are being used + # -------------------------------------------------------------------------- + + # NOTE if the default binlog format is changed, this has to be changed + $used_binlog_format= "stmt"; + foreach my $arg ( @opt_extra_mysqld_opt ) + { + if ( defined mtr_match_substring($arg,"binlog-format=row")) + { + $used_binlog_format= "row"; + } + } + mtr_report("Using binlog format '$used_binlog_format'"); + # -------------------------------------------------------------------------- # Set the "var/" directory, as it is the base for everything else # --------------------------------------------------------------------------