diff options
Diffstat (limited to 'ext/Pod-Html')
-rw-r--r-- | ext/Pod-Html/t/crossref.pod | 12 | ||||
-rw-r--r-- | ext/Pod-Html/t/crossref.t | 37 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir1.pod | 2 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir1.t | 45 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir3.pod | 2 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir3.t | 43 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir5.pod | 2 | ||||
-rw-r--r-- | ext/Pod-Html/t/htmldir5.t | 31 | ||||
-rw-r--r-- | ext/Pod-Html/t/pod2html-lib.pl | 24 | ||||
-rw-r--r-- | ext/Pod-Html/testdir/perlpodspec-copy.pod (renamed from ext/Pod-Html/test.lib/perlpodspec-copy.pod) | 0 | ||||
-rw-r--r-- | ext/Pod-Html/testdir/perlvar-copy.pod (renamed from ext/Pod-Html/test.lib/perlvar-copy.pod) | 0 |
11 files changed, 132 insertions, 66 deletions
diff --git a/ext/Pod-Html/t/crossref.pod b/ext/Pod-Html/t/crossref.pod index fe908d5c5f..f6dddf1f58 100644 --- a/ext/Pod-Html/t/crossref.pod +++ b/ext/Pod-Html/t/crossref.pod @@ -12,17 +12,17 @@ L</"item1"> L</"non existant section"> -L<perlvar-copy> +L<var-copy> -L<perlvar-copy/$"> +L<var-copy/$"> -C<perlvar-copy> +C<var-copy> -C<perlvar-copy/$"> +C<var-copy/$"> -L<perlpodspec-copy/First:> +L<podspec-copy/First:> -C<perlpodspec-copy/First:> +C<podspec-copy/First:> L<notperldoc> diff --git a/ext/Pod-Html/t/crossref.t b/ext/Pod-Html/t/crossref.t index 0a3ba63fa6..ec178e0024 100644 --- a/ext/Pod-Html/t/crossref.t +++ b/ext/Pod-Html/t/crossref.t @@ -4,20 +4,29 @@ BEGIN { require "t/pod2html-lib.pl"; } +END { + rem_test_dir(); +} + use strict; use Cwd; use File::Spec; use File::Spec::Functions; use Test::More tests => 1; -my ($v, $d) = splitpath(cwd(), 1); -my $relcwd = substr($d, length(File::Spec->rootdir())); - -convert_n_test("crossref", "cross references", - "--podpath=". catdir($relcwd, 't') . ":" . catdir($relcwd, 'test.lib'), - "--podroot=$v". File::Spec->rootdir, - "--quiet", -); +SKIP: { + my $output = make_test_dir(); + skip "$output", 1 if $output; + + my ($v, $d) = splitpath(cwd(), 1); + my $relcwd = substr($d, length(File::Spec->rootdir())); + + convert_n_test("crossref", "cross references", + "--podpath=". catdir($relcwd, 't') . ":" . catdir($relcwd, 'testdir/test.lib'), + "--podroot=$v". File::Spec->rootdir, + "--quiet", + ); +} __DATA__ <?xml version="1.0" ?> @@ -57,17 +66,17 @@ __DATA__ <p><a href="#non-existant-section">"non existant section"</a></p> -<p><a href="/[RELCURRENTWORKINGDIRECTORY]/test.lib/perlvar-copy.html">perlvar-copy</a></p> +<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a></p> -<p><a href="/[RELCURRENTWORKINGDIRECTORY]/test.lib/perlvar-copy.html#pod-">"$"" in perlvar-copy</a></p> +<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html#pod-">"$"" in var-copy</a></p> -<p><code>perlvar-copy</code></p> +<p><code>var-copy</code></p> -<p><code>perlvar-copy/$"</code></p> +<p><code>var-copy/$"</code></p> -<p><a href="/[RELCURRENTWORKINGDIRECTORY]/test.lib/perlpodspec-copy.html#First:">"First:" in perlpodspec-copy</a></p> +<p><a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/podspec-copy.html#First:">"First:" in podspec-copy</a></p> -<p><code>perlpodspec-copy/First:</code></p> +<p><code>podspec-copy/First:</code></p> <p><a>notperldoc</a></p> diff --git a/ext/Pod-Html/t/htmldir1.pod b/ext/Pod-Html/t/htmldir1.pod index 1c9e97b3e1..e505caaa18 100644 --- a/ext/Pod-Html/t/htmldir1.pod +++ b/ext/Pod-Html/t/htmldir1.pod @@ -6,7 +6,7 @@ htmldir - Test --htmldir feature Normal text, a L<link> to nowhere, -a link to L<perlvar-copy>, +a link to L<var-copy>, L<htmlescp>, diff --git a/ext/Pod-Html/t/htmldir1.t b/ext/Pod-Html/t/htmldir1.t index 3ce6c35dd4..a0e747ffe5 100644 --- a/ext/Pod-Html/t/htmldir1.t +++ b/ext/Pod-Html/t/htmldir1.t @@ -4,31 +4,44 @@ BEGIN { require "t/pod2html-lib.pl"; } +END { + rem_test_dir(); +} + use strict; use Cwd; use File::Spec; use File::Spec::Functions; use Test::More tests => 2; -my ($v, $d) = splitpath(cwd(), 1); -my $relcwd = substr($d, length(File::Spec->rootdir())); +# XXX Separate tests that rely on test.lib from the others so they are the only +# ones skipped (instead of all of them). This applies to htmldir{1,3,5}.t, and +# crossref.t (as of 10/29/11). +SKIP: { + my $output = make_test_dir(); + skip "$output", 2 if $output; + + my ($v, $d) = splitpath(cwd(), 1); + my $relcwd = substr($d, length(File::Spec->rootdir())); -my $data_pos = tell DATA; # to read <DATA> twice + my $data_pos = tell DATA; # to read <DATA> twice -convert_n_test("htmldir1", "test --htmldir and --htmlroot 1a", - "--podpath=". catdir($relcwd, 't') . ":" . catfile($relcwd, 'test.lib'), - "--podroot=$v". File::Spec->rootdir, - "--htmldir=t", -); -seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same) + convert_n_test("htmldir1", "test --htmldir and --htmlroot 1a", + "--podpath=". catdir($relcwd, 't') . ":" . catfile($relcwd, 'testdir/test.lib'), + "--podroot=$v". File::Spec->rootdir, + "--htmldir=t", + ); -convert_n_test("htmldir1", "test --htmldir and --htmlroot 1b", - "--podpath=$relcwd", - "--podroot=$v". File::Spec->rootdir, - "--htmldir=". catfile $relcwd, 't', - "--htmlroot=/", -); + seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same) + + convert_n_test("htmldir1", "test --htmldir and --htmlroot 1b", + "--podpath=$relcwd", + "--podroot=$v". File::Spec->rootdir, + "--htmldir=". catfile $relcwd, 't', + "--htmlroot=/", + ); +} __DATA__ <?xml version="1.0" ?> @@ -57,7 +70,7 @@ __DATA__ <p>Normal text, a <a>link</a> to nowhere,</p> -<p>a link to <a href="/[RELCURRENTWORKINGDIRECTORY]/test.lib/perlvar-copy.html">perlvar-copy</a>,</p> +<p>a link to <a href="/[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a>,</p> <p><a href="/[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p> diff --git a/ext/Pod-Html/t/htmldir3.pod b/ext/Pod-Html/t/htmldir3.pod index 1c9e97b3e1..e505caaa18 100644 --- a/ext/Pod-Html/t/htmldir3.pod +++ b/ext/Pod-Html/t/htmldir3.pod @@ -6,7 +6,7 @@ htmldir - Test --htmldir feature Normal text, a L<link> to nowhere, -a link to L<perlvar-copy>, +a link to L<var-copy>, L<htmlescp>, diff --git a/ext/Pod-Html/t/htmldir3.t b/ext/Pod-Html/t/htmldir3.t index c2f3af6b88..805c9d9d41 100644 --- a/ext/Pod-Html/t/htmldir3.t +++ b/ext/Pod-Html/t/htmldir3.t @@ -4,32 +4,41 @@ BEGIN { require "t/pod2html-lib.pl"; } +END { + rem_test_dir(); +} + use strict; use Cwd; use File::Spec; use File::Spec::Functions; use Test::More tests => 2; -my $cwd = cwd(); -my ($v, $d) = splitpath($cwd, 1); -my $relcwd = substr($d, length(File::Spec->rootdir())); +SKIP: { + my $output = make_test_dir(); + skip "$output", 2 if $output; -my $data_pos = tell DATA; # to read <DATA> twice + my $cwd = cwd(); + my ($v, $d) = splitpath($cwd, 1); + my $relcwd = substr($d, length(File::Spec->rootdir())); -convert_n_test("htmldir3", "test --htmldir and --htmlroot 3a", - "--podpath=$relcwd", - "--podroot=$v". File::Spec->rootdir, - "--htmldir=". catdir($cwd, 't', ''), # test removal trailing slash, -); + my $data_pos = tell DATA; # to read <DATA> twice -seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same) + convert_n_test("htmldir3", "test --htmldir and --htmlroot 3a", + "--podpath=$relcwd", + "--podroot=$v". File::Spec->rootdir, + "--htmldir=". catdir($cwd, 't', ''), # test removal trailing slash, + ); -convert_n_test("htmldir3", "test --htmldir and --htmlroot 3b", - "--podpath=". catdir($relcwd, 't'), - "--podroot=$v". File::Spec->rootdir, - "--htmldir=t", - "--outfile=t/htmldir3.html", -); + seek DATA, $data_pos, 0; # to read <DATA> twice (expected output is the same) + + convert_n_test("htmldir3", "test --htmldir and --htmlroot 3b", + "--podpath=". catdir($relcwd, 't'), + "--podroot=$v". File::Spec->rootdir, + "--htmldir=t", + "--outfile=t/htmldir3.html", + ); +} __DATA__ <?xml version="1.0" ?> @@ -58,7 +67,7 @@ __DATA__ <p>Normal text, a <a>link</a> to nowhere,</p> -<p>a link to <a href="[RELCURRENTWORKINGDIRECTORY]/test.lib/perlvar-copy.html">perlvar-copy</a>,</p> +<p>a link to <a href="[RELCURRENTWORKINGDIRECTORY]/testdir/test.lib/var-copy.html">var-copy</a>,</p> <p><a href="[RELCURRENTWORKINGDIRECTORY]/t/htmlescp.html">htmlescp</a>,</p> diff --git a/ext/Pod-Html/t/htmldir5.pod b/ext/Pod-Html/t/htmldir5.pod index 1c9e97b3e1..e505caaa18 100644 --- a/ext/Pod-Html/t/htmldir5.pod +++ b/ext/Pod-Html/t/htmldir5.pod @@ -6,7 +6,7 @@ htmldir - Test --htmldir feature Normal text, a L<link> to nowhere, -a link to L<perlvar-copy>, +a link to L<var-copy>, L<htmlescp>, diff --git a/ext/Pod-Html/t/htmldir5.t b/ext/Pod-Html/t/htmldir5.t index fa6fada187..15a3901036 100644 --- a/ext/Pod-Html/t/htmldir5.t +++ b/ext/Pod-Html/t/htmldir5.t @@ -4,21 +4,32 @@ BEGIN { require "t/pod2html-lib.pl"; } +END { + rem_test_dir(); +} + use strict; use Cwd; use File::Spec::Functions; use Test::More tests => 1; -my $cwd = catdir cwd(); # catdir converts path separators to that of the OS - # running the test - # XXX but why don't the other tests complain about this? +SKIP: { + my $output = make_test_dir(); + skip "$output", 1 if $output; + -convert_n_test("htmldir5", "test --htmldir and --htmlroot 5", - "--podpath=t:test.lib", - "--podroot=$cwd", - "--htmldir=$cwd", - "--htmlroot=/", -); + my $cwd = catdir cwd(); # catdir converts path separators to that of the OS + # running the test + # XXX but why don't the other tests complain about + # this? + + convert_n_test("htmldir5", "test --htmldir and --htmlroot 5", + "--podpath=t:testdir/test.lib", + "--podroot=$cwd", + "--htmldir=$cwd", + "--htmlroot=/", + ); +} __DATA__ <?xml version="1.0" ?> @@ -47,7 +58,7 @@ __DATA__ <p>Normal text, a <a>link</a> to nowhere,</p> -<p>a link to <a href="../test.lib/perlvar-copy.html">perlvar-copy</a>,</p> +<p>a link to <a href="../testdir/test.lib/var-copy.html">var-copy</a>,</p> <p><a href="./htmlescp.html">htmlescp</a>,</p> diff --git a/ext/Pod-Html/t/pod2html-lib.pl b/ext/Pod-Html/t/pod2html-lib.pl index f10747f0f0..7a71e4c5b7 100644 --- a/ext/Pod-Html/t/pod2html-lib.pl +++ b/ext/Pod-Html/t/pod2html-lib.pl @@ -2,6 +2,30 @@ require Cwd; require Pod::Html; require Config; use File::Spec::Functions ':ALL'; +use File::Path 'remove_tree'; +use File::Copy; + +# make_test_dir and rem_test_dir dynamically create and remove testdir/test.lib. +# it is created dynamically to pass t/filenames.t, which does not allow '.'s in +# filenames as '.' is the directory separator on VMS. All tests that require +# testdir/test.lib to be present are skipped if test.lib cannot be created. +sub make_test_dir { + if (-d 'testdir/test.lib') { + warn "Directory 'test.lib' exists (it shouldn't yet) - removing it"; + rem_test_dir(); + } + mkdir('testdir/test.lib') or return "Could not make test.lib directory: $!\n"; + copy('testdir/perlpodspec-copy.pod', 'testdir/test.lib/podspec-copy.pod') + or return "Could not copy perlpodspec-copy: $!"; + copy('testdir/perlvar-copy.pod', 'testdir/test.lib/var-copy.pod') + or return "Could not copy perlvar-copy: $!"; + return 0; +} + +sub rem_test_dir { + remove_tree('testdir/test.lib') + or warn "Error removing temporary directory 'testdir/test.lib'"; +} sub convert_n_test { my($podfile, $testname, @p2h_args) = @_; diff --git a/ext/Pod-Html/test.lib/perlpodspec-copy.pod b/ext/Pod-Html/testdir/perlpodspec-copy.pod index 4f914ef0e4..4f914ef0e4 100644 --- a/ext/Pod-Html/test.lib/perlpodspec-copy.pod +++ b/ext/Pod-Html/testdir/perlpodspec-copy.pod diff --git a/ext/Pod-Html/test.lib/perlvar-copy.pod b/ext/Pod-Html/testdir/perlvar-copy.pod index 04d2a7474c..04d2a7474c 100644 --- a/ext/Pod-Html/test.lib/perlvar-copy.pod +++ b/ext/Pod-Html/testdir/perlvar-copy.pod |