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