diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rwxr-xr-x | installperl | 5 | ||||
-rw-r--r-- | pod/perldiag.pod | 2 | ||||
-rw-r--r-- | pp_ctl.c | 2 | ||||
-rwxr-xr-x | t/op/die.t | 26 | ||||
-rwxr-xr-x | t/op/ipcmsg.t | 38 |
6 files changed, 61 insertions, 13 deletions
@@ -828,6 +828,7 @@ t/op/cmp.t See if the various string and numeric compare work t/op/cond.t See if conditional expressions work t/op/defins.t See if auto-insert of defined() works t/op/delete.t See if delete works +t/op/die.t See if die works t/op/die_exit.t See if die and exit status interaction works t/op/do.t See if subroutines work t/op/each.t See if hash iterators work diff --git a/installperl b/installperl index a8bcd35b15..011c8be061 100755 --- a/installperl +++ b/installperl @@ -46,7 +46,10 @@ if ($Is_VMS) { @scripts = map { "$_.Com" } @scripts; } @pods = (<pod/*.pod>); -%archpms = (Config => 1, FileHandle => 1, overload => 1); +%archpms = ( + Config => 1, FileHandle => 1, overload => 1, + 'File/Basename' => 1, # uses m//t +); if ($^O eq 'dos') { push(@scripts,'djgpp/fixpmain'); diff --git a/pod/perldiag.pod b/pod/perldiag.pod index cd4c876261..d51551756a 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -670,7 +670,7 @@ but there is no function to autoload. Most probable causes are a misprint in a function/method name or a failure to C<AutoSplit> the file, say, by doing C<make install>. -=item Can't locate file '%s' in @INC +=item Can't locate %s in @INC (F) You said to do (or require, or use) a file that couldn't be found in any of the libraries mentioned in @INC. Perhaps you need to set the @@ -2463,7 +2463,7 @@ PP(pp_require) SvREFCNT_dec(namesv); if (!tryrsfp) { if (op->op_type == OP_REQUIRE) { - SV *msg = sv_2mortal(newSVpvf("Can't locate file '%s' in @INC", name)); + SV *msg = sv_2mortal(newSVpvf("Can't locate '%s' in @INC", name)); SV *dirmsgsv = NEWSV(0, 0); AV *ar = GvAVn(incgv); I32 i; diff --git a/t/op/die.t b/t/op/die.t new file mode 100755 index 0000000000..795d856564 --- /dev/null +++ b/t/op/die.t @@ -0,0 +1,26 @@ +#!./perl + +print "1..6\n"; + +$SIG{__DIE__} = sub { print ref($_[0]) ? ("ok ",$_[0]->[0]++,"\n") : @_ } ; + +$err = "ok 1\n"; +eval { + die $err; +}; + +print "not " unless $@ eq $err; +print "ok 2\n"; + +$x = [3]; +eval { die $x; }; + +print "not " unless $x->[0] == 4; +print "ok 4\n"; + +eval { + eval { + die [ 5 ]; + }; + die if $@; +}; diff --git a/t/op/ipcmsg.t b/t/op/ipcmsg.t index 98cf8bcaf6..ab2b0737e9 100755 --- a/t/op/ipcmsg.t +++ b/t/op/ipcmsg.t @@ -30,12 +30,15 @@ BEGIN { print "1..0\n"; exit; } + + use strict; + my @incpath = (split(/\s+/, $Config{usrinc}), split(/\s+/ ,$Config{locincpth})); my %done = (); my %define = (); sub process_file { - my($file) = @_; + my($file,$level) = @_; return unless defined $file; @@ -51,40 +54,55 @@ BEGIN { return if exists $done{$path}; $done{$path} = 1; - unless(defined $path) { + if(not defined $path and $level == 0) { warn "Cannot find '$file'"; return; } + local(*F); open(F,$path) or return; + $level = 1 unless defined $level; + my $indent = " " x $level; + print "#$indent open $path\n"; while(<F>) { s#/\*.*(\*/|$)##; - process_file($mm,$1) - if /^#\s*include\s*[<"]([^>"]+)[>"]/; + if ( /^#\s*include\s*[<"]([^>"]+)[>"]/ ) { + print "#${indent} include $1\n"; + process_file($1,$level+1); + print "#${indent} done include $1\n"; + print "#${indent} back in $path\n"; + } s/(?:\([^)]*\)\s*)//; - $define{$1} = $2 - if /^#\s*define\s+(\w+)\s+((0x)?\d+|\w+)/; + if ( /^#\s*define\s+(\w+)\s+(\w+)/ ) { + print "#${indent} define $1 $2\n"; + $define{$1} = $2; + } } close(F); + print "#$indent close $path\n"; } process_file("sys/sem.h"); process_file("sys/ipc.h"); process_file("sys/stat.h"); - foreach $d (@define) { + foreach my $d (@define) { while(defined($define{$d}) && $define{$d} !~ /^(0x)?\d+$/) { $define{$d} = exists $define{$define{$d}} ? $define{$define{$d}} : undef; } unless(defined $define{$d}) { - print "0..0\n"; + print "# $d undefined\n"; + print "1..0\n"; exit; - }; - ${ $d } = eval $define{$d}; + } + { + no strict 'refs'; + ${ $d } = eval $define{$d}; + } } } |