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 | |
128 | CGI::Pretty | |
129 | CGI::Util | |
130 | Carp | |
20e80008 | 131 | Carp::Heavy |
6b40b044 | 132 | Class::ISA |
133 | Class::Struct | |
46700524 | 134 | CPAN |
6b40b044 | 135 | Cwd |
136 | DB_File | |
137 | Data::Dumper | |
138 | Devel::DProf | |
139 | Devel::Peek | |
7f4f6daf | 140 | Devel::SelfStubber |
6b40b044 | 141 | Digest |
142 | Digest::MD5 | |
143 | DirHandle | |
144 | Dumpvalue | |
145 | Encode | |
146 | English | |
147 | Env | |
148 | Errno | |
149 | Exporter | |
150 | Exporter::Heavy | |
20e80008 | 151 | ExtUtils::Constant |
152 | ExtUtils::MakeMaker | |
6b40b044 | 153 | Fatal |
154 | Fcntl | |
155 | File::Basename | |
156 | File::CheckTree | |
02c8fbd5 | 157 | File::Compare |
6b40b044 | 158 | File::Copy |
159 | File::DosGlob | |
160 | File::Find | |
161 | File::Glob | |
162 | File::Path | |
163 | File::Spec | |
164 | File::Spec::Functions | |
165 | File::Temp | |
f7a45afb | 166 | File::stat |
6b40b044 | 167 | FileCache |
168 | FileHandle | |
7eade29f | 169 | Filter::Simple |
6b40b044 | 170 | Filter::Util::Call |
171 | FindBin | |
172 | GDBM_File | |
173 | Getopt::Long | |
174 | Getopt::Std | |
d763e2de | 175 | I18N::Langinfo |
20e80008 | 176 | I18N::LangTags |
0e6c72d5 | 177 | I18N::LangTags::List |
20e80008 | 178 | I18N::Collate |
6b40b044 | 179 | IO::Dir |
180 | IO::File | |
181 | IO::Handle | |
182 | IO::Pipe | |
183 | IO::Poll | |
184 | IO::Seekable | |
185 | IO::Select | |
186 | IO::Socket | |
187 | IO::Socket::INET | |
188 | IO::Socket::UNIX | |
189 | IPC::Open2 | |
190 | IPC::Open3 | |
191 | IPC::SysV | |
192 | List::Util | |
193 | Locale::Constants | |
194 | Locale::Country | |
195 | Locale::Currency | |
196 | Locale::Language | |
20e80008 | 197 | Locale::Maketext |
6b40b044 | 198 | MIME::Base64 |
199 | MIME::QuotedPrint | |
200 | Math::BigFloat | |
201 | Math::BigInt | |
0e6c72d5 | 202 | Math::BigInt::Calc |
6b40b044 | 203 | Math::Complex |
204 | Math::Trig | |
0e6c72d5 | 205 | Memoize |
206 | Memoize::AnyDBM_File | |
207 | Memoize::Expire | |
208 | Memoize::ExpireFile | |
209 | Memoize::ExpireTest | |
210 | Memoize::NDBM_File | |
211 | Memoize::SDBM_File | |
212 | Memoize::Storable | |
6b40b044 | 213 | NDBM_File |
7eade29f | 214 | NEXT |
6b40b044 | 215 | Net::hostent |
cdbd8744 | 216 | Net::netent |
6fa754df | 217 | Net::protoent |
218 | Net::servent | |
6b40b044 | 219 | ODBM_File |
220 | Opcode | |
20e80008 | 221 | PerlIO |
6b40b044 | 222 | POSIX |
223 | Pod::Checker | |
224 | Pod::Find | |
225 | Pod::Text | |
226 | Pod::Usage | |
227 | SDBM_File | |
228 | Safe | |
229 | Scalar::Util | |
230 | Search::Dict | |
231 | SelectSaver | |
232 | SelfLoader | |
233 | Socket | |
234 | Storable | |
235 | Switch | |
236 | Symbol | |
237 | Sys::Hostname | |
238 | Sys::Syslog | |
239 | Term::ANSIColor | |
240 | Test | |
241 | Test::Harness | |
0e6c72d5 | 242 | Test::More |
243 | Test::Simple | |
6b40b044 | 244 | Test::ParseWords |
245 | Text::Abbrev | |
246 | Text::Balanced | |
247 | Text::ParseWords | |
248 | Text::Soundex | |
249 | Text::Tabs | |
250 | Text::Wrap | |
251 | Thread | |
252 | Tie::Array | |
253 | Tie::Handle | |
254 | Tie::Hash | |
255 | Tie::RefHash | |
256 | Tie::Scalar | |
257 | Tie::SubstrHash | |
258 | Time::HiRes | |
259 | Time::Local | |
2857d2f7 | 260 | Time::gmtime |
261 | Time::localtime | |
262 | Time::tm | |
0e6c72d5 | 263 | UnicodeCD |
6b40b044 | 264 | UNIVERSAL |
6888c95f | 265 | User::grent |
c7506216 | 266 | User::pwent |
6b40b044 | 267 | XS::Typemap |
601f2d16 | 268 | attributes |
6b40b044 | 269 | attrs |
20e80008 | 270 | autouse |
6b40b044 | 271 | base |
272 | bytes | |
273 | charnames | |
274 | constant | |
275 | diagnostics | |
276 | fields | |
277 | integer | |
278 | locale | |
279 | ops | |
280 | overload | |
281 | strict | |
282 | subs | |
283 | utf8 | |
6b40b044 | 284 | warnings |
285 | warnings::register |