[DOC PATCH] Re: [ID 20020324.002] \G bug on zero-length matches
[p5sagit/p5-mst-13.2.git] / t / lib / 1_compile.t
CommitLineData
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 7BEGIN {
41f7d568 8 chdir 't';
9 @INC = '../lib';
7200bc44 10}
11
12use strict;
13use warnings;
6b40b044 14
cdd2acaa 15# Okay, this is the list.
16
d36c8744 17my @Core_Modules = grep /\S/, <DATA>;
41f7d568 18chomp @Core_Modules;
7200bc44 19
d36c8744 20# Two Net:: modules need the Convert::EBCDIC if in EBDCIC.
21if (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
4c4ccc83 27print "1..".(1+@Core_Modules)."\n";
7200bc44 28
4c4ccc83 29my $message
30 = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n";
31if (@Core_Modules) {
32 print "not $message";
33} else {
34 print $message;
35}
36
37my $test_num = 2;
cdd2acaa 38
7200bc44 39foreach my $module (@Core_Modules) {
17bcccd5 40 print "$module compile failed\nnot " unless compile_module($module);
7200bc44 41 print "ok $test_num\n";
42 $test_num++;
43}
44
656b9f42 45# We do this as a separate process else we'll blow the hell
46# out of our namespace.
7200bc44 47sub compile_module {
656b9f42 48 my ($module) = $_[0];
41f7d568 49
50 my $out = scalar `$^X "-I../lib" lib/compmod.pl $module`;
1189d1e4 51 print "# $out";
52 return $out =~ /^ok/;
7200bc44 53}
6b40b044 54
41f7d568 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.
6b40b044 59__DATA__
41f7d568 60B::CC
61B::Disassembler
62B::Stackobj
63ByteLoader
64CPAN
65CPAN::FirstTime
66DynaLoader
67ExtUtils::MM_NW5
68ExtUtils::Install
69ExtUtils::Liblist
70ExtUtils::Mksymlists
41f7d568 71Net::Domain
41f7d568 72O
73Pod::Plainer
74Test::Harness::Iterator