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';
15 $ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
18 use Test::More tests => 15;
19 use MakeMaker::Test::Utils;
23 my $perl = which_perl;
28 ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) ||
29 diag("chdir failed: $!");
31 my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`;
33 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
36 my $makefile = makefile_name();
37 ok( grep(/^Writing $makefile for Big::Fat::Dummy/,
39 'Makefile.PL output looks right');
41 ok( grep(/^Current package is: main$/,
43 'Makefile.PL run in package main');
45 ok( -e $makefile, 'Makefile exists' );
47 # -M is flakey on VMS.
48 my $mtime = (stat($makefile))[9];
49 ok( ($^T - $mtime) <= 0, ' its been touched' );
51 END { unlink makefile_name(), makefile_backup() }
53 # Supress 'make manifest' noise
54 open(SAVERR, ">&STDERR") || die $!;
56 my $make = make_run();
57 my $manifest_out = `$make manifest`;
58 ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
59 ok( -s 'MANIFEST', ' its not empty' );
60 open(STDERR, ">&SAVERR") || die $!;
62 END { unlink 'MANIFEST'; }
64 my $test_out = `$make test`;
65 like( $test_out, qr/All tests successful/, 'make test' );
68 # Test 'make test TEST_VERBOSE=1'
69 my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
70 $test_out = `$make_test_verbose`;
71 like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
72 like( $test_out, qr/All tests successful/, ' successful' );
75 my $dist_test_out = `$make disttest`;
76 is( $?, 0, 'disttest' ) || diag($dist_test_out);
78 my $realclean_out = `$make realclean`;
79 is( $?, 0, 'realclean' ) || diag($realclean_out);