add generated_hello.pbc to examples-clean
[parrot.git] / t / codingstd / pod_syntax.t
blob6937913e2d5c35145fd6f8fc7e73bdca76ff8e11
1 #! perl
2 # Copyright (C) 2001-2010, Parrot Foundation.
3 # $Id$
5 use strict;
6 use warnings;
7 use Carp;
8 use Test::More;
9 use lib qw( lib );
10 BEGIN {
11     eval 'use Parrot::Test::Pod';
12     if ($@) {
13         plan skip_all => 'Prerequisites for Parrot::Test::Pod not satisfied';
14         exit;
15     }
16     eval 'use Parrot::Test::Pod::Utils qw(
17         file_pod_ok
18     )';
21 plan tests => 2;
23 my $self = Parrot::Test::Pod->new( {
24     argv => [ @ARGV ],
25 } );
26 ok( defined $self, "Parrot::Test::Pod returned defined value" );
28 my $need_testing_ref = $self->identify_files_for_POD_testing( {
29     second_analysis => 'oreilly_summary_malformed',
30 } );
32 my @failed_syntax;
34 foreach my $file ( @{ $need_testing_ref } ) {
35     # skip files with valid POD;
36     # report whatever is not skipped
37     unless (file_pod_ok($file)) {
38         push @failed_syntax, $file;
39     }
42 my $bad_syntax_files        = join( "\n", @failed_syntax );
44 # only ok if everything passed
45 is( $bad_syntax_files, q{}, 'Pod syntax correct' );
47 diag("You should use podchecker to check the failed files.\n")
48     if $bad_syntax_files;
50 #################### SUBROUTINES ####################
52 =head1 NAME
54 t/codingstd/pod_syntax.t - Pod document syntax tests
56 =head1 SYNOPSIS
58     # test all files
59     % prove t/codingstd/pod_syntax.t
61     # test specific files
62     % perl t/codingstd/pod_syntax.t perl_module.pm perl_file.pl
64 =head1 DESCRIPTION
66 Tests the Pod syntax for all files listed in F<MANIFEST> and
67 F<MANIFEST.generated> that appear to contain Pod markup. If any files
68 contain invalid POD markup, they are reported in the test output.
69 Use C<podchecker> to ferret out individual issues.
71 =cut
73 # Local Variables:
74 #   mode: cperl
75 #   cperl-indent-level: 4
76 #   fill-column: 100
77 # End:
78 # vim: expandtab shiftwidth=4: