summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-01-30 14:47:13 +0100
committerNicholas Clark <nick@ccl4.org>2012-02-18 13:16:52 +0100
commit4094982d4b552a75a521bdc7df40396d0b57ae4f (patch)
treede38de2b06742d0d3a7474902c6da1f6c9a53c5c /t
parent16538db18cc7422e19490d4a267e9dc8bb6a55e3 (diff)
downloadperl-4094982d4b552a75a521bdc7df40396d0b57ae4f.tar.gz
Add t/porting/perlfunc.t so that porting tests catch problems with perlfunc
Pod::Functions is now 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.
Diffstat (limited to 't')
-rw-r--r--t/porting/perlfunc.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/porting/perlfunc.t b/t/porting/perlfunc.t
new file mode 100644
index 0000000000..b32e88acdd
--- /dev/null
+++ b/t/porting/perlfunc.t
@@ -0,0 +1,29 @@
+#!./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".
+
+BEGIN {
+ @INC = '..' if -f '../TestInit.pm';
+}
+
+use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
+
+system "$^X ext/Pod-Functions/Functions_pm.PL --tap pod/perlfunc.pod";