Commit | Line | Data |
45bc4d3a |
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | @INC = ('../lib', 'lib'); |
6 | } |
7 | else { |
8 | unshift @INC, 't/lib'; |
9 | } |
10 | } |
11 | chdir 't'; |
12 | |
13 | use strict; |
57b1a898 |
14 | use Test::More tests => 9; |
45bc4d3a |
15 | use File::Basename; |
d5d4ec93 |
16 | use File::Path; |
17 | use File::Spec; |
45bc4d3a |
18 | |
19 | my %Files = ( |
d5d4ec93 |
20 | 'Big-Dummy/lib/Big/Dummy.pm' => <<'END', |
45bc4d3a |
21 | package Big::Dummy; |
22 | |
23 | $VERSION = 0.01; |
24 | |
479d2113 |
25 | =head1 NAME |
26 | |
27 | Big::Dummy - Try "our" hot dog's |
28 | |
29 | =cut |
30 | |
45bc4d3a |
31 | 1; |
32 | END |
33 | |
d5d4ec93 |
34 | 'Big-Dummy/Makefile.PL' => <<'END', |
45bc4d3a |
35 | use ExtUtils::MakeMaker; |
36 | |
37 | printf "Current package is: %s\n", __PACKAGE__; |
38 | |
39 | WriteMakefile( |
40 | NAME => 'Big::Dummy', |
41 | VERSION_FROM => 'lib/Big/Dummy.pm', |
479d2113 |
42 | PREREQ_PM => { strict => 0 }, |
43 | ABSTRACT_FROM => 'lib/Big/Dummy.pm', |
44 | AUTHOR => 'Michael G Schwern <schwern@pobox.com>', |
45bc4d3a |
45 | ); |
46 | END |
47 | |
d5d4ec93 |
48 | 'Big-Dummy/t/compile.t' => <<'END', |
57b1a898 |
49 | print "1..2\n"; |
50 | |
51 | print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; |
52 | print "ok 2 - TEST_VERBOSE\n"; |
53 | END |
54 | |
d5d4ec93 |
55 | 'Big-Dummy/Liar/t/sanity.t' => <<'END', |
57b1a898 |
56 | print "1..3\n"; |
57 | |
58 | print eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n"; |
59 | print eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n"; |
60 | print "ok 3 - TEST_VERBOSE\n"; |
61 | END |
62 | |
d5d4ec93 |
63 | 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END', |
45bc4d3a |
64 | package Big::Liar; |
65 | |
66 | $VERSION = 0.01; |
67 | |
68 | 1; |
69 | END |
70 | |
d5d4ec93 |
71 | 'Big-Dummy/Liar/Makefile.PL' => <<'END', |
45bc4d3a |
72 | use ExtUtils::MakeMaker; |
73 | |
74 | my $mm = WriteMakefile( |
75 | NAME => 'Big::Liar', |
76 | VERSION_FROM => 'lib/Big/Liar.pm', |
77 | _KEEP_AFTER_FLUSH => 1 |
78 | ); |
79 | |
80 | print "Big::Liar's vars\n"; |
81 | foreach my $key (qw(INST_LIB INST_ARCHLIB)) { |
82 | print "$key = $mm->{$key}\n"; |
83 | } |
84 | END |
85 | |
d5d4ec93 |
86 | 'Problem-Module/Makefile.PL' => <<'END', |
45bc4d3a |
87 | use ExtUtils::MakeMaker; |
88 | |
89 | WriteMakefile( |
90 | NAME => 'Problem::Module', |
91 | ); |
92 | END |
93 | |
d5d4ec93 |
94 | 'Problem-Module/subdir/Makefile.PL' => <<'END', |
45bc4d3a |
95 | printf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have"; |
96 | |
97 | warn "I think I'm going to be sick\n"; |
98 | die "YYYAaaaakkk\n"; |
99 | END |
100 | |
101 | ); |
102 | |
103 | while(my($file, $text) = each %Files) { |
d5d4ec93 |
104 | # Convert to a relative, native file path. |
105 | $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file); |
106 | |
45bc4d3a |
107 | my $dir = dirname($file); |
108 | mkpath $dir; |
109 | open(FILE, ">$file"); |
110 | print FILE $text; |
111 | close FILE; |
112 | |
113 | ok( -e $file, "$file created" ); |
114 | } |
115 | |
116 | |
117 | pass("Setup done"); |