3 # t/pod-spelling.t -- Test POD spelling.
5 # Called to skip all tests with a reason.
8 print "ok 1 # skip - @_\n";
12 # Make sure we have prerequisites. hunspell is currently not supported due to
13 # lack of support for contractions.
14 eval 'use Test::Pod 1.00';
15 skip_all "Test::Pod 1.00 required for testing POD" if $@;
16 eval 'use Pod::Spell';
17 skip_all "Pod::Spell required to test POD spelling" if $@;
19 for my $dir (split ':', $ENV{PATH}) {
20 if (-x "$dir/ispell") {
21 @spell = ("$dir/ispell", '-d', 'american', '-l');
25 skip_all "ispell required to test POD spelling" unless @spell;
27 # Run the test, one for each POD file.
29 my @pod = all_pod_files ();
30 my $count = scalar @pod;
34 my $child = open (CHILD, '-|');
35 if (not defined $child) {
36 die "Cannot fork: $!\n";
37 } elsif ($child == 0) {
38 my $pid = open (SPELL, '|-', @spell) or die "Cannot run @spell: $!\n";
39 open (POD, '<', $pod) or die "Cannot open $pod: $!\n";
40 my $parser = Pod::Spell->new;
41 $parser->parse_from_filehandle (\*POD, \*SPELL);
49 print "ok $n # skip - @spell failed\n";
56 print " - Misspelled words found in $pod\n";