4 chdir '..' if -d '../pod' && -d '../t';
15 unless (open(MANIFEST, "MANIFEST")) {
16 die "$0: failed to open 'MANIFEST': $!\n";
20 $Core_Modules{$_[0]}++;
24 if (m!^(lib)/(\S+?)\.pm\s!) {
25 # Collecting modules names from under ext/ would be
26 # rather painful since the mapping from filenames
27 # to module names is not 100%.
28 my ($dir, $module) = ($1, $2);
31 } elsif (m!^(lib|ext)/(\S+?)(?:\.t|/test.pl)\s!) {
32 my ($dir, $test) = ($1, $2);
33 $test =~ s!(\w+)/\1$!$1! if $dir eq 'ext';
34 $test =~ s!/t/[^/]+$!!;
42 # Delete stuff that can't be tested here.
45 delete $Core_Modules{$_[0]};
49 $Config{extensions} =~ /\b$_[0]\b/i;
52 sub delete_unless_has_extension {
53 delete $Core_Modules{$_[0]} unless has_extension($_[0]);
56 foreach my $known_extension (split(' ', $Config{known_extensions})) {
57 delete_unless_has_extension($known_extension);
60 sub delete_by_prefix {
61 for my $match (grep { /^$_[0]/ } keys %Core_Modules) {
62 delete_by_name($match);
66 delete_by_name('CGI::Fast'); # won't load without FCGI
68 delete_by_name('Devel::DProf'); # needs to be run as -d:DProf
70 delete_by_prefix('ExtUtils::MM_'); # ExtUtils::MakeMaker's domain
72 delete_by_prefix('File::Spec::'); # File::Spec's domain
73 add_by_name('File::Spec::Functions'); # put this back
75 delete_by_prefix('Attribute::Handlers');# we test this, and we have demos
79 exists $Config{$use} &&
80 defined $Config{$use} &&
81 $Config{$use} eq 'define';
84 unless (using_feature('threads') && has_extension('Thread')) {
85 delete_by_name('Thread');
86 delete_by_prefix('Thread::');
89 unless (has_extension('NDBM_File')) {
90 delete_by_name('Memoize::NDBM_File');
93 delete_by_prefix('unicode::');
95 # Delete all modules which have their own tests.
96 # This makes this test a lot faster.
97 foreach my $mod (sort keys %Test) {
100 foreach my $mod (<DATA>) {
102 print "### $mod has a test but is in DATA of $0\n" if exists $Test{$mod};
103 delete_by_name($mod);
106 # Okay, this is the list.
108 my @Core_Modules = sort keys %Core_Modules;
110 print "1..".@Core_Modules."\n";
114 foreach my $module (@Core_Modules) {
115 print "$module compile failed\nnot " unless compile_module($module);
116 print "ok $test_num\n";
120 # We do this as a separate process else we'll blow the hell
121 # out of our namespace.
123 my ($module) = $_[0];
125 my $out = scalar `$^X "-Ilib" t/lib/compmod.pl $module`;
127 return $out =~ /^ok/;
130 # Add here modules that have their own test scripts and therefore
131 # need not be test-compiled by 1_compile.t.