diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-09 01:26:19 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-09 01:26:19 +0000 |
commit | d638aca26c38bab9310e5c2f873f4faf27ece6c7 (patch) | |
tree | e258808be543bba37b796a1ae8b1dd64ce5619d8 /t/TEST | |
parent | 1bd3ad17f2b89c5c7610c541aa9f8fd2ae783e7f (diff) | |
download | perl-d638aca26c38bab9310e5c2f873f4faf27ece6c7.tar.gz |
make t/TEST run 'perl $switches ./foo/test.t' everywhere
p4raw-id: //depot/perl@1384
Diffstat (limited to 't/TEST')
-rwxr-xr-x | t/TEST | 63 |
1 files changed, 18 insertions, 45 deletions
@@ -25,20 +25,6 @@ if ($#ARGV == -1) { `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); } -if ($^O eq 'os2' || $^O eq 'qnx') { - $sharpbang = 0; -} -else { - open(CONFIG, "../config.sh"); - while (<CONFIG>) { - if (/sharpbang='(.*)'/) { - $sharpbang = ($1 eq '#!'); - last; - } - } - close(CONFIG); -} - %infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); _testprogs('perl', @ARGV); @@ -72,43 +58,30 @@ EOT $te = $test; chop($te); print "$te" . '.' x (18 - length($te)); - if ($sharpbang) { - eval { chmod 0555, $test } unless -x $test; - if ($type eq 'perl') { - unless (open(RESULTS, "./$test |")) { - print "$test not executable, " unless -x $test; - print "can't run.\n"; - } - } - else { - open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test " - ."-run -verbose dcf -log ../compilelog |") - or print "can't compile.\n"; + open(SCRIPT,"<$test") or die "Can't run $test.\n"; + $_ = <SCRIPT>; + close(SCRIPT); + if (/#!.*perl(.*)$/) { + $switch = $1; + if ($^O eq 'VMS') { + # Must protect uppercase switches with "" on command line + $switch =~ s/-([A-Z]\S*)/"-$1"/g; } } else { - open(SCRIPT,"$test") or die "Can't run $test.\n"; - $_ = <SCRIPT>; - close(SCRIPT); - if (/#!..perl(.*)/) { - $switch = $1; - if ($^O eq 'VMS') { - # Must protect uppercase switches with "" on command line - $switch =~ s/-([A-Z]\S*)/"-$1"/g; - } - } - else { - $switch = ''; - } + $switch = ''; + } - if ($type eq 'perl') { - open(RESULTS,"./perl$switch $test |") || (print "can't run.\n"); - } - else { - open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test -run -verbose dcf -log ../compilelog |") or print "can't compile.\n"; - } + if ($type eq 'perl') { + open(RESULTS,"./perl$switch $test |") or print "can't run.\n"; + } + else { + open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test " + ."-run -verbose dcf -log ../compilelog |") + or print "can't compile.\n"; } + $ok = 0; $next = 0; while (<RESULTS>) { |