Commit | Line | Data |
---|---|---|
7200bc44 | 1 | #!./perl |
2 | ||
3 | BEGIN { | |
4 | chdir '..' if -d '../pod' && -d '../t'; | |
5 | @INC = 'lib'; | |
6 | } | |
7 | ||
8 | use strict; | |
9 | use warnings; | |
cdd2acaa | 10 | use Config; |
7200bc44 | 11 | |
cdd2acaa | 12 | my %Core_Modules; |
13 | ||
656b9f42 | 14 | unless (open(MANIFEST, "MANIFEST")) { |
15 | die "$0: failed to open 'MANIFEST': $!\n"; | |
16 | } | |
17 | ||
18 | sub add_by_name { | |
19 | $Core_Modules{$_[0]}++; | |
20 | } | |
21 | ||
22 | while (<MANIFEST>) { | |
23 | next unless m!^lib/(\S+?)\.pm!; | |
24 | my $module = $1; | |
25 | $module =~ s!/!::!g; | |
26 | add_by_name($module); | |
27 | } | |
28 | ||
29 | close(MANIFEST); | |
cdd2acaa | 30 | |
31 | # Delete stuff that can't be tested here. | |
32 | ||
656b9f42 | 33 | sub delete_by_name { |
34 | delete $Core_Modules{$_[0]}; | |
35 | } | |
36 | ||
37 | sub has_extension { | |
38 | $Config{extensions} =~ /\b$_[0]\b/i; | |
39 | } | |
40 | ||
41 | sub delete_unless_has_extension { | |
42 | delete $Core_Modules{$_[0]} unless has_extension($_[0]); | |
cdd2acaa | 43 | } |
44 | ||
45 | foreach my $known_extension (split(' ', $Config{known_extensions})) { | |
656b9f42 | 46 | delete_unless_has_extension($known_extension); |
cdd2acaa | 47 | } |
48 | ||
49 | sub delete_by_prefix { | |
656b9f42 | 50 | for my $match (grep { /^$_[0]/ } keys %Core_Modules) { |
51 | delete_by_name($match); | |
52 | } | |
cdd2acaa | 53 | } |
54 | ||
656b9f42 | 55 | delete_by_name('CGI::Fast'); # won't load without FCGI |
cdd2acaa | 56 | |
656b9f42 | 57 | delete_by_name('Devel::DProf'); # needs to be run as -d:DProf |
cdd2acaa | 58 | |
59 | delete_by_prefix('ExtUtils::MM_'); # ExtUtils::MakeMaker's domain | |
60 | ||
61 | delete_by_prefix('File::Spec::'); # File::Spec's domain | |
656b9f42 | 62 | add_by_name('File::Spec::Functions'); # put this back |
cdd2acaa | 63 | |
656b9f42 | 64 | sub using_feature { |
65 | my $use = "use$_[0]"; | |
66 | exists $Config{$use} && | |
67 | defined $Config{$use} && | |
68 | $Config{$use} eq 'define'; | |
69 | } | |
70 | ||
71 | unless (using_feature('threads') && has_extension('Thread')) { | |
72 | delete_by_name('Thread'); | |
290a1446 | 73 | delete_by_prefix('Thread::'); |
eba8ff18 | 74 | } |
cdd2acaa | 75 | |
76 | delete_by_prefix('unicode::'); | |
656b9f42 | 77 | add_by_name('unicode::distinct'); # put this back |
cdd2acaa | 78 | |
6b40b044 | 79 | |
80 | # Delete all modules which have their own tests. This makes | |
46700524 | 81 | # this test a lot faster. |
6b40b044 | 82 | foreach my $mod (<DATA>) { |
83 | chomp $mod; | |
84 | delete_by_name($mod); | |
85 | } | |
86 | ||
cdd2acaa | 87 | # Okay, this is the list. |
88 | ||
89 | my @Core_Modules = sort keys %Core_Modules; | |
7200bc44 | 90 | |
91 | print "1..".@Core_Modules."\n"; | |
92 | ||
93 | my $test_num = 1; | |
cdd2acaa | 94 | |
7200bc44 | 95 | foreach my $module (@Core_Modules) { |
cdd2acaa | 96 | print "# $module compile failed\nnot " unless compile_module($module); |
7200bc44 | 97 | print "ok $test_num\n"; |
98 | $test_num++; | |
99 | } | |
100 | ||
656b9f42 | 101 | # We do this as a separate process else we'll blow the hell |
102 | # out of our namespace. | |
7200bc44 | 103 | sub compile_module { |
656b9f42 | 104 | my ($module) = $_[0]; |
7200bc44 | 105 | |
bdc55ba4 | 106 | return scalar `$^X "-Ilib" t/lib/compmod.pl $module` =~ /^ok/; |
7200bc44 | 107 | } |
6b40b044 | 108 | |
20e80008 | 109 | # Add here modules that have their own test scripts and therefore |
110 | # need not be test-compiled by 1_compile.t. | |
6b40b044 | 111 | __DATA__ |
112 | AnyDBM_File | |
113 | AutoLoader | |
114 | B | |
115 | B::Debug | |
116 | B::Deparse | |
117 | B::ShowLex | |
118 | B::Stash | |
119 | Benchmark | |
120 | CGI | |
121 | CGI::Pretty | |
122 | CGI::Util | |
123 | Carp | |
20e80008 | 124 | Carp::Heavy |
6b40b044 | 125 | Class::ISA |
126 | Class::Struct | |
46700524 | 127 | CPAN |
6b40b044 | 128 | Cwd |
129 | DB_File | |
130 | Data::Dumper | |
131 | Devel::DProf | |
132 | Devel::Peek | |
7f4f6daf | 133 | Devel::SelfStubber |
6b40b044 | 134 | Digest |
135 | Digest::MD5 | |
136 | DirHandle | |
137 | Dumpvalue | |
138 | Encode | |
139 | English | |
140 | Env | |
141 | Errno | |
142 | Exporter | |
143 | Exporter::Heavy | |
20e80008 | 144 | ExtUtils::Constant |
145 | ExtUtils::MakeMaker | |
6b40b044 | 146 | Fatal |
147 | Fcntl | |
148 | File::Basename | |
149 | File::CheckTree | |
150 | File::Copy | |
151 | File::DosGlob | |
152 | File::Find | |
153 | File::Glob | |
154 | File::Path | |
155 | File::Spec | |
156 | File::Spec::Functions | |
157 | File::Temp | |
f7a45afb | 158 | File::stat |
6b40b044 | 159 | FileCache |
160 | FileHandle | |
7eade29f | 161 | Filter::Simple |
6b40b044 | 162 | Filter::Util::Call |
163 | FindBin | |
164 | GDBM_File | |
165 | Getopt::Long | |
166 | Getopt::Std | |
20e80008 | 167 | I18N::LangTags |
168 | I18N::Collate | |
6b40b044 | 169 | IO::Dir |
170 | IO::File | |
171 | IO::Handle | |
172 | IO::Pipe | |
173 | IO::Poll | |
174 | IO::Seekable | |
175 | IO::Select | |
176 | IO::Socket | |
177 | IO::Socket::INET | |
178 | IO::Socket::UNIX | |
179 | IPC::Open2 | |
180 | IPC::Open3 | |
181 | IPC::SysV | |
182 | List::Util | |
183 | Locale::Constants | |
184 | Locale::Country | |
185 | Locale::Currency | |
186 | Locale::Language | |
20e80008 | 187 | Locale::Maketext |
6b40b044 | 188 | MIME::Base64 |
189 | MIME::QuotedPrint | |
190 | Math::BigFloat | |
191 | Math::BigInt | |
192 | Math::Complex | |
193 | Math::Trig | |
194 | NDBM_File | |
7eade29f | 195 | NEXT |
6b40b044 | 196 | Net::hostent |
cdbd8744 | 197 | Net::netent |
6fa754df | 198 | Net::protoent |
199 | Net::servent | |
6b40b044 | 200 | ODBM_File |
201 | Opcode | |
20e80008 | 202 | PerlIO |
6b40b044 | 203 | POSIX |
204 | Pod::Checker | |
205 | Pod::Find | |
206 | Pod::Text | |
207 | Pod::Usage | |
208 | SDBM_File | |
209 | Safe | |
210 | Scalar::Util | |
211 | Search::Dict | |
212 | SelectSaver | |
213 | SelfLoader | |
214 | Socket | |
215 | Storable | |
216 | Switch | |
217 | Symbol | |
218 | Sys::Hostname | |
219 | Sys::Syslog | |
220 | Term::ANSIColor | |
221 | Test | |
222 | Test::Harness | |
223 | Test::ParseWords | |
224 | Text::Abbrev | |
225 | Text::Balanced | |
226 | Text::ParseWords | |
227 | Text::Soundex | |
228 | Text::Tabs | |
229 | Text::Wrap | |
230 | Thread | |
231 | Tie::Array | |
232 | Tie::Handle | |
233 | Tie::Hash | |
234 | Tie::RefHash | |
235 | Tie::Scalar | |
236 | Tie::SubstrHash | |
237 | Time::HiRes | |
238 | Time::Local | |
239 | Time::Piece | |
240 | UNIVERSAL | |
6888c95f | 241 | User::grent |
c7506216 | 242 | User::pwent |
6b40b044 | 243 | XS::Typemap |
244 | attrs | |
20e80008 | 245 | autouse |
6b40b044 | 246 | base |
247 | bytes | |
248 | charnames | |
249 | constant | |
250 | diagnostics | |
251 | fields | |
252 | integer | |
253 | locale | |
254 | ops | |
255 | overload | |
256 | strict | |
257 | subs | |
258 | utf8 | |
6b40b044 | 259 | warnings |
260 | warnings::register |