Commit | Line | Data |
7200bc44 |
1 | #!./perl |
2 | |
41f7d568 |
3 | # Modules should have their own tests. For historical reasons, some |
4 | # do not. This does basic compile tests on modules that have no tests |
5 | # of their own. |
6 | |
7200bc44 |
7 | BEGIN { |
41f7d568 |
8 | chdir 't'; |
9 | @INC = '../lib'; |
7200bc44 |
10 | } |
11 | |
12 | use strict; |
13 | use warnings; |
dc459aad |
14 | use File::Spec::Functions; |
6b40b044 |
15 | |
cdd2acaa |
16 | # Okay, this is the list. |
17 | |
d36c8744 |
18 | my @Core_Modules = grep /\S/, <DATA>; |
41f7d568 |
19 | chomp @Core_Modules; |
7200bc44 |
20 | |
d36c8744 |
21 | # Two Net:: modules need the Convert::EBCDIC if in EBDCIC. |
22 | if (ord("A") != 193 || eval { require Convert::EBCDIC }) { |
23 | push @Core_Modules, qw(Net::Cmd Net::POP3); |
24 | } |
25 | |
26 | @Core_Modules = sort @Core_Modules; |
27 | |
4c4ccc83 |
28 | print "1..".(1+@Core_Modules)."\n"; |
7200bc44 |
29 | |
4c4ccc83 |
30 | my $message |
31 | = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n"; |
32 | if (@Core_Modules) { |
33 | print "not $message"; |
34 | } else { |
35 | print $message; |
36 | } |
37 | |
38 | my $test_num = 2; |
cdd2acaa |
39 | |
7200bc44 |
40 | foreach my $module (@Core_Modules) { |
b328b501 |
41 | my $todo = ''; |
42 | $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS'; |
43 | print "# $module compile failed\nnot " unless compile_module($module); |
44 | print "ok $test_num $todo\n"; |
7200bc44 |
45 | $test_num++; |
46 | } |
47 | |
656b9f42 |
48 | # We do this as a separate process else we'll blow the hell |
49 | # out of our namespace. |
7200bc44 |
50 | sub compile_module { |
656b9f42 |
51 | my ($module) = $_[0]; |
41f7d568 |
52 | |
dc459aad |
53 | my $compmod = catfile(curdir(), 'lib', 'compmod.pl'); |
54 | my $lib = '-I' . catdir(updir(), 'lib'); |
55 | |
56 | my $out = scalar `$^X $lib $compmod $module`; |
1189d1e4 |
57 | print "# $out"; |
58 | return $out =~ /^ok/; |
7200bc44 |
59 | } |
6b40b044 |
60 | |
41f7d568 |
61 | # These modules have no tests of their own. |
62 | # Keep up to date with |
63 | # http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules |
64 | # and vice-versa. The list should only shrink. |
6b40b044 |
65 | __DATA__ |
fd0a5cd9 |
66 | B::C |
41f7d568 |
67 | B::CC |
41f7d568 |
68 | B::Stackobj |
69 | ByteLoader |
70 | CPAN |
71 | CPAN::FirstTime |
72 | DynaLoader |
73 | ExtUtils::MM_NW5 |
74 | ExtUtils::Install |
75 | ExtUtils::Liblist |
76 | ExtUtils::Mksymlists |
41f7d568 |
77 | Net::Domain |
41f7d568 |
78 | O |
79 | Pod::Plainer |
80 | Test::Harness::Iterator |