summaryrefslogtreecommitdiff
path: root/t/TEST
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-09 01:26:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-09 01:26:19 +0000
commitd638aca26c38bab9310e5c2f873f4faf27ece6c7 (patch)
treee258808be543bba37b796a1ae8b1dd64ce5619d8 /t/TEST
parent1bd3ad17f2b89c5c7610c541aa9f8fd2ae783e7f (diff)
downloadperl-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-xt/TEST63
1 files changed, 18 insertions, 45 deletions
diff --git a/t/TEST b/t/TEST
index 990c18b2db..a302e66a2f 100755
--- a/t/TEST
+++ b/t/TEST
@@ -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>) {