This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Import Test-More 1.301001 alpha 63
[perl5.git] / cpan / Test-Simple / t / xt / dependents.t
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::Tester
23     Test::Most
24     Test::Warn
25     Test::Exception
26     Test::Class
27     Test::Deep
28     Test::Differences
29     Test::NoWarnings
30 );
31
32 # Modules which are known to be broken
33 my %Broken = map { $_ => 1 } (
34     'Test::Most',
35     'Test::Differences'
36 );
37
38 # Have to do it here because CPAN chdirs.
39 my $perl5lib = join ":", File::Spec->rel2abs("blib/lib"), File::Spec->rel2abs("lib");
40
41 TODO: for my $name (@ARGV ? @ARGV : @Modules) {
42     local $TODO = "$name known to be broken" if $Broken{$name};
43     local $ENV{PERL5LIB} = $perl5lib;
44
45     my $module = CPAN::Shell->expand("Module", $name);
46     $module->make;
47     $module->test;
48     my $test_result = $module->distribution->{make_test};
49     ok( $test_result && !$test_result->failed, $name );
50 }
51 done_testing();