From f1ca85404b68a573c5a2f832180a77bad9188e29 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Mar 2008 12:53:35 +0100 Subject: [PATCH] Look for sourced file relative to test first --- mysql-test/lib/mtr_cases.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 98c36ad572b..ac426ecab9e 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -1004,13 +1004,19 @@ sub tags_from_test_file { $value =~ s/^\s+//; # Remove leading space $value =~ s/[[:space:]]+$//; # Remove ending space - my $sourced_file= "$::glob_mysql_test_dir/$value"; - if ( -f $sourced_file ) + # Sourced file may exist relative to test or + # in global location + foreach my $sourced_file (dirname($file). "/$value", + "$::glob_mysql_test_dir/$value") { - # 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) - tags_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) + tags_from_test_file($tinfo, $sourced_file); + last; + } } }