INN commit: trunk (5 files)

INN Commit rra at isc.org
Wed Sep 17 20:13:06 UTC 2014


    Date: Wednesday, September 17, 2014 @ 13:13:06
  Author: iulius
Revision: 9693

Add a new test for POD formatting

Added:
  trunk/tests/docs/
  trunk/tests/docs/pod.t
Modified:
  trunk/MANIFEST
  trunk/support/getc-tap-harness
  trunk/tests/TESTS

--------------------------+
 MANIFEST                 |    2 ++
 support/getc-tap-harness |   28 ++++++++++++++++++++++++++--
 tests/TESTS              |    1 +
 tests/docs/pod.t         |   43 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+), 2 deletions(-)

Modified: MANIFEST
===================================================================
--- MANIFEST	2014-09-17 16:33:57 UTC (rev 9692)
+++ MANIFEST	2014-09-17 20:13:06 UTC (rev 9693)
@@ -867,6 +867,8 @@
 tests/data/upgrade/newsfeeds.ok       Fixed newsfeeds file
 tests/data/upgrade/overview.fmt       Obsolete overview.fmt config file
 tests/data/upgrade/sasl.conf          Obsolete sasl.conf config file
+tests/docs                            Test suite for documentation (Directory)
+tests/docs/pod.t                       Tests for POD formatting
 tests/innd                            Test suite for innd (Directory)
 tests/innd/artparse-t.c               Tests for ARTparse in innd
 tests/innd/chan-t.c                   Tests for CHAN functions in innd

Modified: support/getc-tap-harness
===================================================================
--- support/getc-tap-harness	2014-09-17 16:33:57 UTC (rev 9692)
+++ support/getc-tap-harness	2014-09-17 20:13:06 UTC (rev 9693)
@@ -40,11 +40,11 @@
   then
     echo "File $1 does not exist in upstream package"
   else
-    if [ "$2" = "tests" ] || [ "$2" = "tests/tap" ]
+    if [ "$2" = "tests" ] || [ "$2" = "tests/docs" ] || [ "$2" = "tests/tap" ]
     then
       # Add the SVN Id keyword at the beginning of source code files,
       # and update the path of included C header files.
-      # Changes in shell scripts and C files are not the same.
+      # Changes in shell, Perl and C files are not the same.
       # Also, do not modify the README file.
       if [ "$3" = "libtap.sh" ]
       then
@@ -52,6 +52,27 @@
 # \$Id\$\\
 #" \
                ${TEMP}
+      elif [ "$3" = "pod.t" ]
+      then
+        # Apply specific changes to POD checking, so as to best suit
+        # our needs.
+        sed -i -e "3 i \\
+# \$Id\$\\
+#\\
+# This file is part of C TAP Harness.  The current version plus supporting\\
+# documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.\\
+#" \
+               -e 's/C TAP Harness/INN/g' \
+               -e '5,8d' \
+               -e '10,11d' \
+               -e '/^use warnings;$/d' \
+               -e "42 i \\
+\$Test::Pod::ignore_dirs{'.libs'} = 'Libs';\\
+" \
+               -e "s/'docs'/'.'/g" \
+               -e 's/docs/root/g' \
+               ${TEMP}
+        chmod 755 ${TEMP}
       elif [ "$3" != "README" ]
       then
         sed -i -e '1 s/$/ $Id$\n */' \
@@ -193,5 +214,8 @@
 download tests/tap/libtap.sh tests/tap libtap.sh
 download tests/tap/macros.h tests/tap macros.h
 
+##  Synchronize the POD checker test suite.
+download tests/docs/pod.t tests/docs pod.t
+
 ##  Synchronize the README file from upstream.
 download docs/writing-tests tests README

Modified: tests/TESTS
===================================================================
--- tests/TESTS	2014-09-17 16:33:57 UTC (rev 9692)
+++ tests/TESTS	2014-09-17 20:13:06 UTC (rev 9693)
@@ -2,6 +2,7 @@
 authprogs/domain
 authprogs/ident
 clients/getlist
+docs/pod
 innd/artparse
 innd/chan
 lib/asprintf

Added: tests/docs/pod.t
===================================================================
--- tests/docs/pod.t	                        (rev 0)
+++ tests/docs/pod.t	2014-09-17 20:13:06 UTC (rev 9693)
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+#
+# $Id$
+#
+# This file is part of C TAP Harness.  The current version plus supporting
+# documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+#
+# Test POD formatting for INN documentation.
+#
+# Copyright 2009, 2010, 2013 Russ Allbery <eagle at eyrie.org>
+
+use 5.006;
+use strict;
+
+use File::Spec;
+use Test::More;
+
+# Abort if SOURCE isn't set.
+if (!$ENV{SOURCE}) {
+    BAIL_OUT('SOURCE environment variable not set');
+}
+
+# Load the Test::Pod module.
+if (!eval { require Test::Pod }) {
+    plan skip_all => 'Test::Pod required for testing POD';
+}
+Test::Pod->import;
+
+# SOURCE will be the test directory.  Change to the parent.
+my ($vol, $dirs) = File::Spec->splitpath($ENV{SOURCE}, 1);
+my @dirs = File::Spec->splitdir($dirs);
+pop(@dirs);
+if ($dirs[-1] eq File::Spec->updir) {
+    pop(@dirs);
+    pop(@dirs);
+}
+my $root = File::Spec->catpath($vol, File::Spec->catdir(@dirs), q{});
+chdir($root) or BAIL_OUT("cannot chdir to $root: $!");
+
+$Test::Pod::ignore_dirs{'.libs'} = 'Libs';
+
+# Test all the POD in the root directory.
+all_pod_files_ok(all_pod_files('.'));


Property changes on: trunk/tests/docs/pod.t
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native



More information about the inn-committers mailing list