This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As requested by pudge.
[perl5.git] / t / lib / 1_compile.t
CommitLineData
7200bc44
JH
1#!./perl
2
41f7d568
MS
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
MS
8 chdir 't';
9 @INC = '../lib';
7200bc44
JH
10}
11
12use strict;
13use warnings;
6b40b044 14
cdd2acaa
JH
15# Okay, this is the list.
16
d36c8744 17my @Core_Modules = grep /\S/, <DATA>;
41f7d568 18chomp @Core_Modules;
7200bc44 19
d36c8744
JH
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
NC
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) {
b328b501
CB
40 my $todo = '';
41 $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS';
42 print "# $module compile failed\nnot " unless compile_module($module);
43 print "ok $test_num $todo\n";
7200bc44
JH
44 $test_num++;
45}
46
656b9f42
JH
47# We do this as a separate process else we'll blow the hell
48# out of our namespace.
7200bc44 49sub compile_module {
656b9f42 50 my ($module) = $_[0];
41f7d568
MS
51
52 my $out = scalar `$^X "-I../lib" lib/compmod.pl $module`;
1189d1e4
JH
53 print "# $out";
54 return $out =~ /^ok/;
7200bc44 55}
6b40b044 56
41f7d568
MS
57# These modules have no tests of their own.
58# Keep up to date with
59# http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules
60# and vice-versa. The list should only shrink.
6b40b044 61__DATA__
fd0a5cd9 62B::C
41f7d568 63B::CC
41f7d568
MS
64B::Stackobj
65ByteLoader
66CPAN
67CPAN::FirstTime
68DynaLoader
69ExtUtils::MM_NW5
70ExtUtils::Install
71ExtUtils::Liblist
72ExtUtils::Mksymlists
41f7d568 73Net::Domain
41f7d568
MS
74O
75Pod::Plainer
76Test::Harness::Iterator