diff options
author | unknown <msvensson@shellback.(none)> | 2006-10-13 11:05:46 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2006-10-13 11:05:46 +0200 |
commit | b35617cdbad6d8b3bb5e162deb4677fd08aaf01d (patch) | |
tree | 0840f84c7008b6e4c0d39e12980d860624a4a197 /mysql-test/lib | |
parent | a4c972bcf7259063c47ef7213c9f8012ba63d8b2 (diff) | |
download | mariadb-git-b35617cdbad6d8b3bb5e162deb4677fd08aaf01d.tar.gz |
Improve the function that parses test files looking for what features it uses
Now also detects "source nnnn;" command, previous version only detected
"--source"
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index e6980a0abb9..42062b7ba24 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -575,8 +575,6 @@ sub mtr_options_from_test_file($$) { while ( my $line= <$F> ) { - next if ( $line !~ /^--/ ); - # Match this line against tag in "tags" array foreach my $tag (@tags) { @@ -588,14 +586,21 @@ sub mtr_options_from_test_file($$) { } # If test sources another file, open it as well - if ( $line =~ /^\-\-([[:space:]]*)source(.*)$/ ) + if ( $line =~ /^\-\-([[:space:]]*)source(.*)$/ or + $line =~ /^([[:space:]]*)source(.*);$/ ) { my $value= $2; $value =~ s/^\s+//; # Remove leading space $value =~ s/[[:space:]]+$//; # Remove ending space my $sourced_file= "$::glob_mysql_test_dir/$value"; - mtr_options_from_test_file($tinfo, $sourced_file); + if ( -f $sourced_file ) + { + # Only source the file if it exists, we may get + # false positives in the regexes above if someone + # writes "source nnnn;" in a test case(such as mysqltest.test) + mtr_options_from_test_file($tinfo, $sourced_file); + } } } |