summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1996-02-04 16:38:11 -0500
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-02-04 16:38:11 -0500
commitb8440792c4a62245d0033c065af6c1ecb58e6474 (patch)
tree8e0b2f3bfe903378e731442dafbbade447efd25b /t/op
parent91bba347dac85baf813d9e41a1de89280909a30c (diff)
downloadperl-b8440792c4a62245d0033c065af6c1ecb58e6474.tar.gz
Patches for test suit for better portability
This does not change actual tests, but improves support code such that an early bail out does not happen if environment is not Unixish.
Diffstat (limited to 't/op')
-rwxr-xr-xt/op/pack.t3
-rwxr-xr-xt/op/stat.t9
2 files changed, 8 insertions, 4 deletions
diff --git a/t/op/pack.t b/t/op/pack.t
index 859d48f70d..1cfcd60b08 100755
--- a/t/op/pack.t
+++ b/t/op/pack.t
@@ -33,7 +33,8 @@ print +($x = unpack("%32B69", "\001\002\004\010\020\040\100\200\017")) == 9
print +($x = unpack("%32B*", "Now is the time for all good blurfl")) == 129
? "ok 7\n" : "not ok 7 $x\n";
-open(BIN, "./perl") || die "Can't open ../perl: $!\n";
+open(BIN, "./perl") || open(BIN, "./perl.exe")
+ || die "Can't open ../perl or ../perl.exe: $!\n";
sysread BIN, $foo, 8192;
close BIN;
diff --git a/t/op/stat.t b/t/op/stat.t
index cfaf043b08..bace330295 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -115,6 +115,7 @@ if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
$cnt = $uid = 0;
die "Can't run op/stat.t test 35 without pwd working" unless $cwd;
+print ("not ok 35\n"), goto tty_test unless -d '/usr/bin';
chdir '/usr/bin' || die "Can't cd to /usr/bin";
while (defined($_ = <*>)) {
$cnt++;
@@ -127,7 +128,9 @@ chdir $cwd || die "Can't cd back to $cwd";
if ($uid > 0 && $uid < $cnt)
{print "ok 35\n";}
else
- {print "not ok 35 ($uid $cnt)\n";}
+ {print "not ok 35 \n# ($uid $cnt)\n";}
+
+tty_test:
unless (open(tty,"/dev/tty")) {
print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n";
@@ -146,8 +149,8 @@ if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
if (-T 'op/stat.t') {print "ok 41\n";} else {print "not ok 41\n";}
if (! -B 'op/stat.t') {print "ok 42\n";} else {print "not ok 42\n";}
-if (-B './perl') {print "ok 43\n";} else {print "not ok 43\n";}
-if (! -T './perl') {print "ok 44\n";} else {print "not ok 44\n";}
+if (-B './perl' || -B './perl.exe') {print "ok 43\n";} else {print "not ok 43\n";}
+if (! -T './perl' && ! -T './perl.exe') {print "ok 44\n";} else {print "not ok 44\n";}
open(FOO,'op/stat.t');
eval { -T FOO; };