diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-03-09 11:57:19 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-03-09 11:57:19 +1200 |
commit | 68dc074516a6859e3424b48d1647bcb08b1a1a7d (patch) | |
tree | 125011c6d8e4a04727ff97166dc19199809958e4 /t | |
parent | 699e6cd4da8c333ef83554732e73ab6734463b5d (diff) | |
download | perl-68dc074516a6859e3424b48d1647bcb08b1a1a7d.tar.gz |
[inseparable changes from match from perl-5.003_93 to perl-5.003_94]
BUILD PROCESS
Subject: Don't use db 2.x, we're not yet ready for it
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: Configure
Subject: Warn if #! command is longer than 32 chars
From: Chip Salzenberg <chip@perl.com>
Files: Configure
Subject: patches re perl -wc install{perl,man}
Date: Tue, 11 Mar 97 13:13:16 GMT
From: Robin Barker <rmb1@cise.npl.co.uk>
Files: installman installperl
I got the new installhtml from CPAN
(TOMC/scripts/pod2html-v2.0beta.shar.gz)
I had problems getting the system call to splitpod at line 376 to work.
1. splitroot was not being found
2. splitroot was not finding its library
3. I changed htmlroot to podroot at line 175 to match the documentation.
p5p-msgid: 3180.9703270906@tempest.cise.npl.co.uk
private-msgid: 21544.9703111313@tempest.cise.npl.co.uk
Subject: 3_93 doesn't install pods
Date: Sun, 16 Mar 1997 02:21:35 -0500
From: Spider Boardman <spider@orb.nashua.nh.us>
Files: installperl
Msg-ID: 199703160721.CAA08339@Orb.Nashua.NH.US
(applied based on p5p patch as commit 43506a616735d616e03d277d64fbae1e864024bf)
Subject: When installing, use File::Copy instead of `cp`
From: Chip Salzenberg <chip@perl.com>
Files: installperl
Subject: Make hint files' warnings more visible
Date: Thu, 20 Mar 1997 23:18:03 +0100 (MET)
From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no>
Files: hints/3b1.sh hints/apollo.sh hints/cxux.sh hints/dcosx.sh hints/dgux.sh hints/esix4.sh hints/freebsd.sh hints/hpux.sh hints/irix_4.sh hints/mips.sh hints/next_3_0.sh hints/os2.sh hints/qnx.sh hints/sco_2_3_3.sh hints/sco_2_3_4.sh hints/solaris_2.sh hints/ultrix_4.sh hints/utekv.sh
private-msgid: 199703202218.XAA09041@bombur2.uio.no
CORE LANGUAGE CHANGES
Subject: Defer creation of array and hash elements as parameters
From: Chip Salzenberg <chip@perl.com>
Files: dump.c global.sym mg.c op.c op.h perl.h pp.c pp_hot.c proto.h sv.c
Subject: New special literal: __PACKAGE__
From: Chip Salzenberg <chip@perl.com>
Files: keywords.pl pod/perldata.pod toke.c
Subject: Abort compilation at C<BEGIN{}> or C<use> after errors
From: Chip Salzenberg <chip@perl.com>
Files: op.c pod/perldiag.pod t/pragma/subs.t
Subject: allow C<substr 'hello', -10>
Date: Mon, 10 Mar 1997 15:55:44 -0800
From: David Dyck <dcd@tc.fluke.com>
Files: pp.c
Msg-ID: 97Mar10.155517pst.35716-2@gateway.fluke.com
(applied based on p5p patch as commit 77f720bf92f3d0100352416caeedd57936807ff2)
Subject: Regularize C<x % y>, esp. when y is negative
From: Chip Salzenberg <chip@perl.com>
Files: pp.c
Subject: Flush before C<flock(FOO, LOCK_UN)>
From: Chip Salzenberg <chip@perl.com>
Files: pod/perldelta.pod pod/perlfunc.pod pp_sys.c
Subject: Close loopholes in prototype mismatch warning
From: Chip Salzenberg <chip@perl.com>
Files: op.c sv.c toke.c
Subject: Warn on C<while ($x = each %y) {}>
From: Chip Salzenberg <chip@perl.com>
Files: op.c pod/perldiag.pod
Subject: Don't warn on C<print $fh func()>
From: Chip Salzenberg <chip@perl.com>
Files: toke.c
CORE PORTABILITY
Subject: Don't say 'static var = 1'
Date: Sun, 9 Mar 1997 15:19:57 +0200 (EET)
From: Jarkko Hietaniemi <jhi@iki.fi>
Files: malloc.c
private-msgid: 199703091319.PAA24714@alpha.hut.fi
Subject: HP/UX hint comments
Date: Fri, 21 Mar 1997 15:43:07 -0500 (EST)
From: Andy Dougherty <doughera@fractal.phys.lafayette.edu>
Files: hints/hpux.sh
private-msgid: Pine.SOL.3.95q.970321153918.28770B-100000@fractal.lafayette.
Subject: VMS update
Date: Tue, 11 Mar 1997 22:00:55 -0500 (EST)
From: Charles Bailey <bailey@hmivax.humgen.upenn.edu>
Files: lib/ExtUtils/MM_VMS.pm lib/Test/Harness.pm t/op/taint.t utils/perlbug.PL vms/descrip.mms
Msg-ID: 1997Mar11.220056.1873182@hmivax.humgen.upenn.edu
(applied based on p5p patch as commit 2b5725676da60b49978f38b85bb7f8ee20b4cb55)
Subject: vmsish.t and related patches
Date: Fri, 21 Mar 1997 01:32:47 -0500 (EST)
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Files: MANIFEST perl.h vms/descrip.mms vms/ext/vmsish.t vms/vms.c
private-msgid: 01IGQW3IP1KK005VFB@hmivax.humgen.upenn.edu
Subject: Win32 update (four patches)
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Files: MANIFEST README.win32 lib/AutoSplit.pm lib/Cwd.pm lib/ExtUtils/Command.pm lib/ExtUtils/Install.pm lib/ExtUtils/MM_OS2.pm lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MM_Win32.pm lib/ExtUtils/MakeMaker.pm lib/ExtUtils/Mksymlists.pm lib/File/Basename.pm lib/File/Path.pm mg.c t/comp/cpp.t t/comp/script.t t/harness t/io/argv.t t/io/dup.t t/io/fs.t t/io/inplace.t t/lib/filehand.t t/lib/io_dup.t t/lib/io_sel.t t/lib/io_taint.t t/op/closure.t t/op/exec.t t/op/glob.t t/op/goto.t t/op/magic.t t/op/misc.t t/op/rand.t t/op/split.t t/op/stat.t t/op/sysio.t t/op/taint.t t/pragma/strict.t t/pragma/subs.t t/pragma/warning.t util.c win32/*
DOCUMENTATION
Subject: perlfaq.pod
Date: Mon, 17 Mar 1997 16:01:40 -0700
From: Tom Christiansen <tchrist@jhereg.perl.com>
Files: MANIFEST pod/Makefile pod/buildtoc pod/perl.pod pod/perlfaq*.pod pod/roffitall
private-msgid: 199703172301.QAA12566@jhereg.perl.com
Subject: *.pod changes based on the FAQ
Date: Mon, 17 Mar 1997 09:50:14 -0700 (MST)
From: Nat Torkington <gnat@frii.com>
Files: pod/perldata.pod pod/perlfunc.pod pod/perlipc.pod pod/perlop.pod pod/perlre.pod pod/perlrun.pod pod/perlsec.pod pod/perlvar.pod
Msg-ID: 199703171650.JAA02655@elara.frii.com
(applied based on p5p patch as commit 3c10ad8e31f7d77e71c048b1746912f41cb540f0)
Subject: Document that $. is not reset on implicit open
From: Chip Salzenberg <chip@perl.com>
Files: pod/perldelta.pod
Subject: Re: Embedding success with _93
Date: Tue, 11 Mar 1997 17:55:05 -0500
From: Doug MacEachern <dougm@opengroup.org>
Files: pod/perldelta.pod
Msg-ID: 199703112255.RAA22775@postman.osf.org
(applied based on p5p patch as commit 63a6ff3a1dc8d86edb4d8a7ec1548205e32a7114)
Subject: Patch to document illegal characters
Date: Fri, 14 Mar 1997 09:08:10 -0800 (PST)
From: Tom Phoenix <rootbeer@teleport.com>
Files: pod/perldiag.pod pod/perltrap.pod
private-msgid: Pine.GSO.3.96.970314090558.15346J-100000@kelly.teleport.com
Subject: Document trap with //o and closures
Date: Mon, 10 Mar 1997 18:08:08 -0500 (EST)
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Files: pod/perltrap.pod
Msg-ID: 01IGCHWRNSEU00661G@hmivax.humgen.upenn.edu
(applied based on p5p patch as commit a54cb1465fdb400848f23705a6f130bb5c34ab70)
Subject: Illegal character in input
Date: Mon, 10 Mar 1997 15:21:21 -0800 (PST)
From: Tom Phoenix <rootbeer@teleport.com>
Files: pod/perldiag.pod
private-msgid: Pine.GSO.3.95q.970310151512.22489a-100000@kelly.teleport.com
Subject: Patch for docs Re: Lost backslash
Date: Wed, 19 Mar 1997 07:28:57 -0800 (PST)
From: Tom Phoenix <rootbeer@teleport.com>
Files: pod/perlop.pod
private-msgid: Pine.GSO.3.96.970319071438.24834G-100000@kelly.teleport.com
Subject: XSUB's doc fix
Date: Mon, 10 Mar 1997 11:42:06 -0500
From: Roderick Schertler <roderick@argon.org>
Files: pod/perlcall.pod pod/perlguts.pod pod/perlxstut.pod
Msg-ID: 28804.858012126@eeyore.ibcinc.com
(applied based on p5p patch as commit 5f43237038ea7a4151d3bf65aeeecd56ceb78a6a)
Subject: Document return from do FILE
Date: Tue, 18 Mar 1997 14:50:10 +0000
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Files: pod/perlfunc.pod
Msg-ID: E0w70DK-0001yJ-00@ursa.cus.cam.ac.uk
(applied based on p5p patch as commit ba8d5fb439878113de8abc9b52d2af237d30fb3c)
Subject: Document $^M in perlvar
Date: Thu, 20 Mar 97 21:08:33 GMT
From: Robin Barker <rmb1@cise.npl.co.uk>
Files: pod/perlvar.pod
private-msgid: 6153.9703202108@tempest.cise.npl.co.uk
Subject: typos in pods of 5.003_93
Date: 19 Mar 1997 10:39:38 -0600
From: Jim Meyering <meyering@asic.sc.ti.com>
Files: pod/perlfunc.pod pod/perlguts.pod pod/perlre.pod pod/perltoot.pod pod/perlxs.pod
Msg-ID: wpgendbzvhx.fsf@asic.sc.ti.com
(applied based on p5p patch as commit 76a9873e006cf8f48f57062b2a0dd40b5ed45a95)
Subject: Re: Updates to pod punctuations
Date: Fri, 14 Mar 1997 17:00:12 -0500
From: Larry W. Virden <lvirden@cas.org>
Files: pod/*.pod
private-msgid: 9703141700.AA22911@cas.org
Subject: clarify example in perlfunc
Date: Thu, 20 Mar 1997 19:46:01 +0200 (EET)
From: Jarkko Hietaniemi <jhi@iki.fi>
Files: pod/perlfunc.pod
private-msgid: 199703201746.TAA25195@alpha.hut.fi
Subject: Regularize headings in DB_File documentation
From: Chip Salzenberg <chip@perl.com>
Files: ext/DB_File/DB_File.pm
LIBRARY AND EXTENSIONS
Subject: New module: autouse.pm
Date: Thu, 20 Mar 1997 19:34:30 -0500 (EST)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: MANIFEST lib/autouse.pm
Msg-ID: 199703210034.TAA13469@monk.mps.ohio-state.edu
(applied based on p5p patch as commit 6757905eccb6dd0440ef65e8128a277a20f7d943)
Subject: Refresh DB_File to 1.12
Date: Wed, 12 Mar 97 15:51:14 GMT
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: ext/DB_File/DB_File.pm ext/DB_File/DB_File.xs
Msg-ID: 9703121551.AA07435@claudius.bfsec.bt.co.uk
(applied based on p5p patch as commit b3deed9189f963e9994815307931f9084f60d1d9)
Subject: In File::Path, some systems can't remove read-only files
From: Chip Salzenberg <chip@perl.com>
Files: lib/File/Path.pm
Subject: Fix bugs revealed by prototype warnings
From: Chip Salzenberg <chip@perl.com>
Files: ext/Opcode/Opcode.pm lib/ExtUtils/MakeMaker.pm lib/Getopt/Long.pm
Subject: Problems with SKIP in makemaker
Date: Thu, 20 Mar 1997 23:13:31 -0500 (EST)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: lib/ExtUtils/MM_Unix.pm
Msg-ID: 199703210413.XAA21601@monk.mps.ohio-state.edu
(applied based on p5p patch as commit 970322a2e8024294ada6e8d1a027cb98f1f48ee3)
Subject: In Exporter, don't C<require Carp> at file scope
From: Chip Salzenberg <chip@perl.com>
Files: lib/Exporter.pm
Subject: fix for Exporter's $SIG{__WARN__} handler
Date: Thu, 13 Mar 1997 18:40:51 -0500
From: Roderick Schertler <roderick@argon.org>
Files: lib/Exporter.pm
Msg-ID: 2282.858296451@eeyore.ibcinc.com
(applied based on p5p patch as commit 2768ea1aeef34f42d096f198fbe629c8374ca429)
Subject: Don't try to substr() refs in Carp
From: Chip Salzenberg <chip@perl.com>
Files: lib/Carp.pm
Subject: Re: NUL in die and other messages
Date: Fri, 21 Mar 1997 09:58:17 +0000
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Files: lib/Carp.pm
Msg-ID: E0w815V-0005xs-00@ursa.cus.cam.ac.uk
(applied based on p5p patch as commit 52a267c574cb66c4bc35601dcf148a1d7a3bc557)
OTHER CORE CHANGES
Subject: Guard against buffer overflow in yyerror() and related funcs
From: Chip Salzenberg <chip@perl.com>
Files: toke.c
Subject: For bin compat, rename calllist() and he_{,delay}free
From: Chip Salzenberg <chip@perl.com>
Files: global.sym hv.c op.c perl.c pod/perlguts.pod proto.h
Subject: Fix C<print> on tied default handle
From: Chip Salzenberg <chip@perl.com>
Files: pp_hot.c
Subject: Fix C<local($a, undef, $b) = (1,2,3)>
From: Chip Salzenberg <chip@perl.com>
Files: op.c
Subject: Improve diagnostic on C<@a++>, C<--%a>, @a =~ s/a/b/
From: Chip Salzenberg <chip@perl.com>
Files: pp.c pp_hot.c
Subject: Don't warn on C<$x{y} .= "z"> when %x is tied
From: Chip Salzenberg <chip@perl.com>
Files: pp_hot.c
Subject: Eliminate 'unreachable code' warnings
From: Chip Salzenberg <chip@perl.com>
Files: ext/POSIX/POSIX.xs mg.c pp_ctl.c toke.c
Subject: printf format corrections for -DDEBUGGING
Date: Wed, 19 Mar 1997 12:42:50 -0500
From: Roderick Schertler <roderick@argon.org>
Files: doop.c malloc.c op.c pp_ctl.c regexec.c sv.c x2p/str.c x2p/util.c
Msg-ID: 26592.858793370@eeyore.ibcinc.com
(applied based on p5p patch as commit e125f273e351a19a92b69d6244af55abbbf0a26d)
Subject: Warn about missing -DMULTIPLICITY if likely a problem
Date: Wed, 19 Mar 1997 18:45:53 -0500
From: Doug MacEachern <dougm@opengroup.org>
Files: perl.c
Msg-ID: 199703192345.SAA15070@postman.osf.org
(applied based on p5p patch as commit 71aeea1753924e6e19c2461e241e3f7d8a570e90)
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/cpp.t | 3 | ||||
-rwxr-xr-x | t/comp/script.t | 7 | ||||
-rwxr-xr-x | t/harness | 2 | ||||
-rwxr-xr-x | t/io/argv.t | 24 | ||||
-rwxr-xr-x | t/io/dup.t | 13 | ||||
-rwxr-xr-x | t/io/fs.t | 8 | ||||
-rwxr-xr-x | t/io/inplace.t | 15 | ||||
-rwxr-xr-x | t/lib/filehand.t | 2 | ||||
-rwxr-xr-x | t/lib/io_dup.t | 13 | ||||
-rwxr-xr-x | t/lib/io_sel.t | 8 | ||||
-rwxr-xr-x | t/lib/io_taint.t | 2 | ||||
-rwxr-xr-x | t/op/closure.t | 8 | ||||
-rwxr-xr-x | t/op/exec.t | 7 | ||||
-rwxr-xr-x | t/op/glob.t | 7 | ||||
-rwxr-xr-x | t/op/goto.t | 3 | ||||
-rwxr-xr-x | t/op/magic.t | 73 | ||||
-rwxr-xr-x | t/op/misc.t | 13 | ||||
-rwxr-xr-x | t/op/rand.t | 10 | ||||
-rwxr-xr-x | t/op/split.t | 3 | ||||
-rwxr-xr-x | t/op/stat.t | 40 | ||||
-rwxr-xr-x | t/op/sysio.t | 2 | ||||
-rwxr-xr-x | t/op/taint.t | 10 | ||||
-rwxr-xr-x | t/pragma/strict.t | 3 | ||||
-rwxr-xr-x | t/pragma/subs.t | 5 | ||||
-rwxr-xr-x | t/pragma/warning.t | 3 |
25 files changed, 197 insertions, 87 deletions
diff --git a/t/comp/cpp.t b/t/comp/cpp.t index 00a9e6806a..86e7359524 100755 --- a/t/comp/cpp.t +++ b/t/comp/cpp.t @@ -8,7 +8,8 @@ BEGIN { } use Config; -if ( ($Config{'cppstdin'} =~ /\bcppstdin\b/) and +if ( $^O eq 'MSWin32' or + ($Config{'cppstdin'} =~ /\bcppstdin\b/) and ( ! -x $Config{'binexp'} . "/cppstdin") ) { print "1..0\n"; exit; # Cannot test till after install, alas. diff --git a/t/comp/script.t b/t/comp/script.t index f37e46bb66..d0c12e9552 100755 --- a/t/comp/script.t +++ b/t/comp/script.t @@ -4,7 +4,8 @@ print "1..3\n"; -$x = `./perl -e 'print "ok\n";'`; +$PERL = ($^O eq 'MSWin32') ? '.\perl' : './perl'; +$x = `$PERL -le "print 'ok';"`; if ($x =~ /DCL-W-NOCOMD/) { $x = `\$ mcr sys\$disk:[]perl. -e "print ""ok\n""";`; } if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";} @@ -13,12 +14,12 @@ open(try,">Comp.script") || (die "Can't open temp file."); print try 'print "ok\n";'; print try "\n"; close try; -$x = `./perl Comp.script`; +$x = `$PERL Comp.script`; if ($x =~ /DCL-W-NOCOMD/) { $x = `\$ mcr sys\$disk:[]perl. Comp.script`; } if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";} -$x = `./perl <Comp.script`; +$x = `$PERL <Comp.script`; if ($x =~ /DCL-W-NOCOMD/) { $x = `\$ mcr sys\$disk:[]perl. <Comp.script`; } if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";} @@ -15,5 +15,5 @@ $Test::Harness::switches = ""; # Too much noise otherwise $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v'; @tests = @ARGV; -@tests = <*/*.t> unless @tests; +@tests = <base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t lib/*.t> unless @tests; Test::Harness::runtests @tests; diff --git a/t/io/argv.t b/t/io/argv.t index 02cdc27536..d99865e142 100755 --- a/t/io/argv.t +++ b/t/io/argv.t @@ -8,16 +8,28 @@ open(try, '>Io.argv.tmp') || (die "Can't open temp file."); print try "a line\n"; close try; -$x = `./perl -e 'while (<>) {print \$.,\$_;}' Io.argv.tmp Io.argv.tmp`; - +if ($^O eq 'MSWin32') { + $x = `.\\perl -e "while (<>) {print \$.,\$_;}" Io.argv.tmp Io.argv.tmp`; +} +else { + $x = `./perl -e 'while (<>) {print \$.,\$_;}' Io.argv.tmp Io.argv.tmp`; +} if ($x eq "1a line\n2a line\n") {print "ok 1\n";} else {print "not ok 1\n";} -$x = `echo foo|./perl -e 'while (<>) {print $_;}' Io.argv.tmp -`; - +if ($^O eq 'MSWin32') { + $x = `.\\perl -le "print 'foo'" | .\\perl -e "while (<>) {print \$_;}" Io.argv.tmp -`; +} +else { + $x = `echo foo|./perl -e 'while (<>) {print $_;}' Io.argv.tmp -`; +} if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";} -$x = `echo foo|./perl -e 'while (<>) {print $_;}'`; - +if ($^O eq 'MSWin32') { + $x = `.\\perl -le "print 'foo'" |.\\perl -e "while (<>) {print \$_;}"`; +} +else { + $x = `echo foo|./perl -e 'while (<>) {print $_;}'`; +} if ($x eq "foo\n") {print "ok 3\n";} else {print "not ok 3 :$x:\n";} @ARGV = ('Io.argv.tmp', 'Io.argv.tmp', '/dev/null', 'Io.argv.tmp'); diff --git a/t/io/dup.t b/t/io/dup.t index 901642d8f6..f312671e56 100755 --- a/t/io/dup.t +++ b/t/io/dup.t @@ -17,8 +17,14 @@ select(STDOUT); $| = 1; print STDOUT "ok 2\n"; print STDERR "ok 3\n"; -system 'echo ok 4'; -system 'echo ok 5 1>&2'; +if ($^O eq 'MSWin32') { + print `echo ok 4`; + print `echo ok 5 1>&2`; # does this work? +} +else { + system 'echo ok 4'; + system 'echo ok 5 1>&2'; +} close(STDOUT); close(STDERR); @@ -26,7 +32,8 @@ close(STDERR); open(STDOUT,">&dupout"); open(STDERR,">&duperr"); -system 'cat Io.dup'; +if ($^O eq 'MSWin32') { print `type Io.dup` } +else { system 'cat Io.dup' } unlink 'Io.dup'; print STDOUT "ok 6\n"; @@ -11,10 +11,11 @@ use Config; print "1..26\n"; -$wd = `pwd`; +$wd = (($^O eq 'MSWin32') ? `cd` : `pwd`); chop($wd); -`rm -f tmp 2>/dev/null; mkdir tmp 2>/dev/null`; +if ($^O eq 'MSWin32') { `del tmp`; `mkdir tmp`; } +else { `rm -f tmp 2>/dev/null; mkdir tmp 2>/dev/null`; } chdir './tmp'; `/bin/rm -rf a b c x` if -x '/bin/rm'; @@ -87,7 +88,8 @@ chdir $wd || die "Can't cd back to $wd"; rmdir 'tmp'; unlink 'c'; -if (`ls -l perl 2>/dev/null` =~ /^l.*->/) { # we have symbolic links +if ($^O ne 'MSWin32' and `ls -l perl 2>/dev/null` =~ /^l.*->/) { + # we have symbolic links if (symlink("TEST","c")) {print "ok 21\n";} else {print "not ok 21\n";} $foo = `grep perl c`; if ($foo) {print "ok 22\n";} else {print "not ok 22\n";} diff --git a/t/io/inplace.t b/t/io/inplace.t index 477add1942..2652c8bebe 100755 --- a/t/io/inplace.t +++ b/t/io/inplace.t @@ -7,7 +7,16 @@ $^I = '.bak'; print "1..2\n"; @ARGV = ('.a','.b','.c'); -`echo foo | tee .a .b .c`; +if ($^O eq 'MSWin32') { + $CAT = '.\perl -e "print<>"'; + `.\\perl -le "print 'foo'" > .a`; + `.\\perl -le "print 'foo'" > .b`; + `.\\perl -le "print 'foo'" > .c`; +} +else { + $CAT = 'cat'; + `echo foo | tee .a .b .c`; +} while (<>) { s/foo/bar/; } @@ -15,7 +24,7 @@ continue { print; } -if (`cat .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";} -if (`cat .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";} +if (`$CAT .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";} +if (`$CAT .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";} unlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak'; diff --git a/t/lib/filehand.t b/t/lib/filehand.t index 20b2ee0bb0..c23a7e0475 100755 --- a/t/lib/filehand.t +++ b/t/lib/filehand.t @@ -66,7 +66,7 @@ print "ok 10\n"; ($rd,$wr) = FileHandle::pipe; -if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos') { +if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'MSWin32') { $wr->autoflush; $wr->printf("ok %d\n",11); print $rd->getline; diff --git a/t/lib/io_dup.t b/t/lib/io_dup.t index f5d4544490..6b0caf14fa 100755 --- a/t/lib/io_dup.t +++ b/t/lib/io_dup.t @@ -39,8 +39,14 @@ $stderr->fdopen($stdout,"w"); print $stdout "ok 2\n"; print $stderr "ok 3\n"; -system 'echo ok 4'; -system 'echo ok 5 1>&2'; +if ($^O eq 'MSWin32') { + print `echo ok 4`; + print `echo ok 5 1>&2`; # does this *really* work? +} +else { + system 'echo ok 4'; + system 'echo ok 5 1>&2'; +} $stderr->close; $stdout->close; @@ -48,7 +54,8 @@ $stdout->close; $stdout->fdopen($dupout,"w"); $stderr->fdopen($duperr,"w"); -system 'cat Io.dup'; +if ($^O eq 'MSWin32') { print `type Io.dup` } +else { system 'cat Io.dup' } unlink 'Io.dup'; print STDOUT "ok 6\n"; diff --git a/t/lib/io_sel.t b/t/lib/io_sel.t index 44d9757093..b9c1097404 100755 --- a/t/lib/io_sel.t +++ b/t/lib/io_sel.t @@ -49,6 +49,13 @@ $sel->remove([\*STDOUT, 5]); print "not " unless $sel->count == 0 && !defined($sel->bits); print "ok 9\n"; +if ($^O eq 'MSWin32') { # 4-arg select is only valid on sockets + print "# skipping tests 10..15\n"; + for (10 .. 15) { print "ok $_\n" } + $sel->add(\*STDOUT); # update + goto POST_SOCKET; +} + @a = $sel->can_read(); # should return imediately print "not " unless @a == 0; print "ok 10\n"; @@ -77,6 +84,7 @@ print "ok 14\n"; $fd = $w->[0]; print $fd "ok 15\n"; +POST_SOCKET: # Test new exists() method $sel->exists(\*STDIN) and print "not "; print "ok 16\n"; diff --git a/t/lib/io_taint.t b/t/lib/io_taint.t index 698db45c72..0ef2cfd63f 100755 --- a/t/lib/io_taint.t +++ b/t/lib/io_taint.t @@ -29,7 +29,7 @@ $x->close; $x = new IO::File "< ./__taint__$$" || die("Cannot open ./__taint__$$\n"); chop($unsafe = <$x>); eval { kill 0 * $unsafe }; -print "not " if ($@ !~ /^Insecure/o); +print "not " if $^O ne 'MSWin32' and ($@ !~ /^Insecure/o); print "ok 1\n"; $x->close; diff --git a/t/op/closure.t b/t/op/closure.t index 7af3abb291..1220998b6b 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -377,7 +377,7 @@ END $test++; } - if ($Config{d_fork} and $^O ne 'VMS') { + if ($Config{d_fork} and $^O ne 'VMS' and $^O ne 'MSWin32') { # Fork off a new perl to run the tests. # (This is so we can catch spurious warnings.) $| = 1; print ""; $| = 0; # flush output before forking @@ -411,9 +411,11 @@ END my $errfile = "terr$$"; $errfile++ while -e $errfile; my @tmpfiles = ($cmdfile, $errfile); open CMD, ">$cmdfile"; print CMD $code; close CMD; - my $cmd = ($^O eq 'VMS') ? "MCR $^X" : "./perl"; + my $cmd = (($^O eq 'VMS') ? "MCR $^X" + : ($^O eq 'MSWin32') ? '.\perl' + : './perl'); $cmd .= " -w $cmdfile 2>$errfile"; - if ($^O eq 'VMS') { + if ($^O eq 'VMS' or $^O eq 'MSWin32') { # Use pipe instead of system so we don't inherit STD* from # this process, and then foul our pipe back to parent by # redirecting output in the child. diff --git a/t/op/exec.t b/t/op/exec.t index 1103a1a464..7dfcd6177f 100755 --- a/t/op/exec.t +++ b/t/op/exec.t @@ -3,6 +3,13 @@ # $RCSfile: exec.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:49 $ $| = 1; # flush stdout + +if ($^O eq 'MSWin32') { + print "# exec is unsupported on Win32\n"; + print "1..0\n"; + exit(0); +} + print "1..8\n"; print "not ok 1\n" if system "echo ok \\1"; # shell interpreted diff --git a/t/op/glob.t b/t/op/glob.t index cc60a17a72..dd95e980d5 100755 --- a/t/op/glob.t +++ b/t/op/glob.t @@ -7,7 +7,12 @@ print "1..6\n"; @oops = @ops = <op/*>; map { $files{$_}++ } <op/*>; -map { delete $files{$_} } split /[\s\n]/, `echo op/*`; +if ($^O eq 'MSWin32') { + map { delete $files{"op/$_"} } split /[\s\n]/, `cmd /c "dir /b /l op"`; +} +else { + map { delete $files{$_} } split /[\s\n]/, `echo op/*`; +} if (keys %files) { print "not ok 1\t(",join(' ', sort keys %files),"\n"; } else { print "ok 1\n"; } diff --git a/t/op/goto.t b/t/op/goto.t index 087331907e..1b34acda39 100755 --- a/t/op/goto.t +++ b/t/op/goto.t @@ -31,7 +31,8 @@ label4: print "#2\t:$foo: == 4\n"; if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";} -$x = `./perl -e 'goto foo;' 2>&1`; +$PERL = ($^O eq 'MSWin32') ? '.\perl' : './perl'; +$x = `$PERL -e "goto foo;" 2>&1`; if ($x =~ /DCL-W-NOCOMD/) { $x = `\$ mcr sys\$disk:[]perl. -e "goto foo;"`; } if ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";} diff --git a/t/op/magic.t b/t/op/magic.t index 70f2bec2c3..fa19716c14 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -19,10 +19,14 @@ sub ok { } } +$Is_MSWin32 = ($^O eq 'MSWin32'); +$PERL = ($Is_MSWin32 ? '.\perl' : './perl'); + print "1..28\n"; eval '$ENV{"foo"} = "hi there";'; # check that ENV is inited inside eval -ok 1, `echo \$foo` eq "hi there\n"; +if ($Is_MSWin32) { ok 1, `set foo` eq "foo=hi there\n"; } +else { ok 1, `echo \$foo` eq "hi there\n"; } unlink 'ajslkdfpqjsjfk'; $! = 0; @@ -30,10 +34,14 @@ open(FOO,'ajslkdfpqjsjfk'); ok 2, $!, $!; close FOO; # just mention it, squelch used-only-once -# the next tests are embedded inside system simply because sh spits out -# a newline onto stderr when a child process kills itself with SIGINT. - -system './perl', '-e', <<'END'; +if ($Is_MSWin32) { + ok 3,1; + ok 4,1; +} +else { + # the next tests are embedded inside system simply because sh spits out + # a newline onto stderr when a child process kills itself with SIGINT. + system './perl', '-e', <<'END'; $| = 1; # command buffering @@ -51,8 +59,10 @@ system './perl', '-e', <<'END'; } END +} -@val1 = @ENV{keys(%ENV)}; # can we slice ENV? +# can we slice ENV? +@val1 = @ENV{keys(%ENV)}; @val2 = values(%ENV); ok 5, join(':',@val1) eq join(':',@val2); ok 6, @val1 > 1; @@ -84,9 +94,9 @@ ok 13, (keys %h)[0] eq "foo\034bar", (keys %h)[0]; } # $?, $@, $$ -system 'true'; +system "$PERL -e 'exit(0)'"; ok 15, $? == 0, $?; -system 'false'; +system "$PERL -e 'exit(1)'"; ok 16, $? != 0, $?; eval { die "foo\n" }; @@ -95,33 +105,38 @@ ok 17, $@ eq "foo\n", $@; ok 18, $$ > 0, $$; # $^X and $0 -if ($^O eq 'qnx' || $^O eq 'amigaos') { - chomp($wd = `pwd`); +if ($Is_MSWin32) { + for (19 .. 25) { ok $_, 1 } } else { - $wd = '.'; -} -$script = "$wd/show-shebang"; -$s1 = $s2 = "\$^X is $wd/perl, \$0 is $script\n"; -if ($^O eq 'os2') { - # Started by ksh, which adds suffixes '.exe' and '.' to perl and script - $s2 = "\$^X is $wd/perl.exe, \$0 is $script.\n"; -} -ok 19, open(SCRIPT, ">$script"), $!; -ok 20, print(SCRIPT <<EOB . <<'EOF'), $!; + if ($^O eq 'qnx' || $^O eq 'amigaos') { + chomp($wd = `pwd`); + } + else { + $wd = '.'; + } + $script = "$wd/show-shebang"; + $s1 = $s2 = "\$^X is $wd/perl, \$0 is $script\n"; + if ($^O eq 'os2') { + # Started by ksh, which adds suffixes '.exe' and '.' to perl and script + $s2 = "\$^X is $wd/perl.exe, \$0 is $script.\n"; + } + ok 19, open(SCRIPT, ">$script"), $!; + ok 20, print(SCRIPT <<EOB . <<'EOF'), $!; #!$wd/perl EOB print "\$^X is $^X, \$0 is $0\n"; EOF -ok 21, close(SCRIPT), $!; -ok 22, chmod(0755, $script), $!; -$_ = `$script`; -s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl -s{is perl}{is $wd/perl}; # for systems where $^X is only a basename -ok 23, $_ eq $s2, ":$_:!=:$s2:"; -$_ = `$wd/perl $script`; -ok 24, $_ eq $s1, ":$_:!=:$s1: after `$wd/perl $script`"; -ok 25, unlink($script), $!; + ok 21, close(SCRIPT), $!; + ok 22, chmod(0755, $script), $!; + $_ = `$script`; + s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl + s{is perl}{is $wd/perl}; # for systems where $^X is only a basename + ok 23, $_ eq $s2, ":$_:!=:$s2:"; + $_ = `$wd/perl $script`; + ok 24, $_ eq $s1, ":$_:!=:$s1: after `$wd/perl $script`"; + ok 25, unlink($script), $!; +} # $], $^O, $^T ok 26, $] >= 5.00319, $]; diff --git a/t/op/misc.t b/t/op/misc.t index 0f251ea354..02d32bd5c5 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -14,17 +14,24 @@ $tmpfile = "misctmp000"; 1 while -f ++$tmpfile; END { unlink $tmpfile if $tmpfile; } +$CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : 'cat'); + for (@prgs){ my $switch; if (s/^\s*-\w+//){ $switch = $&; } my($prog,$expected) = split(/\nEXPECT\n/, $_); - open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1"; + if ($^O eq 'MSWin32') { + open TEST, "| .\\perl -I../lib $switch >$tmpfile 2>&1"; + } + else { + open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1"; + } print TEST $prog, "\n"; close TEST; $status = $?; - $results = `cat $tmpfile`; + $results = `$CAT $tmpfile`; $results =~ s/\n+$//; $expected =~ s/\n+$//; if ( $results ne $expected){ @@ -74,7 +81,7 @@ EXPECT ######## eval {sub bar {print "In bar";}} ######## -system "./perl -ne 'print if eof' /dev/null" +system './perl -ne "print if eof" /dev/null' ######## chop($file = <>); ######## diff --git a/t/op/rand.t b/t/op/rand.t index 4eeca6b10c..23a09b7388 100755 --- a/t/op/rand.t +++ b/t/op/rand.t @@ -329,12 +329,10 @@ AUTOSRAND: my($pid, $first); for (1..5) { - if ($^O eq 'VMS') { - $pid = open PERL, qq[MCR $^X -e "print rand"|]; - } - else { - $pid = open PERL, "./perl -e 'print rand'|"; - } + my $PERL = (($^O eq 'VMS') ? "MCR $^X" + : ($^O eq 'MSWin32') ? '.\perl' + : './perl'); + $pid = open PERL, qq[$PERL -e "print rand"|]; die "Couldn't pipe from perl: $!" unless defined $pid; if (defined $first) { if ($first ne <PERL>) { diff --git a/t/op/split.t b/t/op/split.t index 4144bbb88f..90bb436550 100755 --- a/t/op/split.t +++ b/t/op/split.t @@ -47,7 +47,8 @@ $_ = join(':', split(/:/,'1:2:3:4:5:6:::', 999)); print $_ eq '1:2:3:4:5:6:::' ? "ok 10\n" : "not ok 10 $_\n"; # Does assignment to a list imply split to one more field than that? -$foo = `./perl -D1024 -e '(\$a,\$b) = split;' 2>&1`; +if ($^O eq 'MSWin32') { $foo = `.\\perl -D1024 -e "(\$a,\$b) = split;" 2>&1` } +else { $foo = `./perl -D1024 -e '(\$a,\$b) = split;' 2>&1` } if ($foo =~ /DCL-W-NOCOMD/) { $foo = `\$ mcr sys\$disk:[]perl. "-D1024" -e "(\$a,\$b) = split;"`; } diff --git a/t/op/stat.t b/t/op/stat.t index f0fd9a00b1..d7271522c2 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -13,14 +13,16 @@ use Config; print "1..56\n"; -chop($cwd = `pwd`); +$Is_MSWin32 = $^O eq 'MSWin32'; +chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`)); -$DEV = `ls -l /dev`; +$DEV = `ls -l /dev` unless $Is_MSWin32; unlink "Op.stat.tmp"; open(FOO, ">Op.stat.tmp"); -$junk = `ls Op.stat.tmp`; # hack to make Apollo update link count +# hack to make Apollo update link count: +$junk = `ls Op.stat.tmp` unless $Is_MSWin32; ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat(FOO); @@ -86,7 +88,7 @@ if (! -d 'Op.stat.tmp') {print "ok 22\n";} else {print "not ok 22\n";} if (-d '.') {print "ok 23\n";} else {print "not ok 23\n";} if (! -f '.') {print "ok 24\n";} else {print "not ok 24\n";} -if (`ls -l perl` =~ /^l.*->/) { +if (!$Is_MSWin32 and `ls -l perl` =~ /^l.*->/) { if (-l 'perl') {print "ok 25\n";} else {print "not ok 25\n";} } else { @@ -99,7 +101,9 @@ if (-e 'Op.stat.tmp') {print "ok 27\n";} else {print "not ok 27\n";} `rm -f Op.stat.tmp Op.stat.tmp2`; if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";} -if ($DEV !~ /\nc.* (\S+)\n/) +if ($Is_MSWin32) + {print "ok 29\n";} +elsif ($DEV !~ /\nc.* (\S+)\n/) {print "ok 29\n";} elsif (-c "/dev/$1") {print "ok 29\n";} @@ -107,7 +111,9 @@ else {print "not ok 29\n";} if (! -c '.') {print "ok 30\n";} else {print "not ok 30\n";} -if ($DEV !~ /\ns.* (\S+)\n/) +if ($Is_MSWin32) + {print "ok 31\n";} +elsif ($DEV !~ /\ns.* (\S+)\n/) {print "ok 31\n";} elsif (-S "/dev/$1") {print "ok 31\n";} @@ -115,7 +121,9 @@ else {print "not ok 31\n";} if (! -S '.') {print "ok 32\n";} else {print "not ok 32\n";} -if ($DEV !~ /\nb.* (\S+)\n/) +if ($Is_MSWin32) + {print "ok 33\n";} +elsif ($DEV !~ /\nb.* (\S+)\n/) {print "ok 33\n";} elsif (-b "/dev/$1") {print "ok 33\n";} @@ -123,7 +131,7 @@ else {print "not ok 33\n";} if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";} -if ($^O eq 'amigaos') {print "ok 35\n"; goto tty_test;} +if ($^O eq 'amigaos' or $Is_MSWin32) {print "ok 35\n"; goto tty_test;} $cnt = $uid = 0; @@ -147,12 +155,18 @@ else tty_test: -unless (open(tty,"/dev/tty")) { - print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n"; +if ($Is_MSWin32) { + print "ok 36\n"; + print "ok 37\n"; +} +else { + unless (open(tty,"/dev/tty")) { + print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n"; + } + if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";} + if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";} + close(tty); } -if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";} -if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";} -close(tty); if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";} open(null,"/dev/null"); if (! -t null || -e '/xenix' || -e '/MachTen') diff --git a/t/op/sysio.t b/t/op/sysio.t index 0f546b270f..ee274c1692 100755 --- a/t/op/sysio.t +++ b/t/op/sysio.t @@ -6,7 +6,7 @@ chdir('op') || die "sysio.t: cannot look for myself: $!"; open(I, 'sysio.t') || die "sysio.t: cannot find myself: $!"; -$reopen = ($^O eq 'VMS' || $^O eq 'os2'); +$reopen = ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'MSWin32'); $x = 'abc'; diff --git a/t/op/taint.t b/t/op/taint.t index 56765fb71d..66e26d82c9 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -16,14 +16,18 @@ use strict; use Config; my $Is_VMS = $^O eq 'VMS'; -my $Invoke_Perl = $Is_VMS ? 'MCR Sys$Disk:[]Perl.' : './perl'; +my $Is_MSWin32 = $^O eq 'MSWin32'; +my $Invoke_Perl = $Is_VMS ? 'MCR Sys$Disk:[]Perl.' : + $Is_MSWin32 ? '.\perl' : './perl'; if ($Is_VMS) { + my ($olddcl) = $ENV{'DCL$PATH'} =~ /^(.*)$/; + my ($oldifs) = $ENV{IFS} =~ /^(.*)$/; eval <<EndOfCleanup; END { \$ENV{PATH} = ''; warn "# Note: logical name 'PATH' may have been deleted\n"; - \$ENV{IFS} = "$ENV{IFS}"; - \$ENV{'DCL\$PATH'} = "$ENV{'DCL$PATH'}"; + \$ENV{IFS} = \$oldifs; + \$ENV{'DCL\$PATH'} = \$olddcl; } EndOfCleanup } diff --git a/t/pragma/strict.t b/t/pragma/strict.t index 75856971fa..fc3282089f 100755 --- a/t/pragma/strict.t +++ b/t/pragma/strict.t @@ -9,6 +9,7 @@ BEGIN { $| = 1; my $Is_VMS = $^O eq 'VMS'; +my $Is_MSWin32 = $^O eq 'MSWin32'; my $tmpfile = "tmp0000"; my $i = 0 ; 1 while -f ++$tmpfile; @@ -66,6 +67,8 @@ for (@prgs){ close TEST; my $results = $Is_VMS ? `MCR $^X $switch $tmpfile` : + $Is_MSWin32 ? + `.\\perl -I../lib $switch $tmpfile 2>&1` : `sh -c './perl $switch $tmpfile' 2>&1`; my $status = $?; $results =~ s/\n+$//; diff --git a/t/pragma/subs.t b/t/pragma/subs.t index 33180066e0..056c4bd7cf 100755 --- a/t/pragma/subs.t +++ b/t/pragma/subs.t @@ -12,6 +12,7 @@ my @prgs = split "\n########\n", <DATA>; print "1..", scalar @prgs, "\n"; my $Is_VMS = $^O eq 'VMS'; +my $Is_MSWin32 = $^O eq 'MSWin32'; my $tmpfile = "tmp0000"; my $i = 0 ; 1 while -f ++$tmpfile; @@ -46,6 +47,8 @@ for (@prgs){ close TEST; my $results = $Is_VMS ? `MCR $^X $switch $tmpfile` : + $Is_MSWin32 ? + `.\\perl -I../lib $switch $tmpfile 2>&1` : `sh -c './perl $switch $tmpfile' 2>&1`; my $status = $?; $results =~ s/\n+$//; @@ -89,7 +92,7 @@ EXPECT Number found where operator expected at - line 3, near "Fred 1" (Do you need to predeclare Fred?) syntax error at - line 3, near "Fred 1" -Execution of - aborted due to compilation errors. +BEGIN not safe after errors--compilation aborted at - line 4. ######## # AOK diff --git a/t/pragma/warning.t b/t/pragma/warning.t index 3bb70e3ce8..fa0301ea6a 100755 --- a/t/pragma/warning.t +++ b/t/pragma/warning.t @@ -9,6 +9,7 @@ BEGIN { $| = 1; my $Is_VMS = $^O eq 'VMS'; +my $Is_MSWin32 = $^O eq 'MSWin32'; my $tmpfile = "tmp0000"; my $i = 0 ; 1 while -f ++$tmpfile; @@ -67,6 +68,8 @@ for (@prgs){ close TEST; my $results = $Is_VMS ? `MCR $^X $switch $tmpfile` : + $Is_MSWin32 ? + `.\\perl -I../lib $switch $tmpfile 2>&1` : `sh -c './perl $switch $tmpfile' 2>&1`; my $status = $?; $results =~ s/\n+$//; |