r22681 - in /branches/upstream/libtest-yaml-meta-perl/current: Changes META.yml lib/Test/YAML/Meta.pm lib/Test/YAML/Meta/Version.pm t/04metatester.t t/90podtest.t t/91podcover.t t/94metatest.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Wed Jul 2 21:37:49 UTC 2008


Author: gregoa
Date: Wed Jul  2 21:37:49 2008
New Revision: 22681

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=22681
Log:
[svn-upgrade] Integrating new upstream version, libtest-yaml-meta-perl (0.11)

Modified:
    branches/upstream/libtest-yaml-meta-perl/current/Changes
    branches/upstream/libtest-yaml-meta-perl/current/META.yml
    branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm
    branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm
    branches/upstream/libtest-yaml-meta-perl/current/t/04metatester.t
    branches/upstream/libtest-yaml-meta-perl/current/t/90podtest.t
    branches/upstream/libtest-yaml-meta-perl/current/t/91podcover.t
    branches/upstream/libtest-yaml-meta-perl/current/t/94metatest.t

Modified: branches/upstream/libtest-yaml-meta-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/Changes?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/Changes (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/Changes Wed Jul  2 21:37:49 2008
@@ -1,4 +1,8 @@
 # Changes log for Test::YAML::Meta
+
+0.11    27/06/2008
+	- added spec version 1.4
+	- added further check to ensure we have a known spec version
 
 0.10    02/06/2008
 	- added 'git' as an accepted url protocol (Mischa Poslawsky).

Modified: branches/upstream/libtest-yaml-meta-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/META.yml?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/META.yml (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/META.yml Wed Jul  2 21:37:49 2008
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                     Test-YAML-Meta
-version:                  0.10
+version:                  0.11
 abstract:                 A test module to validate a META.yml file.
 author:
   - Barbie <barbie at cpan.org>
@@ -27,10 +27,10 @@
 provides:
   Test::YAML::Meta:
     file:     lib/Test/YAML/Meta.pm
-    version:  0.10
+    version:  0.11
   Test::YAML::Meta::Version:
     file:     lib/Test/YAML/Meta/Version.pm
-    version:  0.10
+    version:  0.11
 no_index:
   directory:
     - t
@@ -41,6 +41,6 @@
   bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Test-YAML-Meta
 
 meta-spec:
-   version:   1.3
-   url:       http://module-build.sourceforge.net/META-spec-v1.3.html
+   version:   1.4
+   url:       http://module-build.sourceforge.net/META-spec-v1.4.html
 generated_by: Hand 1.0

Modified: branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta.pm Wed Jul  2 21:37:49 2008
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.10';
+$VERSION = '0.11';
 
 #----------------------------------------------------------------------------
 

Modified: branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/lib/Test/YAML/Meta/Version.pm Wed Jul  2 21:37:49 2008
@@ -4,7 +4,7 @@
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '0.10';
+$VERSION = '0.11';
 
 #----------------------------------------------------------------------------
 
@@ -37,6 +37,15 @@
 #############################################################################
 #Specification Definitions													#
 #############################################################################
+
+my %known_specs = (
+    '1.4' => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+    '1.3' => 'http://module-build.sourceforge.net/META-spec-v1.3.html',
+    '1.2' => 'http://module-build.sourceforge.net/META-spec-v1.2.html',
+    '1.1' => 'http://module-build.sourceforge.net/META-spec-v1.1.html',
+    '1.0' => 'http://module-build.sourceforge.net/META-spec-v1.0.html'
+);
+my %known_urls = map {$known_specs{$_} => $_} keys %known_specs;
 
 my $module_map1 = { 'map' => { ':key' => { name => \&module, value => \&exversion } } };
 my $module_map2 = { 'map' => { ':key' => { name => \&module, value => \&version   } } };
@@ -60,7 +69,7 @@
 };
 
 my %definitions = (
-'1.3' => {
+'1.4' => {
 #  'header'              => { mandatory => 1, value => \&header },
   'meta-spec'           => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version},
                                                         url     => { mandatory => 1, value => \&urlspec } } },
@@ -78,6 +87,7 @@
   'requires'            => $module_map1,
   'recommends'          => $module_map1,
   'build_requires'      => $module_map1,
+  'configure_requires'  => $module_map1,
   'conflicts'           => $module_map2,
 
   'optional_features'   => {
@@ -121,6 +131,67 @@
   ':key'        => { name => \&word },
 },
 
+'1.3' => {
+#  'header'              => { mandatory => 1, value => \&header },
+  'meta-spec'           => { mandatory => 1, 'map' => { version => { mandatory => 1, value => \&version},
+                                                        url     => { mandatory => 1, value => \&urlspec } } },
+
+  'name'                => { mandatory => 1, value => \&string  },
+  'version'             => { mandatory => 1, value => \&version },
+  'abstract'            => { mandatory => 1, value => \&string  },
+  'author'              => { mandatory => 1, list  => { value => \&string } },
+  'license'             => { mandatory => 1, value => \&license },
+  'generated_by'        => { mandatory => 1, value => \&string  },
+
+  'distribution_type'   => { value => \&string  },
+  'dynamic_config'      => { value => \&boolean },
+
+  'requires'            => $module_map1,
+  'recommends'          => $module_map1,
+  'build_requires'      => $module_map1,
+  'conflicts'           => $module_map2,
+
+  'optional_features'   => {
+    list        => {
+        ':key'  => { name => \&word,
+            'map'   => { description        => { value => \&string },
+                         requires_packages  => { value => \&string },
+                         requires_os        => { value => \&string },
+                         excludes_os        => { value => \&string },
+                         requires           => $module_map1,
+                         recommends         => $module_map1,
+                         build_requires     => $module_map1,
+                         conflicts          => $module_map2,
+            }
+        }
+     }
+  },
+
+  'provides'    => {
+    'map'       => { ':key' => { name  => \&module,
+                                 'map' => { file    => { mandatory => 1, value => \&file },
+                                            version => { value => \&version } } } }
+  },
+
+  'no_index'    => $no_index_1_3,
+  'private'     => $no_index_1_3,
+
+  'keywords'    => { list => { value => \&string } },
+
+  'resources'   => {
+    'map'       => { license    => { value => \&url },
+                     homepage   => { value => \&url },
+                     bugtracker => { value => \&url },
+                     repository => { value => \&url },
+                     ':key'     => { value => \&string, name => \&resource },
+    }
+  },
+
+  # additional user defined key/value pairs
+  # note we can only validate the key name, as the structure is user defined
+  ':key'        => { name => \&word },
+},
+
 # v1.2 is misleading, it seems to assume that a number of fields where created
 # within v1.1, when they were created within v1.2. This may have been an
 # original mistake, and that a v1.1 was retro fitted into the timeline, when
@@ -311,6 +382,11 @@
 
 sub check_map {
     my ($self,$spec,$data) = @_;
+
+    if(ref($spec) ne 'HASH') {
+        $self->_error( "Unknown META.yml specification, cannot validate." );
+        return;
+    }
 
     if(ref($data) ne 'HASH') {
         $self->_error( "Expected a map structure from YAML string or file" );
@@ -499,14 +575,6 @@
     $self->_error( "'$value' for '$key' is not a valid URL." );
     return 0;
 }
-
-my %known_specs = (
-    '1.3' => 'http://module-build.sourceforge.net/META-spec-v1.3.html',
-    '1.2' => 'http://module-build.sourceforge.net/META-spec-v1.2.html',
-    '1.1' => 'http://module-build.sourceforge.net/META-spec-v1.1.html',
-    '1.0' => 'http://module-build.sourceforge.net/META-spec-v1.0.html'
-);
-my %known_urls = map {$known_specs{$_} => $_} keys %known_specs;
 
 sub urlspec {
     my ($self,$key,$value) = @_;

Modified: branches/upstream/libtest-yaml-meta-perl/current/t/04metatester.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/t/04metatester.t?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/04metatester.t (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/04metatester.t Wed Jul  2 21:37:49 2008
@@ -2,7 +2,7 @@
 use strict;
 
 use Test::YAML::Meta;
-use Test::Builder::Tester tests => 6;
+use Test::Builder::Tester tests => 7;
 
 my $testfile = 't/samples/00-META.yml';
 
@@ -37,3 +37,11 @@
 test_out('ok 2 - my own test');
 meta_spec_ok($testfile,undef,'my own test');
 test_test("$testfile with assumed (1.3) version");
+
+test_out('ok 1 - t/samples/00-META.yml contains valid YAML');
+test_out('not ok 2 - bad spec version');
+test_fail(2);
+test_err('#   ERR: Unknown META.yml specification, cannot validate. [Validation: 0.99]');
+meta_spec_ok($testfile,'0.99','bad spec version');
+test_test("$testfile with bad spec version 0.99");
+

Modified: branches/upstream/libtest-yaml-meta-perl/current/t/90podtest.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/t/90podtest.t?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/90podtest.t (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/90podtest.t Wed Jul  2 21:37:49 2008
@@ -1,4 +1,9 @@
 use Test::More;
+
+# Skip if doing a regular install
+plan skip_all => "Author tests not required for installation"
+    unless ( $ENV{AUTOMATED_TESTING} );
+
 eval "use Test::Pod 1.00";
 plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
 all_pod_files_ok();

Modified: branches/upstream/libtest-yaml-meta-perl/current/t/91podcover.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/t/91podcover.t?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/91podcover.t (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/91podcover.t Wed Jul  2 21:37:49 2008
@@ -1,4 +1,9 @@
 use Test::More;
+
+# Skip if doing a regular install
+plan skip_all => "Author tests not required for installation"
+    unless ( $ENV{AUTOMATED_TESTING} );
+
 eval "use Test::Pod::Coverage 0.08";
 plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD coverage" if $@;
 all_pod_coverage_ok();

Modified: branches/upstream/libtest-yaml-meta-perl/current/t/94metatest.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-yaml-meta-perl/current/t/94metatest.t?rev=22681&op=diff
==============================================================================
--- branches/upstream/libtest-yaml-meta-perl/current/t/94metatest.t (original)
+++ branches/upstream/libtest-yaml-meta-perl/current/t/94metatest.t Wed Jul  2 21:37:49 2008
@@ -1,4 +1,9 @@
 use Test::More;
+
+# Skip if doing a regular install
+plan skip_all => "Author tests not required for installation"
+    unless ( $ENV{AUTOMATED_TESTING} );
+
 eval "use Test::YAML::Meta";
 plan skip_all => "Test::YAML::Meta required for testing META.yml" if $@;
 meta_yaml_ok();




More information about the Pkg-perl-cvs-commits mailing list