Skip some distros with known test issues
[gitmo/Moose.git] / xt / release / pod-coverage.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 use Test::Requires {
9     'Test::Pod::Coverage' => '1.04',    # skip all if not installed
10 };
11
12 # This is a stripped down version of all_pod_coverage_ok which lets us
13 # vary the trustme parameter per module.
14 my @modules
15     = grep { !/Accessor::Native.*$/ && !/::Conflicts$/ } all_modules();
16 plan tests => scalar @modules;
17
18 my %trustme = (
19     'Class::MOP' => [
20         'DEBUG_NO_META',
21         'HAVE_ISAREV',
22         'IS_RUNNING_ON_5_10',
23         'subname',
24         'in_global_destruction',
25         'check_package_cache_flag',
26         'load_first_existing_class',
27         'is_class_loaded',
28         'load_class',
29     ],
30     'Class::MOP::Attribute' => ['process_accessors'],
31     'Class::MOP::Class'     => [
32         # deprecated
33         'alias_method',
34         'compute_all_applicable_attributes',
35         'compute_all_applicable_methods',
36
37         # unfinished feature
38         'add_dependent_meta_instance',
39         'add_meta_instance_dependencies',
40         'invalidate_meta_instance',
41         'invalidate_meta_instances',
42         'remove_dependent_meta_instance',
43         'remove_meta_instance_dependencies',
44         'update_meta_instance_dependencies',
45
46         # effectively internal
47         'check_metaclass_compatibility',
48         'clone_instance',
49         'construct_class_instance',
50         'construct_instance',
51         'create_meta_instance',
52         'reset_package_cache_flag',
53         'update_package_cache_flag',
54         'reinitialize',
55
56         # doc'd with rebless_instance
57         'rebless_instance_away',
58
59         # deprecated
60         'get_attribute_map',
61     ],
62     'Class::MOP::Class::Immutable::Trait'             => ['.+'],
63     'Class::MOP::Class::Immutable::Class::MOP::Class' => ['.+'],
64     'Class::MOP::Deprecated'                          => ['.+'],
65     'Class::MOP::Instance'                            => [
66         qw( BUILDARGS
67             bless_instance_structure
68             is_dependent_on_superclasses ),
69     ],
70     'Class::MOP::Instance' => [
71         qw( BUILDARGS
72             bless_instance_structure
73             is_dependent_on_superclasses ),
74     ],
75     'Class::MOP::Method::Accessor' => [
76         qw( generate_accessor_method
77             generate_accessor_method_inline
78             generate_clearer_method
79             generate_clearer_method_inline
80             generate_predicate_method
81             generate_predicate_method_inline
82             generate_reader_method
83             generate_reader_method_inline
84             generate_writer_method
85             generate_writer_method_inline
86             initialize_body
87             )
88     ],
89     'Class::MOP::Method::Constructor' => [
90         qw( attributes
91             generate_constructor_method
92             generate_constructor_method_inline
93             initialize_body
94             meta_instance
95             options
96             )
97     ],
98     'Class::MOP::Method::Generated' => [
99         qw( new
100             definition_context
101             is_inline
102             initialize_body
103             )
104     ],
105     'Class::MOP::MiniTrait'            => ['.+'],
106     'Class::MOP::Mixin::AttributeCore' => ['.+'],
107     'Class::MOP::Mixin::HasAttributes' => ['.+'],
108     'Class::MOP::Mixin::HasMethods'    => ['.+'],
109     'Class::MOP::Package'    => [ 'get_method_map', 'wrap_method_body' ],
110     'Moose' => ['init_meta', 'throw_error'],
111     'Moose::Error::Confess'  => ['new'],
112     'Moose::Error::Util' => ['.+'],
113     'Moose::Meta::Attribute' => [
114         qw( interpolate_class
115             throw_error
116             attach_to_class
117             )
118     ],
119     'Moose::Meta::Attribute::Native::MethodProvider::Array'   => ['.+'],
120     'Moose::Meta::Attribute::Native::MethodProvider::Bool'    => ['.+'],
121     'Moose::Meta::Attribute::Native::MethodProvider::Code'    => ['.+'],
122     'Moose::Meta::Attribute::Native::MethodProvider::Counter' => ['.+'],
123     'Moose::Meta::Attribute::Native::MethodProvider::Hash'    => ['.+'],
124     'Moose::Meta::Attribute::Native::MethodProvider::String'  => ['.+'],
125     'Moose::Meta::Class'                                      => [
126         qw( check_metaclass_compatibility
127             construct_instance
128             create_error
129             raise_error
130             reinitialize
131             superclasses
132             )
133     ],
134     'Moose::Meta::Class::Immutable::Trait' => ['.+'],
135     'Moose::Meta::Method'                  => ['throw_error'],
136     'Moose::Meta::Method::Accessor'        => [
137         qw( generate_accessor_method
138             generate_accessor_method_inline
139             generate_clearer_method
140             generate_predicate_method
141             generate_reader_method
142             generate_reader_method_inline
143             generate_writer_method
144             generate_writer_method_inline
145             new
146             )
147     ],
148     'Moose::Meta::Method::Constructor' => [
149         qw( attributes
150             initialize_body
151             meta_instance
152             new
153             options
154             )
155     ],
156     'Moose::Meta::Method::Destructor' => [ 'initialize_body', 'options' ],
157     'Moose::Meta::Method::Meta'       => ['wrap'],
158     'Moose::Meta::Role'               => [
159         qw( alias_method
160             get_method_modifier_list
161             reinitialize
162             reset_package_cache_flag
163             update_package_cache_flag
164             wrap_method_body
165             )
166     ],
167     'Moose::Meta::Mixin::AttributeCore' => ['.+'],
168     'Moose::Meta::Role::Composite' =>
169         [ 'get_method', 'get_method_list', 'has_method', 'add_method' ],
170     'Moose::Object' => ['BUILDALL', 'DEMOLISHALL'],
171     'Moose::Role' => [
172         qw( after
173             around
174             augment
175             before
176             extends
177             has
178             inner
179             override
180             super
181             with
182             init_meta )
183     ],
184     'Moose::Meta::TypeCoercion'        => ['compile_type_coercion'],
185     'Moose::Meta::TypeCoercion::Union' => ['compile_type_coercion'],
186     'Moose::Meta::TypeConstraint' => [qw( compile_type_constraint inlined )],
187     'Moose::Meta::TypeConstraint::Class' =>
188         [qw( equals is_a_type_of is_a_subtype_of )],
189     'Moose::Meta::TypeConstraint::Enum' => [qw( constraint equals )],
190     'Moose::Meta::TypeConstraint::DuckType' =>
191         [qw( constraint equals get_message )],
192     'Moose::Meta::TypeConstraint::Parameterizable' => ['.+'],
193     'Moose::Meta::TypeConstraint::Parameterized'   => ['.+'],
194     'Moose::Meta::TypeConstraint::Role' => [qw( equals is_a_type_of )],
195     'Moose::Meta::TypeConstraint::Union' => [
196         qw( compile_type_constraint
197             coercion
198             has_coercion
199             can_be_inlined
200             inline_environment )
201     ],
202     'Moose::Util'                  => ['add_method_modifier'],
203     'Moose::Util::MetaRole'        => ['apply_metaclass_roles'],
204     'Moose::Util::TypeConstraints' => ['find_or_create_type_constraint'],
205     'Moose::Util::TypeConstraints::Builtins' => ['.+'],
206 );
207
208 for my $module ( sort @modules ) {
209
210     my $trustme = [];
211     if ( $trustme{$module} ) {
212         my $methods = join '|', @{ $trustme{$module} };
213         $trustme = [qr/^(?:$methods)$/];
214     }
215
216     pod_coverage_ok(
217         $module, { trustme => $trustme },
218         "Pod coverage for $module"
219     );
220 }