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 => 15;
18 use MakeMaker::Test::Utils;
22 my $perl = which_perl;
24 $ENV{PERL_CORE} ? chdir '../lib/ExtUtils/t' : chdir 't';
30 ok( chdir 'Big-Fat-Dummy', "chdir'd to Big-Fat-Dummy" ) ||
31 diag("chdir failed: $!");
34 # The perl core test suite will run any .t file in the MANIFEST.
35 # So we have to generate this on the fly.
37 open(TEST, ">t/compile.t") or die "Can't open t/compile.t: $!";
41 END { unlink 't/compile.t' }
43 my @mpl_out = `$perl Makefile.PL PREFIX=dummy-install`;
45 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
48 my $makefile = makefile_name();
49 ok( grep(/^Writing $makefile for Big::Fat::Dummy/,
51 'Makefile.PL output looks right');
53 ok( grep(/^Current package is: main$/,
55 'Makefile.PL run in package main');
57 ok( -e $makefile, 'Makefile exists' );
59 # -M is flakey on VMS, flat out broken on Tru64 5.6.0
61 skip "stat a/mtime broken on Tru64 5.6.0", 1 if $^O eq 'dec_osf' and
64 my $mtime = (stat($makefile))[9];
65 cmp_ok( $^T, '<=', $mtime, ' its been touched' );
68 END { unlink makefile_name(), makefile_backup() }
70 my $make = make_run();
73 # Supress 'make manifest' noise
74 local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
75 my $manifest_out = `$make manifest`;
76 ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
77 ok( -s 'MANIFEST', ' its not empty' );
80 END { unlink 'MANIFEST'; }
82 my $test_out = `$make test`;
83 like( $test_out, qr/All tests successful/, 'make test' );
86 # Test 'make test TEST_VERBOSE=1'
87 my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
88 $test_out = `$make_test_verbose`;
89 like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
90 like( $test_out, qr/All tests successful/, ' successful' );
93 my $dist_test_out = `$make disttest`;
94 is( $?, 0, 'disttest' ) || diag($dist_test_out);
96 my $realclean_out = `$make realclean`;
97 is( $?, 0, 'realclean' ) || diag($realclean_out);
102 print eval "use Big::Fat::Dummy; 1;" ? "ok 1\n" : "not ok 1\n";
103 print "ok 2 - TEST_VERBOSE\n";