diff options
author | unknown <cmiller@zippy.cornsilk.net> | 2007-10-09 11:04:45 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.cornsilk.net> | 2007-10-09 11:04:45 -0400 |
commit | 7d05e7e94cb34f8e219b5c2d70ec3ecdf4fd607a (patch) | |
tree | 8e1bc3c954362d4f915b57edcd0d560d6d531275 /mysql-test/lib | |
parent | 6f2c2dc8e804d5a5a80fae49d7fa98cc2c76639f (diff) | |
parent | d28ce1577913474b45bb5deffd62ae969366f62e (diff) | |
download | mariadb-git-7d05e7e94cb34f8e219b5c2d70ec3ecdf4fd607a.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pl | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 5e176dce109..5aabb7f8863 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -27,6 +27,26 @@ sub collect_one_test_case ($$$$$$$); sub mtr_options_from_test_file($$); +my $do_test; +my $skip_test; + +sub init_pattern { + my ($from, $what)= @_; + if ( $from =~ /[a-z0-9]/ ) { + # Does not contain any regex, make the pattern match + # beginning of string + $from= "^$from"; + } + else { + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); + } + return $from; +} + + + ############################################################################## # # Collect information about test cases we are to run @@ -39,6 +59,9 @@ sub collect_test_cases ($) { my $testdir; my $resdir; + $do_test= init_pattern($::opt_do_test, "--do-test"); + $skip_test= init_pattern($::opt_skip_test, "--skip-test"); + if ( $suite eq "main" ) { $testdir= "$::glob_mysql_test_dir/t"; @@ -162,8 +185,7 @@ sub collect_test_cases ($) { } # Skip tests that does not match the --do-test= filter - next if $::opt_do_test and - ! defined mtr_match_prefix($elem,$::opt_do_test); + next if ($do_test and not $tname =~ /$do_test/o); collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, $component_id); @@ -288,7 +310,7 @@ sub collect_one_test_case($$$$$$$) { # Skip some tests but include in list, just mark them to skip # ---------------------------------------------------------------------- - if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) ) + if ( $skip_test and $tname =~ /$skip_test/o ) { $tinfo->{'skip'}= 1; return; |