2 # Author: Marek Rouchal <marek@saftsack.fs.uni-bayreuth.de>
12 # This magick is needed to make the VMS I/O system to believe
13 # that there's life after eight directory levels (this makes
14 # it believe there's life until sixteen levels). The filesystem
15 # has no limitation as such.
16 $DEFAULT_DIR = $ENV{'DEFAULT'};
17 my $here = $DEFAULT_DIR;
18 my ($dev,$dir) = File::Spec->splitpath($here);
20 $dev = $ENV{$dev} if exists($ENV{$dev});
21 $dev .= ':' if $dev !~ /:/;
22 $here = File::Spec->canonpath($dev.$dir);
24 system "define/nolog/job/trans=conceal temp_perl_base $here";
25 chdir('temp_perl_base:[000000]');
30 chdir($DEFAULT_DIR) if $^O eq 'VMS';
31 system "deassign/job temp_perl_base";
34 use Pod::Find qw(pod_find pod_where);
41 my $lib_dir = File::Spec->catdir('pod', 'testpods', 'lib');
43 $lib_dir = VMS::Filespec::unixify(File::Spec->catdir('pod', 'testpods', 'lib'));
45 $Qlib_dir =~ s#\/#::#g;
47 print "### searching $lib_dir\n";
48 my %pods = pod_find($lib_dir);
49 my $result = join(',', sort values %pods);
50 my $compare = join(',', sort qw(
56 $compare = lc($compare);
57 $result = join(',', sort values %pods);
58 my $undollared = $Qlib_dir;
59 $undollared =~ s/\$/\\\$/g;
60 $undollared =~ s/\-/\\\-/g;
61 $result =~ s/$undollared/pod::/g;
63 my @result = split(/,/,$result);
64 my @compare = split(/,/,$compare);
66 $count += grep {/$_/} @result;
68 ok($count/($#result+1)-1,$#compare);
75 print "### searching for File::Find\n";
76 $result = pod_where({ -inc => 1, -verbose => $VERBOSE }, 'File::Find')
77 || 'undef - pod not found!';
78 print "### found $result\n";
81 if ($^O eq 'VMS') { # privlib is perl_root:[lib] OK but not under mms
82 $compare = "lib.File]Find.pm";
83 $result =~ s/perl_root:\[\-?\.?//i;
84 $result =~ s/\[\-?\.?//i; # needed under `mms test`
88 $compare = File::Spec->catfile(File::Spec->updir, 'lib','File','Find.pm');
89 ok(_canon($result),_canon($compare));
92 # Search for a documentation pod rather than a module
93 print "### searching for Stuff.pod\n";
94 my $search = File::Spec->catdir('pod', 'testpods', 'lib', 'Pod');
95 $result = pod_where({ -dirs => [$search], -verbose => $VERBOSE }, 'Stuff')
96 || 'undef - Stuff.pod not found!';
97 print "### found $result\n";
99 $compare = File::Spec->catfile('pod', 'testpods', 'lib', 'Pod' ,'Stuff.pod');
100 ok(_canon($result),_canon($compare));
102 # make the path as generic as possible
106 $path = File::Spec->canonpath($path);
107 my @comp = File::Spec->splitpath($path);
108 my @dir = File::Spec->splitdir($comp[1]);
109 $comp[1] = File::Spec->catdir(@dir);
110 $path = File::Spec->catpath(@dir);
111 $path = uc($path) if File::Spec->case_tolerant;