A warning wasn't turnable off
[p5sagit/p5-mst-13.2.git] / t / lib / 1_compile.t
1 #!./perl
2
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
7 BEGIN {
8     chdir 't';
9     @INC = '../lib';
10 }
11
12 use strict;
13 use warnings;
14
15 # Okay, this is the list.
16
17 my @Core_Modules = grep /\S/, <DATA>;
18 chomp @Core_Modules;
19
20 # Two Net:: modules need the Convert::EBCDIC if in EBDCIC.
21 if (ord("A") != 193 || eval { require Convert::EBCDIC }) {
22     push @Core_Modules, qw(Net::Cmd Net::POP3);
23 }
24
25 @Core_Modules = sort @Core_Modules;
26
27 print "1..".(1+@Core_Modules)."\n";
28
29 my $message
30   = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n";
31 if (@Core_Modules) {
32   print "not $message";
33 } else {
34   print $message;
35 }
36
37 my $test_num = 2;
38
39 foreach my $module (@Core_Modules) {
40     print "$module compile failed\nnot " unless compile_module($module);
41     print "ok $test_num\n";
42     $test_num++;
43 }
44
45 # We do this as a separate process else we'll blow the hell
46 # out of our namespace.
47 sub compile_module {
48     my ($module) = $_[0];
49
50     my $out = scalar `$^X "-I../lib" lib/compmod.pl $module`;
51     print "# $out";
52     return $out =~ /^ok/;
53 }
54
55 # These modules have no tests of their own.
56 # Keep up to date with
57 # http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules
58 # and vice-versa.  The list should only shrink.
59 __DATA__
60 B::CC
61 B::Disassembler
62 B::Stackobj
63 ByteLoader
64 CPAN
65 CPAN::FirstTime
66 DynaLoader
67 ExtUtils::MM_NW5
68 ExtUtils::Install
69 ExtUtils::Liblist
70 ExtUtils::Mksymlists
71 Net::Domain
72 O
73 Pod::Plainer
74 Test::Harness::Iterator