3 plan skip_all => <<'END_HELP' unless $ENV{MOO_TEST_MD};
4 This test will not run unless you set MOO_TEST_MD to a true value.
8 all Test every dist which depends on Moose except those
9 that we know cannot be tested. This is a lot of
12 Dist::1,Dist::2,... Test the individual dists listed.
14 MooX Test all Moo extension distros.
16 1 Run the default tests. We pick 200 random dists and
21 use Test::DependentModules qw( test_module );
25 # avoid any modules that depend on these
26 my @bad_prereqs = qw(Gtk2 Padre Wx);
28 my $mcpan = MetaCPAN::API->new;
29 my $res = $mcpan->post(
30 '/search/reverse_dependencies/Moo' => {
33 query => { "match_all" => {} },
36 { term => { 'release.status' => 'latest' } },
37 { term => { 'release.authorized' => \1 } },
38 { not => { filter => {
40 map { { term => { 'dependency.module' => $_ } } } @bad_prereqs,
48 fields => ['distribution', 'provides', 'metadata.provides'],
58 for my $line (<DATA>) {
60 next unless $line =~ /\S/;
61 if ( $line =~ /^#\s*(\w+)(?::\s*(.*?)\s*)?$/ ) {
62 die "Invalid action in DATA section ($1)"
63 unless $1 eq 'SKIP' || $1 eq 'TODO';
64 $hash = $1 eq 'SKIP' ? \%skip : \%todo;
68 my ( $dist, $reason ) = $line =~ /^(\S*)\s*(?:#\s*(.*?)\s*)?$/;
69 next unless defined $dist && length $dist;
71 $hash->{$dist} = $reason || $sec_reason;
76 for my $hit (@{ $res->{hits}{hits} }) {
77 my $dist = $hit->{fields}{distribution};
79 if exists $skip{$dist};
81 if $dist =~ /^(?:Task|Bundle|Acme)-/;
83 my $module = (sort { length $a <=> length $b || $a cmp $b } do {
84 if (my $provides = $hit->{fields}{provides}) {
85 ref $provides ? @$provides : ($provides);
87 elsif (my $provides = $hit->{fields}{'metadata.provides'}) {
91 (my $module = $dist) =~ s/-/::/g;
95 $todo_module{$module} = $todo{$dist}
96 if exists $todo{$dist};
97 push @modules, $module;
100 @modules = sort @modules;
102 if ( $ENV{MOO_TEST_MD} eq 'MooX' ) {
103 @modules = grep /^MooX(?:$|::)/, @modules;
105 elsif ( $ENV{MOO_TEST_MD} eq '1' ) {
107 Picking 200 random dependents to test. Set MOO_TEST_MD=all to test all
108 dependents or MOO_TEST_MD=MooX to test extension modules only.
110 @modules = (List::Util::shuffle(@modules))[0..199];
112 elsif ( $ENV{MOO_TEST_MD} ne 'all' ) {
113 my @chosen = split /,/, $ENV{MOO_TEST_MD};
114 my %modules = map { $_ => 1 } @modules;
115 if (my @unknown = grep { !$modules{$_} } @chosen) {
116 die "Unknown modules: @unknown";
121 if (grep { $_ eq '--show' } @ARGV) {
122 print "Dependents:\n";
123 print " $_\n" for @modules;
127 plan tests => scalar @modules;
128 for my $module (@modules) {
129 local $TODO = $todo_module{$module} || '???'
130 if exists $todo_module{$module};
131 test_module($module);
144 Thrift-API-HiveClient
150 Dancer2-Session-Sereal
152 Message-Passing-ZeroMQ
157 Uninets-Check-Modules-HTTP
158 Uninets-Check-Modules-MongoDB
159 Uninets-Check-Modules-Redis
161 # SKIP: missing prereqs
165 # SKIP: bad prereq version listed
166 Dancer2-Session-Cookie
169 # TODO: broken, pending release
176 # TODO: broken by Moo change
177 Math-Rational-Approx # RT#84035
178 App-Services # RT#85255