File: perlfunc.t

package info (click to toggle)
perl 5.20.2-3%2Bdeb8u11
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 102,964 kB
  • sloc: perl: 555,553; ansic: 214,041; sh: 38,121; pascal: 8,783; cpp: 3,895; makefile: 2,393; xml: 2,325; yacc: 1,741
file content (36 lines) | stat: -rw-r--r-- 1,422 bytes parent folder | download | duplicates (2)
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
34
35
36
#!./perl -w

# What does this test?
# This checks that changes to pod/perlfunc.pod don't accidentally break the
# build by causing ext/Pod-Functions/Functions_pm.PL to abort.
#
# Why do we test this?
# Pod::Functions is generated from pod/perlfunc.pod by
# ext/Pod-Functions/Functions_pm.PL
# If it can't parse pod/perlfunc.pod, it will abort, which will cause the
# build to break. It's really not possible for it to carry on, hence aborting
# is the only option. However, innocent-seeming changes to documentation
# shouldn't break the build, and we expect everyone to run (at least)
# the porting tests, hence this test, to catch such problems before it's too
# late. To avoid duplicating the parsing logic, we make Functions_pm.PL take
# a --tap option, to test that all is well.
#
# It's broken - how do I fix it?
# Likely it's because you changed something in pod/perlfunc.pod
# If you added a new function, it needs to be added to one or more groups in
# "Perl Functions by Category", and to have a one line summary for
# Pod::Functions provided by a =for directive.

BEGIN {
    @INC = ('..', '../lib') if -f '../TestInit.pm';
}

use Config;
use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute

if ( $Config{usecrosscompile} ) {
    print "1..0 # Not all files are available during cross-compilation\n";
    exit 0;
}

system "$^X ext/Pod-Functions/Functions_pm.PL --tap pod/perlfunc.pod";