summaryrefslogtreecommitdiff
path: root/mysql-test/lib/mtr_misc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib/mtr_misc.pl')
-rw-r--r--mysql-test/lib/mtr_misc.pl40
1 files changed, 38 insertions, 2 deletions
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index dd9d24ebc8e..846ca25b725 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -14,6 +14,7 @@ sub mtr_path_exists(@);
sub mtr_script_exists(@);
sub mtr_file_exists(@);
sub mtr_exe_exists(@);
+sub mtr_exe_maybe_exists(@);
sub mtr_copy_dir($$);
sub mtr_same_opts($$);
sub mtr_cmp_opts($$);
@@ -65,6 +66,10 @@ sub mtr_add_arg ($$@) {
##############################################################################
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
sub mtr_path_exists (@) {
foreach my $path ( @_ )
{
@@ -80,6 +85,11 @@ sub mtr_path_exists (@) {
}
}
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
sub mtr_script_exists (@) {
foreach my $path ( @_ )
{
@@ -102,6 +112,11 @@ sub mtr_script_exists (@) {
}
}
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
sub mtr_file_exists (@) {
foreach my $path ( @_ )
{
@@ -110,8 +125,14 @@ sub mtr_file_exists (@) {
return "";
}
-sub mtr_exe_exists (@) {
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_exe_maybe_exists (@) {
my @path= @_;
+
map {$_.= ".exe"} @path if $::glob_win32;
foreach my $path ( @path )
{
@@ -124,6 +145,21 @@ sub mtr_exe_exists (@) {
return $path if -x $path;
}
}
+ return "";
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
+# For example /client/debug should be listed before /client
+#
+sub mtr_exe_exists (@) {
+ my @path= @_;
+ if (my $path= mtr_exe_maybe_exists(@path))
+ {
+ return $path;
+ }
+ # Could not find exe, show error
if ( @path == 1 )
{
mtr_error("Could not find $path[0]");
@@ -139,7 +175,7 @@ sub mtr_copy_dir($$) {
my $from_dir= shift;
my $to_dir= shift;
-# mtr_verbose("Copying from $from_dir to $to_dir");
+ # mtr_verbose("Copying from $from_dir to $to_dir");
mkpath("$to_dir");
opendir(DIR, "$from_dir")