[svn:parrot] r36712 - in branches/update_pod: . lib/Parrot/Test/Pod t/codingstd

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Sat Feb 14 03:32:56 UTC 2009


Author: jkeenan
Date: Sat Feb 14 03:32:50 2009
New Revision: 36712
URL: https://trac.parrot.org/parrot/changeset/36712

Log:
Move one test from pod.t to pod_syntax.t.  Extract this test's 'second pass'
sub and put it into Parrot::Test::Pod::Util.  Set svn:ignore for
.pod_examinable*.sto.

Added:
   branches/update_pod/t/codingstd/pod_syntax.t
      - copied, changed from r36711, branches/update_pod/t/codingstd/pod.t
Modified:
   branches/update_pod/   (props changed)
   branches/update_pod/MANIFEST
   branches/update_pod/lib/Parrot/Test/Pod/Util.pm

Modified: branches/update_pod/MANIFEST
==============================================================================
--- branches/update_pod/MANIFEST	Sat Feb 14 03:11:54 2009	(r36711)
+++ branches/update_pod/MANIFEST	Sat Feb 14 03:32:50 2009	(r36712)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Feb 14 00:01:58 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Feb 14 03:16:53 2009 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -2823,6 +2823,7 @@
 t/codingstd/perlcritic.t                                    []
 t/codingstd/pir_code_coda.t                                 []
 t/codingstd/pod.t                                           []
+t/codingstd/pod_syntax.t                                    []
 t/codingstd/pod_todo.t                                      []
 t/codingstd/svn_id.t                                        []
 t/codingstd/tabs.t                                          []

Modified: branches/update_pod/lib/Parrot/Test/Pod/Util.pm
==============================================================================
--- branches/update_pod/lib/Parrot/Test/Pod/Util.pm	Sat Feb 14 03:11:54 2009	(r36711)
+++ branches/update_pod/lib/Parrot/Test/Pod/Util.pm	Sat Feb 14 03:32:50 2009	(r36712)
@@ -172,7 +172,7 @@
 
 =item *
 
-Reference to hash of files meriting analysis, generated in first part of 
+Reference to hash of files meriting analysis, generated in first part of
 C<identify_files_for_POD_testing()>.
 
 =item *
@@ -203,19 +203,19 @@
     else {
         SECOND_FILE: foreach my $file ( keys %{ $files_needing_analysis } ) {
             my $full_file = qq|$build_dir/$file|;
-        
+
             # Skip the book, because it uses extended O'Reilly-specific POD
             if ($full_file =~ m{docs/book/}) {
                 delete $files_needing_analysis->{ $file };
                 next SECOND_FILE;
             }
-        
+
             # skip POD generating scripts
             if ($full_file =~ m/ops_summary\.pl/) {
                 delete $files_needing_analysis->{ $file };
                 next SECOND_FILE;
             }
-        
+
             # skip file which includes malformed POD for other testing purposes
             if ($full_file =~ m{
                     t/tools/dev/searchops/samples\.pm

Copied and modified: branches/update_pod/t/codingstd/pod_syntax.t (from r36711, branches/update_pod/t/codingstd/pod.t)
==============================================================================
--- branches/update_pod/t/codingstd/pod.t	Sat Feb 14 03:11:54 2009	(r36711, copy source)
+++ branches/update_pod/t/codingstd/pod_syntax.t	Sat Feb 14 03:32:50 2009	(r36712)
@@ -23,7 +23,7 @@
     }
 }
 
-plan tests => 2;
+plan tests => 1;
 
 # RT #44437 this should really be using src_dir instead of build_dir but it
 # does not exist (yet)
@@ -48,42 +48,24 @@
     second_analysis => \&oreilly_summary_malformed,
 } );
 
-my (@failed_syntax, @empty_description);
+my @failed_syntax;
 
 foreach my $file ( @{ $need_testing_ref } ) {
-    # skip files with valid POD
-    if (file_pod_ok($file)) {
-        #check DESCRIPTION section on valid POD files
-        push @empty_description, $file if empty_description($file);
-    }
-    else {
-        # report whatever is not skipped
+    # skip files with valid POD;
+    # report whatever is not skipped
+    unless (file_pod_ok($file)) {
         push @failed_syntax, $file;
     }
 }
 
 my $bad_syntax_files        = join( "\n", @failed_syntax );
-my $empty_description_files = join( "\n", @empty_description);
-my $nempty_description      = scalar( @empty_description );
 
 # only ok if everything passed
 is( $bad_syntax_files, q{}, 'Pod syntax correct' );
 
-TODO: {
-    local $TODO = "not quite done yet";
-    is(
-        $empty_description_files,
-        q{},
-        'All Pod files have non-empty DESCRIPTION sections'
-    );
-}
-
 diag("You should use podchecker to check the failed files.\n")
     if $bad_syntax_files;
 
-diag("Found $nempty_description files without DESCRIPTION sections.\n")
-    if $nempty_description;
-
 #################### SUBROUTINES ####################
 
 # Pulled from Test::Pod
@@ -97,32 +79,17 @@
     return !$checker->any_errata_seen;
 }
 
-sub empty_description {
-    my $file = shift;
-
-    use Pod::Simple::PullParser;
-    my $parser = Pod::Simple::PullParser->new;
-    $parser->set_source( $file );
-    my $description = $parser->get_description;
-
-    if ( $description =~ m{^\s*$}m ) {
-        return 1;
-    }
-
-    return 0;
-}
-
 =head1 NAME
 
-t/codingstd/pod.t - Pod document syntax tests
+t/codingstd/pod_syntax.t - Pod document syntax tests
 
 =head1 SYNOPSIS
 
     # test all files
-    % prove t/codingstd/pod.t
+    % prove t/codingstd/pod_syntax.t
 
     # test specific files
-    % perl t/codingstd/pod.t perl_module.pm perl_file.pl
+    % perl t/codingstd/pod_syntax.t perl_module.pm perl_file.pl
 
 =head1 DESCRIPTION
 


More information about the parrot-commits mailing list