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