]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/run_make_tests.pl (subst_make_string): Force use of /
authorPaul Smith <psmith@gnu.org>
Mon, 16 Dec 2019 21:18:58 +0000 (16:18 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 16 Dec 2019 21:18:58 +0000 (16:18 -0500)
On Windows the path to the helper tool will contain '\': this will
fail if recipes are run with a POSIX shell.  Convert '\' to '/'
on Windows.  While here, escape any spaces in the path as well.

tests/run_make_tests.pl

index 8cdf6c7f92b35a9c096f837fbabd671156bba4d1..3807b34ede8377421dfb0d19172b06516b682c1e 100644 (file)
@@ -220,7 +220,11 @@ sub valid_option
 #  [2] (string):  Answer we should get back.
 #  [3] (integer): Exit code we expect.  A missing code means 0 (success)
 
+$makefile = undef;
 $old_makefile = undef;
+$mkpath = undef;
+$make_name = undef;
+$helptool = undef;
 
 sub subst_make_string
 {
@@ -230,9 +234,8 @@ sub subst_make_string
     s/#MAKE#/$make_name/g;
     s/#PERL#/$perl_name/g;
     s/#PWD#/$cwdpath/g;
-    my $help = File::Spec->catfile($fqsrcdir, 'tests', 'thelp.pl');
     # If we're using a shell
-    s/#HELPER#/$perl_name $help/g;
+    s/#HELPER#/$perl_name $helptool/g;
     return $_;
 }
 
@@ -615,6 +618,14 @@ sub set_more_defaults
   $fqsrcdir = File::Spec->rel2abs($srcdir);
   $fqblddir = File::Spec->rel2abs($blddir);
 
+  # Find the helper tool
+  $helptool = File::Spec->catfile($fqsrcdir, 'tests', 'thelp.pl');
+
+  # It's difficult to quote this properly in all the places it's used so
+  # ensure it doesn't need to be quoted.
+  $helptool =~ s,\\,/,g if $port_type = 'W32';
+  $helptool =~ s, ,\\ ,g;
+
   # Get Purify log info--if any.
 
   if (exists $ENV{PURIFYOPTIONS}