X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fpod%2Ftestpchk.pl;h=8aa10b94f87c03a2a1583b9db3c039ac5e39541c;hb=9811a09ccbe459f08959a12230024bdfb9a9977f;hp=640226bde7e9deb42c8c37b151c9b37b34ffdaf6;hpb=da9274502cf796d52a9875e4c9f650b53901ad73;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/pod/testpchk.pl b/t/pod/testpchk.pl index 640226b..8aa10b9 100644 --- a/t/pod/testpchk.pl +++ b/t/pod/testpchk.pl @@ -10,6 +10,7 @@ BEGIN { import TestCompare; my $PARENTDIR = dirname $THISDIR; push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR); + require VMS::Filespec if $^O eq 'VMS'; } use Pod::Checker; @@ -30,8 +31,15 @@ sub stripname( $ ) { } sub msgcmp( $ $ ) { + ## filter out platform-dependent aspects of error messages my ($line1, $line2) = @_; - return $line1 ne $line2; + for ($line1, $line2) { + ## remove filenames from error messages to avoid any + ## filepath naming differences between OS platforms + s/(at line \S+ in file) .*\W(\w+\.[tT])\s*$/$1 \L$2\E/; + s/.*\W(\w+\.[tT]) (has \d+ pod syntax error)/\L$1\E $2/; + } + return ($line1 ne $line2); } sub testpodcheck( @ ) { @@ -51,6 +59,11 @@ sub testpodcheck( @ ) { print "# Running podchecker for '$testname'...\n"; ## Compare the output against the expected result + if ($^O eq 'VMS') { + for ($infile, $outfile, $cmpfile) { + $_ = VMS::Filespec::unixify($_) unless ref; + } + } podchecker($infile, $outfile); if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) { $different = "$outfile is different from $cmpfile";