Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • What is this short-sightedness of Test::Pod to try and declare it's own plan automatically of which you speak? Maybe I'm missing some cool functionality doing it the following way, but it seems to work well enough for me.

    if (!$ENV{PERL_AUTHOR_TESTING}) {
        plan skip_all => 'PERL_AUTHOR_TESTING environment variable not set (or zero)';
        exit;
    }

    eval qq{use Test::Pod};
    my $has_test_pod = $@ ? 0 : 4;

    eval qq{use Test::Pod::Coverage};
    my $has_test_pod_coverage = $@ ? 0 : 4;

    my $pod_test

    • It's all fine at THAT point... then when you call all_pod_tests_ok, or whatever the function is, Test::Pod will declare ANOTHER plan, and boom multiple plans explosion tests fail.
      • Don't do that, then.

        Use pod_file_ok and spell it out longhand. My latest thinking on the matter looks something like this [mongueurs.net], which I think is on the right track, although I'm still not happy with the redundancies in, for instance, $test_pod_coverage_tests and @coverage.

        • There's no way in hell I'm going to maintain 156 versions of the same pod testing script, written out longhand.

          The entire point of the short versions is to have one simple script I can have my release automation automatically copy into place as it's building the release distribution.

          Manually maintaining it all would be a massive waste of my time.
          • Manually maintaining it all would be a massive waste of my time.

            Oh yeah, I forgot that you do have quite a number of modules, don't you :) I guess I'm not playing in the same league.

            Still, could this not be driven by extracting candidats from MANIFEST? Looking for all .pm files under lib or the base directory of the unpacked distribution?

            • Oh wait, you mean that a different way.

              That's what the all_pod_tests_ok type methods in Test::Pod and such do, they do a scan for files, create a plan based on the number of files, then test them
              • Yes, precisely that. Something like:

                my @file;
                if (open my $MAN, '<', 'MANIFEST') {
                    while (<$MAN>) {
                        chomp;
                        push @file, $_ if /\.pm$/;
                    }
                    close $MAN;
                }
                else {
                    diag "failed to read MANIFEST: $!";
                }

                ...

                SKIP: {
                    skip( 'Test::Pod not installed on this system', scalar(@file) )
                        unless $test_pod_tests;
                    pod_file_ok($_) for @file;
                }

                But I don't know how