make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make 3.81 MinGW port and testsuite working with MSYS


From: Alessandro Vesely
Subject: Re: make 3.81 MinGW port and testsuite working with MSYS
Date: Sun, 27 Feb 2005 15:45:39 +0100

"Paul D. Smith" wrote:
> 
> What happens if you replace the test_driver.pl:run_command_with_output()
> sub with the following;

It won't work on a win32 perl, because of the `2>&1'. Of course,
we need a unixy shell to run the tests, but AFAIK there's no way
to let perl also use it.

The original testsuite also didn't work out of the box, but the
`system' function accepts a shell parameter, as in

  $code = system {'sh.exe'} 'sh.exe', '-c', @_;

which needs the attach/detach _default_output functions. The above
line is better than what I've been using on previous runs. With it
and the path-forgiving patch (pasted below) I got 16 Tests in 10
Categories Failed running perl from the command.com prompt with
sh.exe in the path. (The feature/escape test passed as-is.) I get
a similar result running perl from the MSYS prompt. This is on win98
with ActivePerl.

----- slash-forgiving patch begin -----
--- other_test_driver.pl        Mon Feb 21 21:30:38 2005
+++ test_driver.pl      Sun Feb 27 14:16:24 2005
@@ -611,7 +611,7 @@
 sub compare_output
 {
   local($answer,$logfile) = @_;
-  local($slurp);
+  local($slurp, $slashed_answer);
 
   print "Comparing Output ........ " if $debug;
 
@@ -624,11 +624,21 @@
 
   ++$tests_run;
 
-  if ($slurp eq $answer && $test_passed)
-  {
-    print "ok\n" if $debug;
-    ++$tests_passed;
-    return 1;
+  if ($test_passed) {
+    if ($slurp eq $answer) {
+      print "ok\n" if $debug;
+      ++$tests_passed;
+      return 1;
+    }
+    # see if it is a slash problem
+    $slashed_answer = $answer;
+    $slashed_answer =~ s/\\/\//gm;
+    $slurp =~ s/\\/\//gm;
+    if ($slurp eq $slashed_answer) {
+      print "\\/\n" if $debug;
+      ++$tests_passed;
+      return 1;
+    }
   }
----- slash-forgiving patch end -----

> [...]
> sub run_command_with_output
> {
>   local ($filename) = shift;
>   local ($code) = (0);
>   local ($output);
>   local $/ = undef;
> 
>   open(F, "> $filename") || return $?;
> 
>   open(P, " 2>&1 @_ |") || return $?;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]