[svn:parrot] r48350 - in branches/tt1726_pmc_pod: . t/codingstd

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Sun Aug 8 16:58:06 UTC 2010


Author: jkeenan
Date: Sun Aug  8 16:58:05 2010
New Revision: 48350
URL: https://trac.parrot.org/parrot/changeset/48350

Log:
First draft of a codingstd file testing for the presence of POD in .pmc files.   This first draft follows approach taken in c_function_docs.t.  Detects 3 files lacking POD not detected by tools/build/headerizer.pl.

Added:
   branches/tt1726_pmc_pod/t/codingstd/pmc_docs.t   (contents, props changed)
      - copied, changed from r48344, branches/tt1726_pmc_pod/t/codingstd/c_function_docs.t
Modified:
   branches/tt1726_pmc_pod/MANIFEST

Modified: branches/tt1726_pmc_pod/MANIFEST
==============================================================================
--- branches/tt1726_pmc_pod/MANIFEST	Sun Aug  8 16:38:56 2010	(r48349)
+++ branches/tt1726_pmc_pod/MANIFEST	Sun Aug  8 16:58:05 2010	(r48350)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Aug  3 18:21:50 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Aug  8 16:31:42 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1503,6 +1503,7 @@
 t/codingstd/pdd_format.t                                    [test]
 t/codingstd/perlcritic.t                                    [test]
 t/codingstd/pir_code_coda.t                                 [test]
+t/codingstd/pmc_docs.t                                      [test]
 t/codingstd/pod_description.t                               [test]
 t/codingstd/pod_syntax.t                                    [test]
 t/codingstd/pod_todo.t                                      [test]

Copied and modified: branches/tt1726_pmc_pod/t/codingstd/pmc_docs.t (from r48344, branches/tt1726_pmc_pod/t/codingstd/c_function_docs.t)
==============================================================================
--- branches/tt1726_pmc_pod/t/codingstd/c_function_docs.t	Sun Aug  8 16:28:09 2010	(r48344, copy source)
+++ branches/tt1726_pmc_pod/t/codingstd/pmc_docs.t	Sun Aug  8 16:58:05 2010	(r48350)
@@ -10,22 +10,23 @@
 use Parrot::Config qw(%PConfig);
 use Parrot::Distribution;
 use Parrot::Headerizer;
+use Data::Dumper;$Data::Dumper::Indent=1;
 
 =head1 NAME
 
-t/codingstd/c_function_docs.t - checks for missing function documentation
+t/codingstd/pmc_docs.t - checks for missing function documentation
 
 =head1 SYNOPSIS
 
     # test all files
-    % prove t/codingstd/c_function_docs.t
+    % prove t/codingstd/pmc_docs.t
 
     # test specific files
-    % perl t/codingstd/c_function_docs.t src/foo.c include/parrot/bar.h
+    % perl t/codingstd/pmc_docs.t src/foo.pmc src/bar.pmc
 
 =head1 DESCRIPTION
 
-Checks that all C language source files have documentation for each function
+Checks that all PMC source files have documentation for each function
 declared.
 
 =cut
@@ -33,9 +34,13 @@
 my $DIST = Parrot::Distribution->new;
 my $headerizer = Parrot::Headerizer->new;
 
-# can not handle .ops or .pmc files yet
-my @files = grep {/\.(c|h)$/ } @ARGV ? @ARGV :
-    map {s/^$PConfig{build_dir}\///; $_} map {s/\\/\//g; $_} map {$_->path} $DIST->get_c_language_files();
+my @files = @ARGV ? @ARGV :
+    map {s/^$PConfig{build_dir}\///; $_}
+    map {s/\\/\//g; $_}
+    map {$_->path} $DIST->pmc_source_files();
+
+#print STDERR Dumper \@files;
+#print STDERR "Found ", scalar @files, " .pmc files\n";
 
 plan tests => scalar @files;
 
@@ -48,11 +53,9 @@
 }
 
 foreach my $path (@files) {
-
     my $buf = $DIST->slurp($path);
-    my @missing_docs;
-
     my @function_decls = $headerizer->extract_function_declarations($buf);
+    my @missing_docs;
 
     for my $function_decl (@function_decls) {
 
@@ -91,6 +94,29 @@
 }
 
 __DATA__
+src/dynpmc/rational.pmc
+src/pmc/bigint.pmc
+src/pmc/bignum.pmc
+src/pmc/callcontext.pmc
+src/pmc/class.pmc
+src/pmc/complex.pmc
+src/pmc/coroutine.pmc
+src/pmc/eval.pmc
+src/pmc/fixedintegerarray.pmc
+src/pmc/hashiterator.pmc
+src/pmc/imageio.pmc
+src/pmc/imageiosize.pmc
+src/pmc/integer.pmc
+src/pmc/namespace.pmc
+src/pmc/nci.pmc
+src/pmc/null.pmc
+src/pmc/object.pmc
+src/pmc/orderedhash.pmc
+src/pmc/packfile.pmc
+src/pmc/role.pmc
+src/pmc/sub.pmc
+src/pmc/threadinterpreter.pmc
+src/pmc/unmanagedstruct.pmc
 
 # Local Variables:
 #   mode: cperl


More information about the parrot-commits mailing list