fixed up sqlt tests a bit and tried fixing 2 failing sqlt tests
[dbsrgits/DBIx-Class-Historic.git] / t / 03podcoverage.t
1 use Test::More;
2
3 eval "use Test::Pod::Coverage 1.04";
4 plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
5 plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
6
7 my @modules = sort { $a cmp $b } (all_modules());
8 plan tests => scalar(@modules);
9
10 # Since this is about checking documentation, a little documentation
11 # of what this is doing might be in order...
12 # The exceptions structure below is a hash keyed by the module
13 # name.  The value for each is a hash, which contains one or more
14 # (although currently more than one makes no sense) of the following
15 # things:-
16 #   skip   => a true value means this module is not checked
17 #   ignore => array ref containing list of methods which
18 #             do not need to be documented.
19 my $exceptions = {
20     'DBIx::Class' => {
21         ignore => [
22             qw/MODIFY_CODE_ATTRIBUTES
23               component_base_class
24               mk_classdata/
25         ]
26     },
27     'DBIx::Class::CDBICompat::AccessorMapping'          => { skip => 1 },
28     'DBIx::Class::CDBICompat::AttributeAPI'             => { skip => 1 },
29     'DBIx::Class::CDBICompat::AutoUpdate'               => { skip => 1 },
30     'DBIx::Class::CDBICompat::ColumnCase'               => { skip => 1 },
31     'DBIx::Class::CDBICompat::ColumnGroups'             => { skip => 1 },
32     'DBIx::Class::CDBICompat::Constraints'              => { skip => 1 },
33     'DBIx::Class::CDBICompat::Constructor'              => { skip => 1 },
34     'DBIx::Class::CDBICompat::DestroyWarning'           => { skip => 1 },
35     'DBIx::Class::CDBICompat::GetSet'                   => { skip => 1 },
36     'DBIx::Class::CDBICompat::HasA'                     => { skip => 1 },
37     'DBIx::Class::CDBICompat::HasMany'                  => { skip => 1 },
38     'DBIx::Class::CDBICompat::ImaDBI'                   => { skip => 1 },
39     'DBIx::Class::CDBICompat::LazyLoading'              => { skip => 1 },
40     'DBIx::Class::CDBICompat::LiveObjectIndex'          => { skip => 1 },
41     'DBIx::Class::CDBICompat::MightHave'                => { skip => 1 },
42     'DBIx::Class::CDBICompat::ObjIndexStubs'            => { skip => 1 },
43     'DBIx::Class::CDBICompat::Pager'                    => { skip => 1 },
44     'DBIx::Class::CDBICompat::ReadOnly'                 => { skip => 1 },
45     'DBIx::Class::CDBICompat::Retrieve'                 => { skip => 1 },
46     'DBIx::Class::CDBICompat::Stringify'                => { skip => 1 },
47     'DBIx::Class::CDBICompat::TempColumns'              => { skip => 1 },
48     'DBIx::Class::CDBICompat::Triggers'                 => { skip => 1 },
49     'DBIx::Class::ClassResolver::PassThrough'           => { skip => 1 },
50     'DBIx::Class::Componentised'                        => { skip => 1 },
51     'DBIx::Class::Relationship::Accessor'               => { skip => 1 },
52     'DBIx::Class::Relationship::BelongsTo'              => { skip => 1 },
53     'DBIx::Class::Relationship::CascadeActions'         => { skip => 1 },
54     'DBIx::Class::Relationship::HasMany'                => { skip => 1 },
55     'DBIx::Class::Relationship::HasOne'                 => { skip => 1 },
56     'DBIx::Class::Relationship::Helpers'                => { skip => 1 },
57     'DBIx::Class::Relationship::ManyToMany'             => { skip => 1 },
58     'DBIx::Class::Relationship::ProxyMethods'           => { skip => 1 },
59     'DBIx::Class::ResultSetProxy'                       => { skip => 1 },
60     'DBIx::Class::ResultSourceProxy'                    => { skip => 1 },
61     'DBIx::Class::Storage'                              => { skip => 1 },
62     'DBIx::Class::Storage::DBI::DB2'                    => { skip => 1 },
63     'DBIx::Class::Storage::DBI::MSSQL'                  => { skip => 1 },
64     'DBIx::Class::Storage::DBI::MultiDistinctEmulation' => { skip => 1 },
65     'DBIx::Class::Storage::DBI::ODBC400'                => { skip => 1 },
66     'DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL'      => { skip => 1 },
67     'DBIx::Class::Storage::DBI::Oracle'                 => { skip => 1 },
68     'DBIx::Class::Storage::DBI::Pg'                     => { skip => 1 },
69     'DBIx::Class::Storage::DBI::SQLite'                 => { skip => 1 },
70     'DBIx::Class::Storage::DBI::mysql'                  => { skip => 1 },
71     'SQL::Translator::Parser::DBIx::Class'              => { skip => 1 },
72     'SQL::Translator::Producer::DBIx::Class::File'      => { skip => 1 },
73 };
74
75 foreach my $module (@modules) {
76   SKIP:
77     {
78         skip "No real methods", 1 if ($exceptions->{$module}{skip});
79
80         # build parms up from ignore list
81         my $parms = {};
82         $parms->{trustme} =
83           [ map { qr/^$_$/ } @{ $exceptions->{$module}{ignore} } ]
84           if exists($exceptions->{$module}{ignore});
85
86         # run the test with the potentially modified parm set
87         pod_coverage_ok($module, $parms, "$module POD coverage");
88     }
89 }