Debian Codegraph @

xt/author/test-dependents.t

raw
1 use strict;
2 use warnings;
3
4 use Cwd qw( abs_path );
5 use Test::More;
6
7 # You'd think Test::Needs would be good enough here but it'll bail out under
8 # RELEASE_TESTING if the needed module can't be loaded.
9 BEGIN {
10 if ( $] < 5.010 ) {
11 plan skip_all =>
12 'Test::DependentModules cannot be loaded on Perl 5.8.x';
13 }
14 }
15
16 use Test::Needs { 'Test::DependentModules' => '0.22' };
17
18 use Test::DependentModules 0.22 qw( test_all_dependents );
19
20 plan skip_all =>
21 'Must set LOG_DISPATCH_TEST_DEPS to true in order to run these tests'
22 unless $ENV{LOG_DISPATCH_TEST_DEPS};
23
24 local $ENV{PERL_TEST_DM_LOG_DIR} = abs_path('.');
25
26 my %known_failures = map { $_ => 1 } (
27 'Log-Dispatch-FileRotate', # Prints out broken TAP
28 'Log-Dispatch-Gtk2-Notify', # requires Gtk2
29 'Log-Dispatch-MacGrowl', # Mac only
30 'Log-Dispatch-Scribe', # fails its pod coverage test
31 'Log-Dispatch-Tk', # doesn't seem to actually exist on CPAN
32 'Log-Dispatch-Win32EventLog', # Win32 only
33 'Log-Dispatch-Wx', # requires wx
34 'Log-Dispatch-XML', # depends on non-existent Log::Dispatch::Buffer
35 'Log-Dispatch-ZMQ', # requires libzeromq and other deps
36 );
37
38 test_all_dependents(
39 'Log::Dispatch',
40 {
41 filter => sub {
42 my $dist = shift;
43 return 0 unless $dist eq 'Dist-Zilla' || $dist =~ /^Log-Dispatch/;
44 return !$known_failures{$dist};
45 }
46 },
47 );