From: Florian Ragwitz Date: Sat, 24 Apr 2010 00:18:54 +0000 (+0200) Subject: Make our Makefile.PL work with recent versions of Module::Install. X-Git-Tag: 1.02~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ff140fe745c185ceea9cfcb9c82214777e158e2;p=gitmo%2FMoose.git Make our Makefile.PL work with recent versions of Module::Install. M::I now runs extra tests automatically, so we don't need Module::Install::ExtraTests anymore. Also, old versions of Module::Install::ExtraTests did enable themself by only being installed, not by the Makefile.PL actually using extra_tests(). This caused the xt/ tests to be run twice and the test harness to fail. Therefore we also make sure we have a fixed version of ::ExtraTests, if it is installed. --- diff --git a/Makefile.PL b/Makefile.PL index 78d08c1..324a455 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,10 +1,10 @@ use strict; use warnings; -use inc::Module::Install 0.91; -use Module::Install::ExtraTests; +use inc::Module::Install 0.95; use Module::Install::AuthorRequires; use 5.008001; +check_broken_extratests(); check_conflicts(); name 'Moose'; @@ -32,11 +32,10 @@ author_requires 'Test::Spelling'; author_requires 'Test::Pod::Coverage'; author_requires 'Test::NoTabs'; -if ( $Module::Install::AUTHOR || $ENV{IS_MAINTAINER} ) { +if ( is_maintainer() ) { system( $^X, 'author/extract-inline-tests' ); } -extra_tests(); tests_recursive(); WriteAll(); @@ -97,3 +96,19 @@ EOF sleep 4; } + +sub is_maintainer { + return $Module::Install::AUTHOR || $ENV{IS_MAINTAINER}; +} + +sub check_broken_extratests { + return unless is_maintainer(); + + if ( exists $Module::Install::ExtraTests::{VERSION} && Module::Install::ExtraTests->VERSION < 0.007 ) { + print STDERR <<'EOR'; +You have a broken version of Module::Install::ExtraTests installed. +Please upgrade to version 0.007 or newer and re-run Makefile.PL +EOR + exit 0; + } +}