From: Michael G. Schwern Date: Fri, 23 Feb 2001 03:21:37 +0000 (-0500) Subject: fixing t/pod/find.t, running t/pod X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ac1de083da3f4d7b4dfcda5fc1ab646e9e13bd6;p=p5sagit%2Fp5-mst-13.2.git fixing t/pod/find.t, running t/pod Message-ID: <20010223032137.A26022@magnonel.guild.net> plus Charles Lane's fixes, plus tweaks. p4raw-id: //depot/perl@8921 --- diff --git a/MANIFEST b/MANIFEST index 4285eba..4eda166 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1669,6 +1669,7 @@ t/pod/special_seqs.xr Expected results for emptycmd.t t/pod/testcmp.pl Module to compare output against expected results t/pod/testp2pt.pl Module to test Pod::PlainText for a given file t/pod/testpchk.pl Module to test Pod::Checker for a given file +t/pod/testpods/lib/Pod/Stuff.pm Sample data for find.t t/pragma/constant.t See if compile-time constants work t/pragma/diagnostics.t See if diagnostics.pm works t/pragma/locale.t See if locale support works diff --git a/t/TEST b/t/TEST index 98d5fe3..bccf63b 100755 --- a/t/TEST +++ b/t/TEST @@ -27,7 +27,7 @@ $ENV{EMXSHELL} = 'sh'; # For OS/2 if ($#ARGV == -1) { @ARGV = split(/[ \n]/, - `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); + `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t pod/*.t`); } %infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); diff --git a/t/lib/glob-basic.t b/t/lib/glob-basic.t index 5094ff6..25edde3 100755 --- a/t/lib/glob-basic.t +++ b/t/lib/glob-basic.t @@ -102,9 +102,11 @@ print "ok 7\n"; GLOB_BRACE | GLOB_NOMAGIC | ($^O eq 'VMS' ? GLOB_NOCASE : 0) ); -# Working on t/TEST often causes this test to fail because it sees temp -# and RCS files. Filter them out, and .pm files too. -@a = grep !/(,v$|~$|\.pm$)/, @a; +# Working on t/TEST often causes this test to fail because it sees Emacs temp +# and RCS files. Filter them out, and .pm files too, and patch temp files. +@a = grep !/(,v$|~$|\.(pm|ori?g|rej)$)/, @a; + +print "# @a\n"; unless (@a == 3 and $a[0] eq ($^O eq 'VMS'? 'test.' : 'TEST') diff --git a/t/pod/find.t b/t/pod/find.t index f5d4c52..3a0b274 100644 --- a/t/pod/find.t +++ b/t/pod/find.t @@ -5,40 +5,56 @@ $| = 1; use Test; -BEGIN { plan tests => 4 } +BEGIN { + plan tests => 4; + use File::Spec; + if ($^O eq 'VMS') { + # This magick is needed to make the VMS I/O system to believe + # that there's life after eight directory levels (this makes + # it believe there's life until sixteen levels). The filesystem + # has no limitation as such. + $DEFAULT_DIR = $ENV{'DEFAULT'}; + my $here = $DEFAULT_DIR; + my ($dev,$dir) = File::Spec->splitpath($here); + $dev =~ s/:$//; + $dev = $ENV{$dev} if exists($ENV{$dev}); + $dev .= ':' if $dev !~ /:/; + $here = File::Spec->canonpath($dev.$dir); + $here =~ s/\]$/.]/; + system "define/nolog/job/trans=conceal temp_perl_base $here"; + chdir('temp_perl_base:[000000]'); + } +} + +END { + chdir($DEFAULT_DIR) if $^O eq 'VMS'; + system "deassign/job temp_perl_base"; +} use Pod::Find qw(pod_find pod_where); -use File::Spec; # load successful ok(1); require Cwd; -my $THISDIR = Cwd::cwd(); my $VERBOSE = 0; -my $lib_dir = File::Spec->catdir($THISDIR,'lib'); +my $lib_dir = File::Spec->catdir('pod', 'testpods', 'lib'); if ($^O eq 'VMS') { - $lib_dir = VMS::Filespec::unixify(File::Spec->catdir($THISDIR,'-','lib','pod')); + $lib_dir = VMS::Filespec::unixify(File::Spec->catdir('pod', 'testpods', 'lib')); $Qlib_dir = $lib_dir; $Qlib_dir =~ s#\/#::#g; } print "### searching $lib_dir\n"; -my %pods = pod_find("$lib_dir"); -my $result = join("\n### ", sort values %pods); -print "### found $result\n"; -my $compare = join(',', qw( - Pod::Checker - Pod::Find - Pod::InputObjects - Pod::ParseUtils - Pod::Parser - Pod::PlainText - Pod::Select - Pod::Usage +my %pods = pod_find($lib_dir); +my $result = join(',', sort values %pods); +my $compare = join(',', sort qw( + Pod::Stuff + Pod::Rhubarb + Like::And::Yeah )); if ($^O eq 'VMS') { $compare = lc($compare); - $result = join(',', sort grep(/pod::/, values %pods)); + $result = join(',', sort values %pods); my $undollared = $Qlib_dir; $undollared =~ s/\$/\\\$/g; $undollared =~ s/\-/\\\-/g; @@ -55,8 +71,6 @@ else { ok($result,$compare); } -# File::Find is located in this place since eons -# and on all platforms, hopefully print "### searching for File::Find\n"; $result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find') @@ -71,27 +85,19 @@ if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms ok($result,$compare); } else { - $compare = File::Spec->catfile($Config::Config{privlib},"File","Find.pm"); + $compare = File::Spec->catfile(File::Spec->updir, 'lib','File','Find.pm'); ok(_canon($result),_canon($compare)); } # Search for a documentation pod rather than a module -print "### searching for perlfunc.pod\n"; -$result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'perlfunc') - || 'undef - perlfunc.pod not found!'; +print "### searching for Stuff.pod\n"; +my $search = File::Spec->catdir('pod', 'testpods', 'lib', 'Pod'); +$result = pod_where({ -dirs => [$search], -verbose => $VERBOSE }, 'Stuff') + || 'undef - Stuff.pod not found!'; print "### found $result\n"; -if ($^O eq 'VMS') { # privlib is perl_root:[lib] unfortunately - $compare = "/lib/pod/perlfunc.pod"; - $result = VMS::Filespec::unixify($result); - $result =~ s/perl_root\///i; - $result =~ s/^\.\.//; # needed under `mms test` - ok($result,$compare); -} -else { - $compare = File::Spec->catfile($Config::Config{privlib},"perlfunc.pod"); - ok(_canon($result),_canon($compare)); -} +$compare = File::Spec->catfile('pod', 'testpods', 'lib', 'Pod' ,'Stuff.pod'); +ok(_canon($result),_canon($compare)); # make the path as generic as possible sub _canon diff --git a/t/pod/testpods/lib/Pod/Stuff.pm b/t/pod/testpods/lib/Pod/Stuff.pm new file mode 100644 index 0000000..d5c1120 --- /dev/null +++ b/t/pod/testpods/lib/Pod/Stuff.pm @@ -0,0 +1,20 @@ +=head1 NAME + +Pod::Stuff - dummy testing pod + +=head1 DESCRIPTION + +This isn't really anything, its just some dummy pod code. +And stuff. + +Lots of stuff. + +=head2 STUFF + +For all your stuff [tm] + +Stuffit + +Mmmm, stuffed pizza bread. + +=cut