1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Parse test files to find out if it needs innodb or not, mark test as 'innodb_test' if it does and add "--skip-innodb" to master_opts if it does not.

This commit is contained in:
msvensson@shellback.(none)
2006-05-17 23:54:48 +02:00
parent 3def02edd1
commit 206fe5f559

View File

@ -455,6 +455,10 @@ sub collect_one_test_case($$$$$$$) {
"Test case '$tname' is skipped.");
}
}
else
{
mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
}
# We can't restart a running server that may be in use
@ -463,7 +467,46 @@ 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;
if ( ! $tinfo->{'innodb_test'} )
{
# mtr_report("Adding '--skip-innodb' to $tinfo->{'name'}");
push(@{$tinfo->{'master_opt'}}, "--skip-innodb");
}
}
1;