1N/A#!/usr/bin/perl -w
1N/A
1N/ABEGIN {
1N/A if( $ENV{PERL_CORE} ) {
1N/A @INC = ('../lib', 'lib');
1N/A }
1N/A else {
1N/A unshift @INC, 't/lib';
1N/A }
1N/A}
1N/Achdir 't';
1N/A
1N/Ause strict;
1N/Ause Test::More tests => 9;
1N/Ause File::Basename;
1N/Ause File::Path;
1N/Ause File::Spec;
1N/A
1N/Aif( $^O eq 'VMS' ) {
1N/A # On older systems we might exceed the 8-level directory depth limit
1N/A # imposed by RMS. We get around this with a rooted logical, but we
1N/A # can't create logical names with attributes in Perl, so we do it
1N/A # in a DCL subprocess and put it in the job table so the parent sees it.
1N/A open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
1N/A print BFDTMP <<'COMMAND';
1N/A$ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
1N/A$ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
1N/ACOMMAND
1N/A close BFDTMP;
1N/A
1N/A system '@bfdtesttmp.com';
1N/A 1 while unlink 'bfdtesttmp.com';
1N/A}
1N/A
1N/A
1N/Amy %Files = (
1N/A 'Big-Dummy/lib/Big/Dummy.pm' => <<'END',
1N/Apackage Big::Dummy;
1N/A
1N/A$VERSION = 0.01;
1N/A
1N/A=head1 NAME
1N/A
1N/ABig::Dummy - Try "our" hot dog's
1N/A
1N/A=cut
1N/A
1N/A1;
1N/AEND
1N/A
1N/A 'Big-Dummy/Makefile.PL' => <<'END',
1N/Ause ExtUtils::MakeMaker;
1N/A
1N/A# This will interfere with the PREREQ_PRINT tests.
1N/Aprintf "Current package is: %s\n", __PACKAGE__ unless "@ARGV" =~ /PREREQ/;
1N/A
1N/AWriteMakefile(
1N/A NAME => 'Big::Dummy',
1N/A VERSION_FROM => 'lib/Big/Dummy.pm',
1N/A PREREQ_PM => { strict => 0 },
1N/A ABSTRACT_FROM => 'lib/Big/Dummy.pm',
1N/A AUTHOR => 'Michael G Schwern <schwern@pobox.com>',
1N/A);
1N/AEND
1N/A
1N/A 'Big-Dummy/t/compile.t' => <<'END',
1N/Aprint "1..2\n";
1N/A
1N/Aprint eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
1N/Aprint "ok 2 - TEST_VERBOSE\n";
1N/AEND
1N/A
1N/A 'Big-Dummy/Liar/t/sanity.t' => <<'END',
1N/Aprint "1..3\n";
1N/A
1N/Aprint eval "use Big::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
1N/Aprint eval "use Big::Liar; 1;" ? "ok 2\n" : "not ok 2\n";
1N/Aprint "ok 3 - TEST_VERBOSE\n";
1N/AEND
1N/A
1N/A 'Big-Dummy/Liar/lib/Big/Liar.pm' => <<'END',
1N/Apackage Big::Liar;
1N/A
1N/A$VERSION = 0.01;
1N/A
1N/A1;
1N/AEND
1N/A
1N/A 'Big-Dummy/Liar/Makefile.PL' => <<'END',
1N/Ause ExtUtils::MakeMaker;
1N/A
1N/Amy $mm = WriteMakefile(
1N/A NAME => 'Big::Liar',
1N/A VERSION_FROM => 'lib/Big/Liar.pm',
1N/A _KEEP_AFTER_FLUSH => 1
1N/A );
1N/A
1N/Aprint "Big::Liar's vars\n";
1N/Aforeach my $key (qw(INST_LIB INST_ARCHLIB)) {
1N/A print "$key = $mm->{$key}\n";
1N/A}
1N/AEND
1N/A
1N/A 'Problem-Module/Makefile.PL' => <<'END',
1N/Ause ExtUtils::MakeMaker;
1N/A
1N/AWriteMakefile(
1N/A NAME => 'Problem::Module',
1N/A);
1N/AEND
1N/A
1N/A 'Problem-Module/subdir/Makefile.PL' => <<'END',
1N/Aprintf "\@INC %s .\n", (grep { $_ eq '.' } @INC) ? "has" : "doesn't have";
1N/A
1N/Awarn "I think I'm going to be sick\n";
1N/Adie "YYYAaaaakkk\n";
1N/AEND
1N/A
1N/A );
1N/A
1N/Awhile(my($file, $text) = each %Files) {
1N/A # Convert to a relative, native file path.
1N/A $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
1N/A
1N/A my $dir = dirname($file);
1N/A mkpath $dir;
1N/A open(FILE, ">$file");
1N/A print FILE $text;
1N/A close FILE;
1N/A
1N/A ok( -e $file, "$file created" );
1N/A}
1N/A
1N/A
1N/Apass("Setup done");