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 | |
04070b92 | 64 | delete_by_prefix('Attribute::Handlers');# we test this, and we have demos |
65 | ||
656b9f42 | 66 | sub using_feature { |
67 | my $use = "use$_[0]"; | |
68 | exists $Config{$use} && | |
69 | defined $Config{$use} && | |
70 | $Config{$use} eq 'define'; | |
71 | } | |
72 | ||
73 | unless (using_feature('threads') && has_extension('Thread')) { | |
74 | delete_by_name('Thread'); | |
290a1446 | 75 | delete_by_prefix('Thread::'); |
eba8ff18 | 76 | } |
cdd2acaa | 77 | |
a0cb3900 | 78 | unless (has_extension('NDBM_File')) { |
79 | delete_by_name('Memoize::NDBM_File'); | |
80 | } | |
81 | ||
cdd2acaa | 82 | delete_by_prefix('unicode::'); |
cdd2acaa | 83 | |
04070b92 | 84 | # Delete all modules which have their own tests. |
85 | # This makes this test a lot faster. | |
6b40b044 | 86 | foreach my $mod (<DATA>) { |
87 | chomp $mod; | |
88 | delete_by_name($mod); | |
89 | } | |
90 | ||
cdd2acaa | 91 | # Okay, this is the list. |
92 | ||
93 | my @Core_Modules = sort keys %Core_Modules; | |
7200bc44 | 94 | |
95 | print "1..".@Core_Modules."\n"; | |
96 | ||
97 | my $test_num = 1; | |
cdd2acaa | 98 | |
7200bc44 | 99 | foreach my $module (@Core_Modules) { |
17bcccd5 | 100 | print "$module compile failed\nnot " unless compile_module($module); |
7200bc44 | 101 | print "ok $test_num\n"; |
102 | $test_num++; | |
103 | } | |
104 | ||
656b9f42 | 105 | # We do this as a separate process else we'll blow the hell |
106 | # out of our namespace. | |
7200bc44 | 107 | sub compile_module { |
656b9f42 | 108 | my ($module) = $_[0]; |
7200bc44 | 109 | |
1189d1e4 | 110 | my $out = scalar `$^X "-Ilib" t/lib/compmod.pl $module`; |
111 | print "# $out"; | |
112 | return $out =~ /^ok/; | |
7200bc44 | 113 | } |
6b40b044 | 114 | |
20e80008 | 115 | # Add here modules that have their own test scripts and therefore |
116 | # need not be test-compiled by 1_compile.t. | |
6b40b044 | 117 | __DATA__ |
118 | AnyDBM_File | |
dc6b6eef | 119 | Attribute::Handlers |
6b40b044 | 120 | AutoLoader |
121 | B | |
122 | B::Debug | |
123 | B::Deparse | |
124 | B::ShowLex | |
125 | B::Stash | |
126 | Benchmark | |
127 | CGI | |
79319589 | 128 | CGI::Apache |
129 | CGI::Carp | |
130 | CGI::Cookie | |
131 | CGI::Form | |
6b40b044 | 132 | CGI::Pretty |
79319589 | 133 | CGI::Switch |
6b40b044 | 134 | CGI::Util |
135 | Carp | |
20e80008 | 136 | Carp::Heavy |
6b40b044 | 137 | Class::ISA |
138 | Class::Struct | |
46700524 | 139 | CPAN |
6b40b044 | 140 | Cwd |
141 | DB_File | |
142 | Data::Dumper | |
143 | Devel::DProf | |
144 | Devel::Peek | |
7f4f6daf | 145 | Devel::SelfStubber |
6b40b044 | 146 | Digest |
147 | Digest::MD5 | |
148 | DirHandle | |
149 | Dumpvalue | |
150 | Encode | |
151 | English | |
152 | Env | |
153 | Errno | |
154 | Exporter | |
155 | Exporter::Heavy | |
20e80008 | 156 | ExtUtils::Constant |
157 | ExtUtils::MakeMaker | |
6b40b044 | 158 | Fatal |
159 | Fcntl | |
160 | File::Basename | |
161 | File::CheckTree | |
02c8fbd5 | 162 | File::Compare |
6b40b044 | 163 | File::Copy |
164 | File::DosGlob | |
165 | File::Find | |
166 | File::Glob | |
167 | File::Path | |
168 | File::Spec | |
169 | File::Spec::Functions | |
170 | File::Temp | |
f7a45afb | 171 | File::stat |
6b40b044 | 172 | FileCache |
173 | FileHandle | |
7eade29f | 174 | Filter::Simple |
6b40b044 | 175 | Filter::Util::Call |
176 | FindBin | |
177 | GDBM_File | |
178 | Getopt::Long | |
179 | Getopt::Std | |
d763e2de | 180 | I18N::Langinfo |
20e80008 | 181 | I18N::LangTags |
0e6c72d5 | 182 | I18N::LangTags::List |
20e80008 | 183 | I18N::Collate |
6b40b044 | 184 | IO::Dir |
185 | IO::File | |
186 | IO::Handle | |
187 | IO::Pipe | |
188 | IO::Poll | |
189 | IO::Seekable | |
190 | IO::Select | |
191 | IO::Socket | |
192 | IO::Socket::INET | |
193 | IO::Socket::UNIX | |
194 | IPC::Open2 | |
195 | IPC::Open3 | |
196 | IPC::SysV | |
79319589 | 197 | Lingua::KO::Hangul::Util |
6b40b044 | 198 | List::Util |
199 | Locale::Constants | |
200 | Locale::Country | |
201 | Locale::Currency | |
202 | Locale::Language | |
20e80008 | 203 | Locale::Maketext |
6b40b044 | 204 | MIME::Base64 |
205 | MIME::QuotedPrint | |
206 | Math::BigFloat | |
207 | Math::BigInt | |
0e6c72d5 | 208 | Math::BigInt::Calc |
6b40b044 | 209 | Math::Complex |
210 | Math::Trig | |
0e6c72d5 | 211 | Memoize |
212 | Memoize::AnyDBM_File | |
213 | Memoize::Expire | |
214 | Memoize::ExpireFile | |
215 | Memoize::ExpireTest | |
216 | Memoize::NDBM_File | |
217 | Memoize::SDBM_File | |
218 | Memoize::Storable | |
6b40b044 | 219 | NDBM_File |
7eade29f | 220 | NEXT |
6b40b044 | 221 | Net::hostent |
cdbd8744 | 222 | Net::netent |
6fa754df | 223 | Net::protoent |
224 | Net::servent | |
6b40b044 | 225 | ODBM_File |
226 | Opcode | |
20e80008 | 227 | PerlIO |
6b40b044 | 228 | POSIX |
229 | Pod::Checker | |
230 | Pod::Find | |
231 | Pod::Text | |
232 | Pod::Usage | |
233 | SDBM_File | |
234 | Safe | |
235 | Scalar::Util | |
236 | Search::Dict | |
237 | SelectSaver | |
238 | SelfLoader | |
79319589 | 239 | Shell |
6b40b044 | 240 | Socket |
241 | Storable | |
242 | Switch | |
243 | Symbol | |
244 | Sys::Hostname | |
245 | Sys::Syslog | |
246 | Term::ANSIColor | |
247 | Test | |
248 | Test::Harness | |
0e6c72d5 | 249 | Test::More |
250 | Test::Simple | |
6b40b044 | 251 | Test::ParseWords |
252 | Text::Abbrev | |
253 | Text::Balanced | |
254 | Text::ParseWords | |
255 | Text::Soundex | |
256 | Text::Tabs | |
257 | Text::Wrap | |
258 | Thread | |
259 | Tie::Array | |
260 | Tie::Handle | |
261 | Tie::Hash | |
262 | Tie::RefHash | |
263 | Tie::Scalar | |
264 | Tie::SubstrHash | |
265 | Time::HiRes | |
266 | Time::Local | |
2857d2f7 | 267 | Time::gmtime |
268 | Time::localtime | |
269 | Time::tm | |
79319589 | 270 | Unicode::Collate |
271 | Unicode::Normalize | |
272 | Unicode::UCD | |
6b40b044 | 273 | UNIVERSAL |
6888c95f | 274 | User::grent |
c7506216 | 275 | User::pwent |
6b40b044 | 276 | XS::Typemap |
601f2d16 | 277 | attributes |
6b40b044 | 278 | attrs |
20e80008 | 279 | autouse |
6b40b044 | 280 | base |
281 | bytes | |
282 | charnames | |
283 | constant | |
284 | diagnostics | |
285 | fields | |
286 | integer | |
70a6dec2 | 287 | less |
6b40b044 | 288 | locale |
289 | ops | |
290 | overload | |
291 | strict | |
292 | subs | |
293 | utf8 | |
7f6172af | 294 | vars |
6b40b044 | 295 | warnings |
296 | warnings::register |