1N/A#!./perl
1N/A
1N/A# Modules should have their own tests. For historical reasons, some
1N/A# do not. This does basic compile tests on modules that have no tests
1N/A# of their own.
1N/A
1N/ABEGIN {
1N/A chdir 't';
1N/A @INC = '../lib';
1N/A}
1N/A
1N/Ause strict;
1N/Ause warnings;
1N/Ause File::Spec::Functions;
1N/A
1N/A# Okay, this is the list.
1N/A
1N/Amy @Core_Modules = grep /\S/, <DATA>;
1N/Achomp @Core_Modules;
1N/A
1N/Aif (eval { require Socket }) {
1N/A push @Core_Modules, qw(Net::Domain);
1N/A # Two Net:: modules need the Convert::EBCDIC if in EBDCIC.
1N/A if (ord("A") != 193 || eval { require Convert::EBCDIC }) {
1N/A push @Core_Modules, qw(Net::Cmd Net::POP3);
1N/A }
1N/A}
1N/A
1N/A@Core_Modules = sort @Core_Modules;
1N/A
1N/Aprint "1..".(1+@Core_Modules)."\n";
1N/A
1N/Amy $message
1N/A = "ok 1 - All modules should have tests # TODO Make Schwern Poorer\n";
1N/Aif (@Core_Modules) {
1N/A print "not $message";
1N/A} else {
1N/A print $message;
1N/A}
1N/A
1N/Amy $test_num = 2;
1N/A
1N/Aforeach my $module (@Core_Modules) {
1N/A my $todo = '';
1N/A $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS';
1N/A print "# $module compile failed\nnot " unless compile_module($module);
1N/A print "ok $test_num $todo\n";
1N/A $test_num++;
1N/A}
1N/A
1N/A# We do this as a separate process else we'll blow the hell
1N/A# out of our namespace.
1N/Asub compile_module {
1N/A my ($module) = $_[0];
1N/A
1N/A my $compmod = catfile(curdir(), 'lib', 'compmod.pl');
1N/A my $lib = '-I' . catdir(updir(), 'lib');
1N/A
1N/A my $out = scalar `$^X $lib $compmod $module`;
1N/A print "# $out";
1N/A return $out =~ /^ok/;
1N/A}
1N/A
1N/A# These modules have no tests of their own.
1N/A# Keep up to date with
1N/A# http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules
1N/A# and vice-versa. The list should only shrink.
1N/A__DATA__
1N/AB::C
1N/AB::CC
1N/AB::Stackobj
1N/AByteLoader
1N/ACPAN::FirstTime
1N/ADynaLoader
1N/APod::Plainer