develooper Front page | perl.perl5.porters | Postings from August 2001

[PATCH lib/warnings.t] Removing 2>&1 requirement (was Re: bleadperl on fire, Win95+4NT)

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
August 27, 2001 13:54
Subject:
[PATCH lib/warnings.t] Removing 2>&1 requirement (was Re: bleadperl on fire, Win95+4NT)
Message ID:
20010827165442.F9436@blackrider
On Mon, Aug 27, 2001 at 07:26:41AM -0700, Benjamin Stuhl wrote:
> This is more or less standard on Win9X/ME. There are
> several issues with 'make test' there. The first is that 9X
> doesn't actually inmplement all the system calls that perl
> thinks it does (e.g. link() or flock()). 

They should be skipped then.  Can you give me a list of tests that are
supposed to fail on Win98 so we can skip over them?

> Secondly, and more importantly, command.com does not support '2>&1'
> syntax

OH!  There's a much easier way to do that.  Just dup STDERR to STDOUT.

--- lib/warnings.t	2001/08/27 20:42:29	1.1
+++ lib/warnings.t	2001/08/27 20:52:01
@@ -81,15 +81,22 @@
 	$prog = shift @files ;
     }
     open TEST, ">$tmpfile";
+    print TEST q{
+        BEGIN { 
+            open(STDERR, ">&STDOUT") 
+              or die "Can't dup STDOUT->STDERR: $!;";
+        }
+    };
+    print TEST "\n#line 1\n";  # So the line numbers don't get messed up.
     print TEST $prog,"\n";
     close TEST;
     my $results = $Is_VMS ?
-                  `./perl "-I../lib" $switch $tmpfile 2>&1` :
+                  `./perl "-I../lib" $switch $tmpfile` :
 		  $Is_MSWin32 ?
-                  `.\\perl -I../lib $switch $tmpfile 2>&1` :
+                  `.\\perl -I../lib $switch $tmpfile` :
 		  $Is_NetWare ?
-                  `perl -I../lib $switch $tmpfile 2>&1` :
-                  `./perl -I../lib $switch $tmpfile 2>&1`;
+                  `perl -I../lib $switch $tmpfile` :
+                  `./perl -I../lib $switch $tmpfile`;
     my $status = $?;
     $results =~ s/\n+$//;
     # allow expected output to be written as if $prog is on STDIN



-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
My beverage utensil experiences a volume crisis.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About