develooper Front page | perl.perl5.porters | Postings from January 2001

dynamic t/lib/1_compile.t

Thread Next
From:
H . Merijn Brand
Date:
January 18, 2001 09:29
Subject:
dynamic t/lib/1_compile.t
Message ID:
20010118182519.3B90.H.M.BRAND@hccnet.nl
Dynamic? Like this?

--8<--- t/lib/1_compile.t
#!./perl

BEGIN {
    chdir '..' if -d '../pod' && -d '../t';
    @INC = 'lib';
    }

use strict;
use warnings;

my %Exceptions = (
    CGI::Fast		=> "Won't load without FCGI",
    DB_File		=> "Config specific",
    Devel::DProf	=> "Needs to run as -d:DProf",
    ExtUtils::MM_Cygwin	=> "ExtUtils::MakeMaker takes care of this test",
    ExtUtils::MM_OS2	=> "ExtUtils::MakeMaker takes care of this test",
    ExtUtils::MM_Unix	=> "ExtUtils::MakeMaker takes care of this test",
    ExtUtils::MM_VMS	=> "ExtUtils::MakeMaker takes care of this test",
    ExtUtils::MM_Win32	=> "ExtUtils::MakeMaker takes care of this test",
    File::Spec::EPOC	=> "File::Spec will take care of this test",
    File::Spec::Mac	=> "File::Spec will take care of this test",
    File::Spec::OS2	=> "File::Spec will take care of this test",
    File::Spec::Unix	=> "File::Spec will take care of this test",
    File::Spec::VMS	=> "File::Spec will take care of this test",
    File::Spec::Win32	=> "File::Spec will take care of this test",
    IO::Socket::UNIX	=> "config specific",
    );
my @Core_Modules;
foreach my $module (sort `find lib -name \*.pm`) {
    chomp;
    s!.*lib/!!;
    s!\.pm$!!;
    s!/!::!g;
    exists $Exceptions{$_} or push @Core_Modules, $_;
    }

print "1..".@Core_Modules."\n";

my $test_num = 1;
foreach my $module (@Core_Modules) {
    print "not " unless compile_module($module);
    print "ok $test_num\n";
    $test_num++;
    }


# We do this as a seperate process else we'll blow the hell out of our
# namespace.
sub compile_module {
    my($module) = @_;
    
    return scalar `./perl -Ilib t/lib/compmod.pl $module` =~ /^ok/;
    }
-->8---
-- 
H.Merijn Brand           Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.6.1, 5.7.1 & 623 on HP-UX 10.20 & 11.00, AIX 4.2
   AIX 4.3, WinNT 4.0 SP-6a, and Win2000pro often with Tk800.022 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About