| 1 | #!/usr/bin/perl |
| 2 | |
| 3 | # Test important dependant modules so we don't accidentally half of CPAN. |
| 4 | |
| 5 | use strict; |
| 6 | use warnings; |
| 7 | |
| 8 | use Test::More; |
| 9 | |
| 10 | BEGIN { |
| 11 | plan skip_all => "Dependents only tested when releasing" unless $ENV{PERL_RELEASING}; |
| 12 | } |
| 13 | |
| 14 | require File::Spec; |
| 15 | use CPAN; |
| 16 | |
| 17 | CPAN::HandleConfig->load; |
| 18 | $CPAN::Config->{test_report} = 0; |
| 19 | |
| 20 | # Module which depend on Test::More to test |
| 21 | my @Modules = qw( |
| 22 | Test::Most |
| 23 | Test::Warn |
| 24 | Test::Exception |
| 25 | Test::Class |
| 26 | Test::Deep |
| 27 | Test::Differences |
| 28 | Test::NoWarnings |
| 29 | ); |
| 30 | |
| 31 | # Modules which are known to be broken |
| 32 | my %Broken = map { $_ => 1 } qw( |
| 33 | ); |
| 34 | |
| 35 | TODO: for my $name (@ARGV ? @ARGV : @Modules) { |
| 36 | local $TODO = "$name known to be broken" if $Broken{$name}; |
| 37 | |
| 38 | local $ENV{PERL5LIB} = "$ENV{PERL5LIB}:" . File::Spec->rel2abs("blib/lib"); |
| 39 | my $module = CPAN::Shell->expand("Module", $name); |
| 40 | $module->test; |
| 41 | ok( !$module->distribution->{make_test}->failed, $name ); |
| 42 | } |
| 43 | |
| 44 | done_testing(); |