package Testing; use 5.10.0; use warnings; use Exporter 'import'; our $VERSION = 1.35; # Let's keep this same as lib/Pod/Html.pm $VERSION = eval $VERSION; our @EXPORT_OK = qw( setup_testing_dir xconvert record_state_of_cache ); use Cwd; use Pod::Html; use Config; use File::Basename; use File::Copy; use File::Path ( qw| make_path | ); use File::Spec::Functions ':ALL'; use File::Temp ( qw| tempdir | ); use Data::Dumper;$Data::Dumper::Sortkeys=1; use Pod::Html::Util qw( unixify ); *ok = \&Test::More::ok; *is = \&Test::More::is; our @no_arg_switches = ( qw| flush recurse norecurse quiet noquiet verbose noverbose index noindex backlink nobacklink header noheader poderrors nopoderrors | ); =head1 NAME Testing - Helper functions for testing Pod-Html =head1 SYNOPSIS use Testing qw( setup_testing_dir xconvert ); my $tdir = setup_testing_dir( { debug => $debug, } ); $args = { podstub => "htmldir1", description => "test --htmldir and --htmlroot 1a", expect => $expect_raw, p2h => { podpath => File::Spec::Unix->catdir($relcwd, 't') . ":" . File::Spec::Unix->catdir($relcwd, 'corpus/test.lib'), podroot => catpath($v, '/', ''), htmldir => 't', quiet => 1, }, debug => $debug, }; xconvert($args); =head1 DESCRIPTION This module exports, upon request only, 2 subroutines which are used in most of the files in the core distribution test suite for Pod-HTML (F). In the future we may add additional subroutines, particularly to better diagnose problems with Pod-Html. =head2 Pod-Html's Testing Structure As of version 1.26 of this module (early 2021), the testing structure consists of 16 F<.pod> files and 18 F<.t> files located in two subdirectories, F and F. Let's analyze these by directory. =head3 Files in F There are currently 2 F<.pod> files in F both of which are old versions of F files selected to give some complexity to the test suite. Since we don't actually attempt to make HTML out of their POD, we don't need to discuss them further. =head3 Files in F There are currently 14 F<.pod> files and 18 F<.t> files in F. Both of these numbers may change in the future. Currently there are 2 F files (F and F) which exercise certain functionality of F but which do not require F files as data input. These files do not make use of the subroutines exported by this module. We may add more test files like this in the future to ensure high test coverage, but don't need to discuss them further here. The remaining 16 F test programs make use of the testing subroutines exported by this module. Most, but not all, of these test programs make use of the F files. Each such test program makes use of only 1 F file at a time, though there are several cases where several, similarly named, test programs make use of the same F file for data input. For example, t/crossref.t t/crossref2.t t/crossref3.t all make use of t/crossref.pod Each F file consists solely of simple documentation in POD format. =head3 High-level description of programs which use F<.pod> files as input Each of the F programs which makes use of a given F file slurps the text of a single such F file into memory. The test program holds text in a C handle which serves as a B