1 ################################################################################
3 # mktests.PL -- generate test files for Devel::PPPort
5 ################################################################################
9 # $Date: 2006/06/25 06:30:35 +0200 $
11 ################################################################################
13 # Version 3.x, Copyright (C) 2004-2006, Marcus Holland-Moritz.
14 # Version 2.x, Copyright (C) 2001, Paul Marquess.
15 # Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
17 # This program is free software; you can redistribute it and/or
18 # modify it under the same terms as Perl itself.
20 ################################################################################
24 require "parts/ppptools.pl";
26 my $template = do { local $/; <DATA> };
35 for $file (glob 'parts/inc/*') {
36 my($testfile) = $file =~ /(\w+)\.?$/; # VMS has a trailing dot
37 $testfile = "t/$testfile.t";
39 my $spec = parse_partspec($file);
42 if (exists $spec->{tests}) {
43 exists $spec->{OPTIONS}{tests} &&
44 exists $spec->{OPTIONS}{tests}{plan}
45 or die "No plan for tests in $file\n";
47 print "generating $testfile\n";
50 $tmpl =~ s/__SOURCE__/$file/mg;
51 $tmpl =~ s/__PLAN__/$spec->{OPTIONS}{tests}{plan}/mg;
52 $tmpl =~ s/^__TESTS__$/$spec->{tests}/mg;
54 open FH, ">$testfile" or die "$testfile: $!\n";
58 push @tests, $testfile;
66 ################################################################################
68 # !!!!! Do NOT edit this file directly! !!!!!
70 # Edit mktests.PL and/or __SOURCE__ instead.
72 ################################################################################
75 if ($ENV{'PERL_CORE'}) {
77 @INC = ('../lib', '../ext/Devel/PPPort/t') if -d '../lib' && -d '../ext';
78 require Config; import Config;
80 if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
81 print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
91 require 'testutil.pl' if $@;
96 plan(tests => __PLAN__);
104 package Devel::PPPort;
107 @ISA = qw(DynaLoader);
108 bootstrap Devel::PPPort;