File: pod-check.t

package info (click to toggle)
rinse 1.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 280 kB
  • ctags: 34
  • sloc: perl: 873; sh: 762; makefile: 112
file content (33 lines) | stat: -rwxr-xr-x 739 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl -w
#
#  Test that the POD we include in our scripts is valid, via the external
# podcheck command.
#
# Steve
# --


use strict;
use Test::More qw( no_plan );

foreach my $file ( glob( "bin/*" ) )
{
    next if ( -d $file );
    ok( -e $file, "$file" );
    ok( -x $file, " File is executable: $file" );
    ok( ! -d $file, " File is not a directory: $file" );

    if ( ( -x $file ) && ( ! -d $file ) )
    {
        #
        #  Execute the command giving STDERR to STDOUT where we
        # can capture it.
        #
        my $cmd           = "podchecker $file";
        my $output = `$cmd 2>&1`;
        chomp( $output );

        is( $output, "$file pod syntax OK.", " File has correct POD syntax: $file" );
    }
}