1N/A#!/usr/bin/perl -w
1N/A
1N/ABEGIN {
1N/A if( $ENV{PERL_CORE} ) {
1N/A chdir 't' if -d 't';
1N/A @INC = ('../lib', 'lib');
1N/A }
1N/A else {
1N/A unshift @INC, 't/lib';
1N/A }
1N/A}
1N/A
1N/Ause strict;
1N/Ause Config;
1N/A
1N/Ause Test::More tests => 8;
1N/Ause MakeMaker::Test::Utils;
1N/A
1N/A# 'make disttest' sets a bunch of environment variables which interfere
1N/A# with our testing.
1N/Adelete @ENV{qw(PREFIX LIB MAKEFLAGS)};
1N/A
1N/Amy $Perl = which_perl();
1N/Amy $Makefile = makefile_name();
1N/Amy $Is_VMS = $^O eq 'VMS';
1N/A
1N/Achdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't');
1N/Aperl_lib;
1N/A
1N/A$| = 1;
1N/A
1N/Aok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
1N/A diag("chdir failed: $!");
1N/A
1N/Aunlink $Makefile;
1N/Amy $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=1"});
1N/Aok( !-r $Makefile, "PREREQ_PRINT produces no $Makefile" );
1N/Ais( $?, 0, ' exited normally' );
1N/A{
1N/A package _Prereq::Print;
1N/A no strict;
1N/A $PREREQ_PM = undef; # shut up "used only once" warning.
1N/A eval $prereq_out;
1N/A ::is_deeply( $PREREQ_PM, { strict => 0 }, 'prereqs dumped' );
1N/A ::is( $@, '', ' without error' );
1N/A}
1N/A
1N/A
1N/A$prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
1N/Aok( !-r $Makefile, "PRINT_PREREQ produces no $Makefile" );
1N/Ais( $?, 0, ' exited normally' );
1N/A::like( $prereq_out, qr/^perl\(strict\) \s* >= \s* 0 \s*$/x,
1N/A 'prereqs dumped' );
1N/A
1N/A
1N/A# Currently a bug.
1N/A#my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=0"});
1N/A#ok( -r $Makefile, "PREREQ_PRINT=0 produces a $Makefile" );
1N/A#is( $?, 0, ' exited normally' );
1N/A#unlink $Makefile;
1N/A
1N/A# Currently a bug.
1N/A#my $prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
1N/A#ok( -r $Makefile, "PRINT_PREREQ=0 produces a $Makefile" );
1N/A#is( $?, 0, ' exited normally' );
1N/A#unlink $Makefile;