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