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 $ BFD_TEST_ROOT = F$PARSE("[.t]",,,,"NO_CONCEAL")-".][000000"-"]["-"].;"+".]"
34 $ DEFINE/JOB/NOLOG/TRANSLATION=CONCEALED BFD_TEST_ROOT 'BFD_TEST_ROOT'
38 system '@bfdtesttmp.com';
39 END { 1 while unlink 'bfdtesttmp.com' }
40 $root_dir = 'BFD_TEST_ROOT:[000000]';
48 my $Touch_Time = calibrate_mtime();
52 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
53 diag("chdir failed: $!");
55 my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`;
57 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
60 my $makefile = makefile_name();
61 ok( grep(/^Writing $makefile for Big::Dummy/,
63 'Makefile.PL output looks right');
65 ok( grep(/^Current package is: main$/,
67 'Makefile.PL run in package main');
69 ok( -e $makefile, 'Makefile exists' );
72 my $mtime = (stat($makefile))[9];
73 cmp_ok( $Touch_Time, '<=', $mtime, ' its been touched' );
75 END { unlink makefile_name(), makefile_backup() }
77 my $make = make_run();
80 # Supress 'make manifest' noise
81 local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
82 my $manifest_out = `$make manifest`;
83 ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
84 ok( -s 'MANIFEST', ' its not empty' );
87 END { unlink 'MANIFEST'; }
89 my $test_out = `$make test`;
90 like( $test_out, qr/All tests successful/, 'make test' );
93 # Test 'make test TEST_VERBOSE=1'
94 my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
95 $test_out = `$make_test_verbose`;
96 like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
97 like( $test_out, qr/All tests successful/, ' successful' );
100 my $dist_test_out = `$make disttest`;
101 is( $?, 0, 'disttest' ) || diag($dist_test_out);
104 # Make sure init_dirscan doesn't go into the distdir
105 @mpl_out = `$perl Makefile.PL "PREFIX=dummy-install"`;
107 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
110 ok( grep(/^Writing $makefile for Big::Dummy/,
112 'init_dirscan skipped distdir') ||
115 # I know we'll get ignored errors from make here, that's ok.
116 # Send STDERR off to oblivion.
117 open(SAVERR, ">&STDERR") or die $!;
118 open(STDERR, ">".File::Spec->devnull) or die $!;
120 my $realclean_out = `$make realclean`;
121 is( $?, 0, 'realclean' ) || diag($realclean_out);
123 open(STDERR, ">&SAVERR") or die $!;