summaryrefslogtreecommitdiff
path: root/mysql-test/lib/mtr_cases.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib/mtr_cases.pl')
-rw-r--r--mysql-test/lib/mtr_cases.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 448ca90d48d..623df02261a 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -455,6 +455,16 @@ sub collect_one_test_case($$$$$$$) {
"Test case '$tname' is skipped.");
}
}
+ else
+ {
+ mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
+
+ if ( ! $tinfo->{'innodb_test'} )
+ {
+ # mtr_report("Adding '--skip-innodb' to $tinfo->{'name'}");
+ push(@{$tinfo->{'master_opt'}}, "--skip-innodb");
+ }
+ }
# We can't restart a running server that may be in use
@@ -463,7 +473,39 @@ sub collect_one_test_case($$$$$$$) {
{
$tinfo->{'skip'}= 1;
}
+
}
+sub mtr_options_from_test_file($$$) {
+ my $tinfo= shift;
+ my $file= shift;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ my @args;
+ while ( <FILE> )
+ {
+ chomp;
+
+ # Check if test uses innodb
+ if ( defined mtr_match_substring($_,"include/have_innodb.inc"))
+ {
+ $tinfo->{'innodb_test'} = 1;
+ }
+
+ # If test sources another file, open it as well
+ my $value= mtr_match_prefix($_, "--source");
+ if ( defined $value)
+ {
+ $value=~ s/^\s+//; # Remove leading space
+ $value=~ s/\s+$//; # Remove ending space
+
+ my $sourced_file= "$::glob_mysql_test_dir/$value";
+ mtr_options_from_test_file($tinfo, $sourced_file);
+ }
+
+ }
+ close FILE;
+
+}
1;