Upgrade to MakeMaker 6.10_07 (from makemaker.org snapshot
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / 00setup_dummy.t
CommitLineData
45bc4d3a 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 @INC = ('../lib', 'lib');
6 }
7 else {
8 unshift @INC, 't/lib';
9 }
10}
11chdir 't';
12
13use strict;
57b1a898 14use Test::More tests => 9;
45bc4d3a 15use File::Basename;
d5d4ec93 16use File::Path;
17use File::Spec;
45bc4d3a 18
431b0fc4 19if( $^O eq 'VMS' ) {
20 # On older systems we might exceed the 8-level directory depth limit
21 # imposed by RMS. We get around this with a rooted logical, but we
22 # can't create logical names with attributes in Perl, so we do it
23 # in a DCL subprocess and put it in the job table so the parent sees it.
24 open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
25 print BFDTMP <<'COMMAND';
26$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
27$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
28COMMAND
29 close BFDTMP;
30
31 system '@bfdtesttmp.com';
32 1 while unlink 'bfdtesttmp.com';
33}
34
35
45bc4d3a 36my %Files = (
d5d4ec93 37 'Big-Dummy/lib/Big/Dummy.pm' => <<'END',
45bc4d3a 38package Big::Dummy;
39
40$VERSION = 0.01;
41
479d2113 42=head1 NAME
43
44Big::Dummy - Try "our" hot dog's
45
46=cut
47
45bc4d3a 481;
49END
50
d5d4ec93 51 'Big-Dummy/Makefile.PL' => <<'END',
45bc4d3a 52use ExtUtils::MakeMaker;
53
54printf "Current package is: %s\n", __PACKAGE__;
55
56WriteMakefile(
57 NAME => 'Big::Dummy',
58 VERSION_FROM => 'lib/Big/Dummy.pm',
479d2113 59 PREREQ_PM => { strict => 0 },
60 ABSTRACT_FROM => 'lib/Big/Dummy.pm',
61 AUTHOR => 'Michael G Schwern <schwern@pobox.com>',
45bc4d3a 62);
63END
64
d5d4ec93 65 'Big-Dummy/t/compile.t' => <<'END',
57b1a898 66print "1..2\n";
67
68print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
69print "ok 2 - TEST_VERBOSE\n";
70END
71
d5d4ec93 72 'Big-Dummy/Liar/t/sanity.t' => <<'END',
57b1a898 73print "1..3\n";
74
75print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
76print eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n";
77print "ok 3 - TEST_VERBOSE\n";
78END
79
d5d4ec93 80 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END',
45bc4d3a 81package Big::Liar;
82
83$VERSION = 0.01;
84
851;
86END
87
d5d4ec93 88 'Big-Dummy/Liar/Makefile.PL' => <<'END',
45bc4d3a 89use ExtUtils::MakeMaker;
90
91my $mm = WriteMakefile(
92 NAME => 'Big::Liar',
93 VERSION_FROM => 'lib/Big/Liar.pm',
94 _KEEP_AFTER_FLUSH => 1
95 );
96
97print "Big::Liar's vars\n";
98foreach my $key (qw(INST_LIB INST_ARCHLIB)) {
99 print "$key = $mm->{$key}\n";
100}
101END
102
d5d4ec93 103 'Problem-Module/Makefile.PL' => <<'END',
45bc4d3a 104use ExtUtils::MakeMaker;
105
106WriteMakefile(
107 NAME => 'Problem::Module',
108);
109END
110
d5d4ec93 111 'Problem-Module/subdir/Makefile.PL' => <<'END',
45bc4d3a 112printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
113
114warn "I think I'm going to be sick\n";
115die "YYYAaaaakkk\n";
116END
117
118 );
119
120while(my($file, $text) = each %Files) {
d5d4ec93 121 # Convert to a relative, native file path.
122 $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
123
45bc4d3a 124 my $dir = dirname($file);
125 mkpath $dir;
126 open(FILE, ">$file");
127 print FILE $text;
128 close FILE;
129
130 ok( -e $file, "$file created" );
131}
132
133
134pass("Setup done");