MM_Unix.pm : work around File::Find problem on VMS
[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
19my %Files = (
d5d4ec93 20 'Big-Dummy/lib/Big/Dummy.pm' => <<'END',
45bc4d3a 21package Big::Dummy;
22
23$VERSION = 0.01;
24
251;
26END
27
d5d4ec93 28 'Big-Dummy/Makefile.PL' => <<'END',
45bc4d3a 29use ExtUtils::MakeMaker;
30
31printf "Current package is: %s\n", __PACKAGE__;
32
33WriteMakefile(
34 NAME => 'Big::Dummy',
35 VERSION_FROM => 'lib/Big/Dummy.pm',
36 PREREQ_PM => {},
37);
38END
39
d5d4ec93 40 'Big-Dummy/t/compile.t' => <<'END',
57b1a898 41print "1..2\n";
42
43print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
44print "ok 2 - TEST_VERBOSE\n";
45END
46
d5d4ec93 47 'Big-Dummy/Liar/t/sanity.t' => <<'END',
57b1a898 48print "1..3\n";
49
50print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
51print eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n";
52print "ok 3 - TEST_VERBOSE\n";
53END
54
d5d4ec93 55 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END',
45bc4d3a 56package Big::Liar;
57
58$VERSION = 0.01;
59
601;
61END
62
d5d4ec93 63 'Big-Dummy/Liar/Makefile.PL' => <<'END',
45bc4d3a 64use ExtUtils::MakeMaker;
65
66my $mm = WriteMakefile(
67 NAME => 'Big::Liar',
68 VERSION_FROM => 'lib/Big/Liar.pm',
69 _KEEP_AFTER_FLUSH => 1
70 );
71
72print "Big::Liar's vars\n";
73foreach my $key (qw(INST_LIB INST_ARCHLIB)) {
74 print "$key = $mm->{$key}\n";
75}
76END
77
d5d4ec93 78 'Problem-Module/Makefile.PL' => <<'END',
45bc4d3a 79use ExtUtils::MakeMaker;
80
81WriteMakefile(
82 NAME => 'Problem::Module',
83);
84END
85
d5d4ec93 86 'Problem-Module/subdir/Makefile.PL' => <<'END',
45bc4d3a 87printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
88
89warn "I think I'm going to be sick\n";
90die "YYYAaaaakkk\n";
91END
92
93 );
94
95while(my($file, $text) = each %Files) {
d5d4ec93 96 # Convert to a relative, native file path.
97 $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
98
45bc4d3a 99 my $dir = dirname($file);
100 mkpath $dir;
101 open(FILE, ">$file");
102 print FILE $text;
103 close FILE;
104
105 ok( -e $file, "$file created" );
106}
107
108
109pass("Setup done");