Bump version numbers of moules affected by change #22258
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / prereq_print.t
CommitLineData
2c91f887 1#!/usr/bin/perl -w
2
3BEGIN {
4 if( $ENV{PERL_CORE} ) {
5 chdir 't' if -d 't';
6 @INC = ('../lib', 'lib');
7 }
8 else {
9 unshift @INC, 't/lib';
10 }
11}
12
13use strict;
14use Config;
15
a7d1454b 16use Test::More tests => 11;
2c91f887 17use MakeMaker::Test::Utils;
a7d1454b 18use MakeMaker::Test::Setup::BFD;
2c91f887 19
20# 'make disttest' sets a bunch of environment variables which interfere
21# with our testing.
22delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
23
24my $Perl = which_perl();
25my $Makefile = makefile_name();
26my $Is_VMS = $^O eq 'VMS';
27
28chdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't');
29perl_lib;
30
31$| = 1;
32
a7d1454b 33ok( setup_recurs(), 'setup' );
34END {
35 ok( chdir File::Spec->updir );
36 ok( teardown_recurs(), 'teardown' );
37}
38
2c91f887 39ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
40 diag("chdir failed: $!");
41
42unlink $Makefile;
43my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=1"});
44ok( !-r $Makefile, "PREREQ_PRINT produces no $Makefile" );
45is( $?, 0, ' exited normally' );
46{
47 package _Prereq::Print;
48 no strict;
49 $PREREQ_PM = undef; # shut up "used only once" warning.
50 eval $prereq_out;
51 ::is_deeply( $PREREQ_PM, { strict => 0 }, 'prereqs dumped' );
52 ::is( $@, '', ' without error' );
53}
54
55
56$prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
57ok( !-r $Makefile, "PRINT_PREREQ produces no $Makefile" );
58is( $?, 0, ' exited normally' );
59::like( $prereq_out, qr/^perl\(strict\) \s* >= \s* 0 \s*$/x,
60 'prereqs dumped' );
61
62
63# Currently a bug.
64#my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=0"});
65#ok( -r $Makefile, "PREREQ_PRINT=0 produces a $Makefile" );
66#is( $?, 0, ' exited normally' );
67#unlink $Makefile;
68
69# Currently a bug.
70#my $prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
71#ok( -r $Makefile, "PRINT_PREREQ=0 produces a $Makefile" );
72#is( $?, 0, ' exited normally' );
73#unlink $Makefile;