diff options
-rw-r--r-- | ext/Pod-Html/t/crossref2.t | 4 | ||||
-rw-r--r-- | ext/Pod-Html/t/pod2html-lib.pl | 36 |
2 files changed, 23 insertions, 17 deletions
diff --git a/ext/Pod-Html/t/crossref2.t b/ext/Pod-Html/t/crossref2.t index b4e0f65503..3257928028 100644 --- a/ext/Pod-Html/t/crossref2.t +++ b/ext/Pod-Html/t/crossref2.t @@ -17,10 +17,10 @@ use Test::More tests => 1; SKIP: { my $output = make_test_dir(); skip "$output", 1 if $output; - + my $cwd = cwd(); - convert_n_test("crossref", "cross references", + convert_n_test("crossref", "cross references", "--podpath=t:testdir/test.lib", "--podroot=$cwd", "--htmldir=$cwd", diff --git a/ext/Pod-Html/t/pod2html-lib.pl b/ext/Pod-Html/t/pod2html-lib.pl index 1b2da25dea..c03f38af9b 100644 --- a/ext/Pod-Html/t/pod2html-lib.pl +++ b/ext/Pod-Html/t/pod2html-lib.pl @@ -67,21 +67,27 @@ sub convert_n_test { close $in; } - ok($expect eq $result, $testname) or do { - my $diff = '/bin/diff'; - -x $diff or $diff = '/usr/bin/diff'; - if (-x $diff) { - my $expectfile = "pod2html-lib.tmp"; - open my $tmpfile, ">", $expectfile or die $!; - print $tmpfile $expect; - close $tmpfile; - my $diffopt = $^O eq 'linux' ? 'u' : 'c'; - open my $diff, "diff -$diffopt $expectfile $outfile |" or die $!; - print "# $_" while <$diff>; - close $diff; - unlink $expectfile; - } - }; + my $diff = '/bin/diff'; + -x $diff or $diff = '/usr/bin/diff'; + if (-x $diff) { + ok($expect eq $result, $testname) or do { + my $expectfile = "pod2html-lib.tmp"; + open my $tmpfile, ">", $expectfile or die $!; + print $tmpfile $expect; + close $tmpfile; + my $diffopt = $^O eq 'linux' ? 'u' : 'c'; + open my $diff, "diff -$diffopt $expectfile $outfile |" or die $!; + print STDERR "# $_" while <$diff>; + close $diff; + unlink $expectfile; + }; + } else { + # This is fairly evil, but lets us get detailed failure modes on + # Win32, where we have the most trouble working and the least chance of + # having diff in /bin or /usr/bin! (Invoking diff in our tests is + # pretty evil, too, so...) -- rjbs, 2012-02-22 + is($expect, $result, $testname); + } # pod2html creates these 1 while unlink $outfile; |