From: Ilya Zakharevich Date: Tue, 19 Jan 1999 20:13:15 +0000 (-0500) Subject: Remove extraneous sh in test suites X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=648cac195c82cb1f1b31f3751c1a36107e153a68;p=p5sagit%2Fp5-mst-13.2.git Remove extraneous sh in test suites Message-ID: <19990119201315.A21167@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2893 --- diff --git a/t/op/fh.t b/t/op/fh.t index d2659c3..469aa0e 100755 --- a/t/op/fh.t +++ b/t/op/fh.t @@ -6,6 +6,7 @@ my $test = 0; # symbolic filehandles should only result in glob entries with FH constructors +$|=1; my $a = "SYM000"; print "not " if defined(fileno($a)) or defined *{$a}; ++$test; print "ok $test\n"; diff --git a/t/op/misc.t b/t/op/misc.t index 78c8bf2..778476e 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -25,17 +25,20 @@ for (@prgs){ $switch = $1; } my($prog,$expected) = split(/\nEXPECT\n/, $_); + open TEST, ">$tmpfile" or die "Cannot open $tmpfile: $!"; + print TEST $prog, "\n"; + close TEST or die "Cannot close $tmpfile: $!"; + if ($^O eq 'MSWin32') { - open TEST, "| .\\perl -I../lib $switch >$tmpfile 2>&1"; + $results = `.\\perl -I../lib $switch $tmpfile 2>&1`; } else { - open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1"; + $results = `./perl $switch $tmpfile 2>&1`; } - print TEST $prog, "\n"; - close TEST; $status = $?; - $results = `$CAT $tmpfile`; $results =~ s/\n+$//; + $results =~ s/at\s+misctmp\d+\s+line/at - line/g; + $results =~ s/of\s+misctmp\d+\s+aborted/of - aborted/g; # bison says 'parse error' instead of 'syntax error', # various yaccs may or may not capitalize 'syntax'. $results =~ s/^(syntax|parse) error/syntax error/mig; @@ -77,7 +80,7 @@ $x=0x0eabcd; print $x->ref; EXPECT Can't call method "ref" without a package or object reference at - line 1. ######## -chop ($str .= ); +chop ($str .= ); ######## close ($banana); ######## @@ -89,7 +92,7 @@ eval {sub bar {print "In bar";}} ######## system './perl -ne "print if eof" /dev/null' ######## -chop($file = <>); +chop($file = ); ######## package N; sub new {my ($obj,$n)=@_; bless \$n} diff --git a/t/op/runlevel.t b/t/op/runlevel.t index 623ca42..a155177 100755 --- a/t/op/runlevel.t +++ b/t/op/runlevel.t @@ -35,7 +35,7 @@ for (@prgs){ `MCR $^X "-I[-.lib]" $switch $tmpfile` : $Is_MSWin32 ? `.\\perl -I../lib $switch $tmpfile 2>&1` : - `sh -c './perl $switch $tmpfile' 2>&1`; + `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN diff --git a/t/pragma/strict.t b/t/pragma/strict.t index 1f55986..2b8c587 100755 --- a/t/pragma/strict.t +++ b/t/pragma/strict.t @@ -69,7 +69,7 @@ for (@prgs){ `MCR $^X $switch $tmpfile` : $Is_MSWin32 ? `.\\perl -I../lib $switch $tmpfile 2>&1` : - `sh -c './perl $switch $tmpfile' 2>&1`; + `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN diff --git a/t/pragma/subs.t b/t/pragma/subs.t index 42251f6..c8eb2c0 100755 --- a/t/pragma/subs.t +++ b/t/pragma/subs.t @@ -49,7 +49,7 @@ for (@prgs){ `MCR $^X $switch $tmpfile` : $Is_MSWin32 ? `.\\perl -I../lib $switch $tmpfile 2>&1` : - `sh -c './perl $switch $tmpfile' 2>&1`; + `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN diff --git a/t/pragma/warning.t b/t/pragma/warning.t index f4d955a..7914121 100755 --- a/t/pragma/warning.t +++ b/t/pragma/warning.t @@ -79,7 +79,7 @@ for (@prgs){ `MCR $^X $switch $tmpfile` : $Is_MSWin32 ? `.\\perl -I../lib $switch $tmpfile 2>&1` : - `sh -c './perl $switch $tmpfile' 2>&1`; + `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN