try harder to run non-executable tests
Gurusamy Sarathy [Mon, 6 Jul 1998 23:24:47 +0000 (23:24 +0000)]
p4raw-id: //depot/perl@1351

t/TEST

diff --git a/t/TEST b/t/TEST
index df121e8..990c18b 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -73,12 +73,18 @@ EOT
        chop($te);
        print "$te" . '.' x (18 - length($te));
        if ($sharpbang) {
-           -x $test || (print "isn't executable.\n");
+           eval { chmod 0555, $test } unless -x $test;
 
            if ($type eq 'perl') {
-               open(RESULTS, "./$test |") || (print "can't run.\n"); }
+               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(RESULTS, "./perl -I../lib ../utils/perlcc ./$test "
+                            ."-run -verbose dcf -log ../compilelog |")
+                   or print "can't compile.\n";
            }
        }
        else {