diff options
author | Ilya Zakharevich <ilya@math.ohio-state.edu> | 1996-02-04 16:38:11 -0500 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-02-04 16:38:11 -0500 |
commit | b8440792c4a62245d0033c065af6c1ecb58e6474 (patch) | |
tree | 8e0b2f3bfe903378e731442dafbbade447efd25b | |
parent | 91bba347dac85baf813d9e41a1de89280909a30c (diff) | |
download | perl-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.
-rwxr-xr-x | t/io/argv.t | 2 | ||||
-rwxr-xr-x | t/io/fs.t | 6 | ||||
-rwxr-xr-x | t/op/pack.t | 3 | ||||
-rwxr-xr-x | t/op/stat.t | 9 |
4 files changed, 12 insertions, 8 deletions
diff --git a/t/io/argv.t b/t/io/argv.t index cee43fc46e..40ed23b373 100755 --- a/t/io/argv.t +++ b/t/io/argv.t @@ -33,4 +33,4 @@ if ($y eq "1a line\n2a line\n3a line\n") else {print "not ok 5\n";} -`/bin/rm -f Io.argv.tmp`; +`/bin/rm -f Io.argv.tmp` if -x '/bin/rm'; @@ -9,7 +9,7 @@ chop($wd); `rm -f tmp 2>/dev/null; mkdir tmp 2>/dev/null`; chdir './tmp'; -`/bin/rm -rf a b c x`; +`/bin/rm -rf a b c x` if -x '/bin/rm'; umask(022); @@ -19,9 +19,9 @@ close(fh); open(fh,'>a') || die "Can't create a"; close(fh); -if (link('a','b')) {print "ok 2\n";} else {print "not ok 2\n";} +if (eval {link('a','b')}) {print "ok 2\n";} else {print "not ok 2\n";} -if (link('b','c')) {print "ok 3\n";} else {print "not ok 3\n";} +if (eval {link('b','c')}) {print "ok 3\n";} else {print "not ok 3\n";} ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat('c'); 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; }; |