This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
blead doesn't include cpan/perlfaq/inc/perlfaq.tt
[perl5.git] / cpan / Test-Simple / t / xt / dependents.t
CommitLineData
2c4d5b9b
SH
1#!/usr/bin/perl
2
3# Test important dependant modules so we don't accidentally half of CPAN.
4
5use strict;
6use warnings;
7
8use Test::More;
9
10BEGIN {
11 plan skip_all => "Dependents only tested when releasing" unless $ENV{PERL_RELEASING};
12}
13
809046db 14require File::Spec;
2c4d5b9b
SH
15use CPAN;
16
17CPAN::HandleConfig->load;
18$CPAN::Config->{test_report} = 0;
19
20# Module which depend on Test::More to test
21my @Modules = qw(
07308ed1 22 Test::Tester
2c4d5b9b
SH
23 Test::Most
24 Test::Warn
25 Test::Exception
26 Test::Class
27 Test::Deep
28 Test::Differences
809046db 29 Test::NoWarnings
2c4d5b9b
SH
30);
31
32# Modules which are known to be broken
07308ed1
CG
33my %Broken = map { $_ => 1 } (
34 'Test::Most',
35 'Test::Differences'
2c4d5b9b
SH
36);
37
07308ed1
CG
38# Have to do it here because CPAN chdirs.
39my $perl5lib = join ":", File::Spec->rel2abs("blib/lib"), File::Spec->rel2abs("lib");
40
2c4d5b9b
SH
41TODO: for my $name (@ARGV ? @ARGV : @Modules) {
42 local $TODO = "$name known to be broken" if $Broken{$name};
07308ed1 43 local $ENV{PERL5LIB} = $perl5lib;
2c4d5b9b
SH
44
45 my $module = CPAN::Shell->expand("Module", $name);
07308ed1 46 $module->make;
2c4d5b9b 47 $module->test;
07308ed1
CG
48 my $test_result = $module->distribution->{make_test};
49 ok( $test_result && !$test_result->failed, $name );
2c4d5b9b 50}
2c4d5b9b 51done_testing();