From: Karen Etheridge Date: Sat, 30 Mar 2013 16:01:06 +0000 (-0700) Subject: use TEST_REQUIRES when available X-Git-Tag: v1.002000~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3aa160d9207c554c5ac9882a9a78ed9e2da3cc9;p=gitmo%2FMoo.git use TEST_REQUIRES when available --- diff --git a/Makefile.PL b/Makefile.PL index 48c1f08..c3fd652 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,7 +4,9 @@ use 5.008001; use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; -my %BUILD_DEPS = ( +my %BUILD_DEPS = (); + +my %TEST_DEPS = ( 'Test::More' => 0.96, 'Test::Fatal' => 0.003, ); @@ -21,6 +23,14 @@ my %RUN_DEPS = ( my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 }; my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5702 }; +my $has_test_requires = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.63_03 }; + +if (not $has_test_requires) +{ + %BUILD_DEPS = (%BUILD_DEPS, %TEST_DEPS); + %TEST_DEPS = (); +} + my %extra_info = ( resources => { repository => 'git://git.shadowcat.co.uk/gitmo/Moo.git', @@ -41,12 +51,14 @@ WriteMakefile( ($mymeta_works ? ( # BUILD_REQUIRES makes MYMETA right, requires stops META being wrong BUILD_REQUIRES => \%BUILD_DEPS, + $has_test_requires ? ( TEST_REQUIRES => \%TEST_DEPS ) : (), META_ADD => { requires => \%RUN_DEPS, %extra_info } ) : ( # META_ADD both to get META right - only Makefile written META_ADD => { requires => \%RUN_DEPS, build_requires => \%BUILD_DEPS, + test_requires => \%TEST_DEPS, %extra_info, } ) @@ -59,3 +71,4 @@ WriteMakefile( ($mymeta && !$mymeta_works ? (NO_MYMETA => 1) : ()), LICENSE => 'perl', ); +