summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-08-24 14:33:34 +0200
committerSergei Golubchik <sergii@pisem.net>2010-08-24 14:33:34 +0200
commitced635391ef9368276eddf6b490f6d969a40cef4 (patch)
treee92e354cb37c0ec6738c9c91819b61c90587f96b
parent8da7be63027403c5b82eda378842142cdcbad95c (diff)
downloadmariadb-git-ced635391ef9368276eddf6b490f6d969a40cef4.tar.gz
allow suite.pm to tell mtr to skip the suite
-rw-r--r--mysql-test/README.suites2
-rw-r--r--mysql-test/lib/mtr_cases.pm7
-rw-r--r--mysql-test/suite/innodb_plugin/suite.pm4
3 files changed, 12 insertions, 1 deletions
diff --git a/mysql-test/README.suites b/mysql-test/README.suites
index d8f39cbc39f..99155f37485 100644
--- a/mysql-test/README.suites
+++ b/mysql-test/README.suites
@@ -31,6 +31,8 @@ package that inherits from My::Suite.
The suite.pm needs to have @ISA=qw(My::Suite) and it must end
with bless {}; - that is it must return an object of that class.
+It can also return a string - in this case all tests in the suite
+will be skipped, with this string being printed as a reason.
A suite class can define config_files() and servers() methods.
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index ef85cf43537..f9c0c762753 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -997,6 +997,13 @@ sub collect_one_test_case {
}
}
+ if (not ref $::suites{$tinfo->{suite}})
+ {
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= $::suites{$tinfo->{suite}};
+ return $tinfo;
+ }
+
# ----------------------------------------------------------------------
# Append mysqld extra options to master and slave, as appropriate
# ----------------------------------------------------------------------
diff --git a/mysql-test/suite/innodb_plugin/suite.pm b/mysql-test/suite/innodb_plugin/suite.pm
index 5d0ad4a2bfd..2a146b8a52f 100644
--- a/mysql-test/suite/innodb_plugin/suite.pm
+++ b/mysql-test/suite/innodb_plugin/suite.pm
@@ -3,12 +3,14 @@ package My::Suite::InnoDB_plugin;
@ISA = qw(My::Suite);
############# initialization ######################
-my @combinations=('none');
+my @combinations;
push @combinations, 'innodb_plugin' if $ENV{HA_INNODB_PLUGIN_SO};
push @combinations, 'xtradb_plugin' if $ENV{HA_XTRADB_SO};
push @combinations, 'xtradb' if $::mysqld_variables{'innodb'} eq "ON";
+return "Neither innodb_plugin nor xtradb are available" unless @combinations;
+
$ENV{INNODB_PLUGIN_COMBINATIONS}=join ':', @combinations
unless $ENV{INNODB_PLUGIN_COMBINATIONS};