3 # This test puts MakeMaker through the paces of a basic perl module
4 # build, test and installation of the Big::Fat::Dummy module.
7 if( $ENV{PERL_CORE} ) {
9 @INC = ('../lib', 'lib');
12 unshift @INC, 't/lib';
17 use Test::More tests => 17;
18 use MakeMaker::Test::Utils;
22 my $perl = which_perl();
27 # On older systems we might exceed the 8-level directory depth limit
28 # imposed by RMS. We get around this with a rooted logical, but we
29 # can't create logical names with attributes in Perl, so we do it
30 # in a DCL subprocess and put it in the job table so the parent sees it.
31 open( BFDTMP, '>bfdtesttmp.com' ) || die "Error creating command file; $!";
32 print BFDTMP <<'COMMAND';
33 $ IF F$TRNLNM("PERL_CORE") .EQS. "" .AND. F$TYPE(PERL_CORE) .EQS. ""
35 $! building CPAN version
36 $ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
39 $ BFD_TEST_ROOT = F$PARSE("SYS$DISK:[-]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
41 $ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
45 system '@bfdtesttmp.com';
46 END { 1 while unlink 'bfdtesttmp.com' }
47 $root_dir = 'BFD_TEST_ROOT:[t]';
55 my $Touch_Time = calibrate_mtime();
59 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
60 diag("chdir failed: $!");
62 my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`;
64 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
67 my $makefile = makefile_name();
68 ok( grep(/^Writing $makefile for Big::Dummy/,
70 'Makefile.PL output looks right');
72 ok( grep(/^Current package is: main$/,
74 'Makefile.PL run in package main');
76 ok( -e $makefile, 'Makefile exists' );
79 my $mtime = (stat($makefile))[9];
80 cmp_ok( $Touch_Time, '<=', $mtime, ' its been touched' );
82 END { unlink makefile_name(), makefile_backup() }
84 my $make = make_run();
87 # Supress 'make manifest' noise
88 local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
89 my $manifest_out = `$make manifest`;
90 ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
91 ok( -s 'MANIFEST', ' its not empty' );
94 END { unlink 'MANIFEST'; }
96 my $test_out = `$make test`;
97 like( $test_out, qr/All tests successful/, 'make test' );
100 # Test 'make test TEST_VERBOSE=1'
101 my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
102 $test_out = `$make_test_verbose`;
103 like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
104 like( $test_out, qr/All tests successful/, ' successful' );
107 my $dist_test_out = `$make disttest`;
108 is( $?, 0, 'disttest' ) || diag($dist_test_out);
111 # Make sure init_dirscan doesn't go into the distdir
112 @mpl_out = `$perl Makefile.PL "PREFIX=dummy-install"`;
114 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
117 ok( grep(/^Writing $makefile for Big::Dummy/,
119 'init_dirscan skipped distdir') ||
122 # I know we'll get ignored errors from make here, that's ok.
123 # Send STDERR off to oblivion.
124 open(SAVERR, ">&STDERR") or die $!;
125 open(STDERR, ">".File::Spec->devnull) or die $!;
127 my $realclean_out = `$make realclean`;
128 is( $?, 0, 'realclean' ) || diag($realclean_out);
130 open(STDERR, ">&SAVERR") or die $!;