X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpod%2Ftestp2pt.pl;h=4d99f82a72e829d0d6689682d7ee702dd237cb5f;hb=d8f6a7325d6b2ec46e8cdc1ec4b5e1ad4a86abd0;hp=234a5271c489d0ca319b0eb1a5e4ae0bcb2b21a5;hpb=146174a91a192983720a158796dc066226ad0e55;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/pod/testp2pt.pl b/t/pod/testp2pt.pl index 234a527..4d99f82 100644 --- a/t/pod/testp2pt.pl +++ b/t/pod/testp2pt.pl @@ -32,6 +32,7 @@ BEGIN { require Pod::PlainText; @ISA = qw( Pod::PlainText ); } + require VMS::Filespec if $^O eq 'VMS'; } ## Hardcode settings for TERMCAP and COLUMNS so we can try to get @@ -41,14 +42,21 @@ BEGIN { sub catfile(@) { File::Spec->catfile(@_); } my $INSTDIR = abs_path(dirname $0); -$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'xtra'); +if ($^O eq 'VMS') { # clean up directory spec + $INSTDIR = VMS::Filespec::unixpath($INSTDIR); + $INSTDIR =~ s#/$##; + $INSTDIR =~ s#/000000/#/#; +} +# cut 't/pod' from path (cut 't:pod:' on Mac OS) $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod'); $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't'); + my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'), + catfile($INSTDIR, 'scripts'), catfile($INSTDIR, 'pod'), - catfile($INSTDIR, 't', 'pod'), - catfile($INSTDIR, 't', 'pod', 'xtra') + catfile($INSTDIR, 't', 'pod') ); +print "PODINCDIRS = ",join(', ',@PODINCDIRS),"\n"; ## Find the path to the file to =include sub findinclude { @@ -97,10 +105,14 @@ sub command { print $out_fh "###### end =include $incbase #####\n" if ($incdebug); } +sub begin_input { + $_[0]->{_INFILE} = VMS::Filespec::unixify($_[0]->{_INFILE}) if $^O eq 'VMS'; +} + sub podinc2plaintext( $ $ ) { my ($infile, $outfile) = @_; local $_; - my $text_parser = $MYPKG->new; + my $text_parser = $MYPKG->new(quotes => "`'"); $text_parser->parse_from_file($infile, $outfile); } @@ -146,7 +158,7 @@ sub testpodplaintext( @ ) { for $podfile (@testpods) { ($testname, $_) = fileparse($podfile); $testdir ||= $_; - $testname =~ s/\.t$//; + $testname =~ s/\..*$//; $cmpfile = $testdir . $testname . '.xr'; $outfile = $testdir . $testname . '.OUT';