1Test::CPAN::Meta(3)   User Contributed Perl Documentation  Test::CPAN::Meta(3)
2
3
4

NAME

6       Test::CPAN::Meta - Validate your CPAN META.yml files.
7

SYNOPSIS

9       There are two forms this module can be used.
10
11       The first is a standalone test of your distribution's META.yml file:
12
13         use Test::More;
14         eval "use Test::CPAN::Meta";
15         plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
16         meta_yaml_ok();
17
18       Note that you may provide an optional label/comment/message/etc to the
19       function, or one will be created automatically.
20
21       The second form allows you to test other META.yml files, or specify a
22       specific version you wish to test against:
23
24         use Test::More tests => 6;
25         use Test::CPAN::Meta;
26
27         # specify a file and specification version
28         meta_spec_ok('META.yml','1.3',$msg);
29
30         # specify the specification version to validate the local META.yml
31         meta_spec_ok(undef,'1.3',$msg);
32
33         # specify a file, where the specification version is deduced
34         # from the file itself
35         meta_spec_ok('META.yml',undef,$msg);
36
37       Note that this form requires you to specify the number of tests you
38       will be running in your test script. Also note that each 'meta_spec_ok'
39       is actually 2 tests under the hood.
40

DESCRIPTION

42       This distribution was written to ensure that a META.yml file, provided
43       with a standard distribution uploaded to CPAN, meets the specifications
44       that are slowly being introduced to module uploads, via the use of
45       package makers and installers such as ExtUtils::MakeMaker,
46       Module::Build and Module::Install.
47
48       See CPAN::Meta for further details of the CPAN Meta Specification.
49

FUNCTIONS

51       •   meta_yaml_ok([$msg])
52
53           Basic META.yml wrapper around meta_spec_ok.
54
55           Returns a hash reference to the contents of the parsed META.yml
56
57       •   meta_spec_ok($file, $version [,$msg])
58
59           Validates the named file against the given specification version.
60           Both $file and $version can be undefined.
61
62           Returns a hash reference to the contents of the given file, after
63           it has been parsed.
64

TESTING META FILES

66       There are currently 3 distributions to test META files:
67
68         Test-CPAN-Meta
69         Test-CPAN-Meta-JSON
70         Test-CPAN-Meta-YAML
71
72       All three have slightly different requirements and are intended to be
73       used in slightly different environments.
74
75       Test-CPAN-Meta-YAML requires a YAML parser, and currently looks for the
76       YAML or YAML::Syck modules. This is the original variant of the 3 and
77       was intended to provide a more complete YAML validation of a META.yml.
78
79       Test-CPAN-Meta requires the Parse::CPAN::Meta module, which is now part
80       of Perl Core as of perl-5.10.1. This version is intended to be used by
81       those only wishing to rely on core modules to test their META.yml
82       files.
83
84       Test-CPAN-Meta-JSON is the most recent addition to the family, and is
85       specifically aimed at those distributions that use a META.json Meta
86       file. The distribution requires the JSON module to parse the Meta file.
87

BUGS, PATCHES & FIXES

89       There are no known bugs at the time of this release. However, if you
90       spot a bug or are experiencing difficulties that are not explained
91       within the POD documentation, please send an email to barbie@cpan.org
92       or submit a bug to the RT system
93       (http://rt.cpan.org/Public/Dist/Display.html?Name=Test-CPAN-Meta).
94       However, it would help greatly if you are able to pinpoint problems or
95       even supply a patch.
96
97       Fixes are dependent upon their severity and my availability. Should a
98       fix not be forthcoming, please feel free to (politely) remind me.
99

SEE ALSO

101         Test::YAML::Valid
102

AUTHOR

104       Barbie, <barbie@cpan.org> for Miss Barbell Productions,
105       <http://www.missbarbell.co.uk>
106
108         Copyright (C) 2007-2015 Barbie for Miss Barbell Productions
109
110         This distribution is free software; you can redistribute it and/or
111         modify it under the Artistic Licence v2.
112
113
114
115perl v5.34.0                      2022-01-21               Test::CPAN::Meta(3)
Impressum