1 # COMPAT_TEST=1 genrates Moose compatible tests
4 if(grep{ $_ eq '--author' } @ARGV){
5 print "$^X -S cpanm < author/requires.cpanm\n";
6 system "$^X -S cpanm < author/requires.cpanm";
15 # author requires, or bundled modules
17 inc::Module::Install 1.00
18 Module::Install::TestTarget 0.13
19 Module::Install::AuthorTests 0.002
20 Module::Install::XSUtil 0.36
21 Test::Exception::LessClever 0.005
25 while(my($mod, $ver) = splice @devmods, 0, 2) {
26 eval qq{use $mod $ver (); 1} or push @not_available, $mod;
29 print qq{# The following modules are not available.\n};
30 print qq{# `perl $0 | cpanm` will install them:\n};
31 print $_, "\n" for @not_available;
35 use inc::Module::Install;
37 all_from 'lib/Mouse.pm';
39 # Scalar::Util < 1.14 has a bug.
40 # > Fixed looks_like_number(undef) to return false for perl >= 5.009002
41 requires 'Scalar::Util' => 1.14;
43 test_requires 'Test::More' => 0.88;
45 # to keep zero-dependencies
46 include 'Test::Exception::LessClever';
47 include 'Test::Requires';
52 'MouseX::AttributeHelpers' => 0.06,
53 'MouseX::NativeTraits' => 1.00,
55 while(my($mod, $least) = each %suggests){
56 my $status = system $^X, '-e', <<"CHECK";
57 if(eval q{ use $mod (); 1 }) {
58 if(eval q{ use $mod $least (); 1 }) {
59 exit 0; # installd, and new enough
62 exit 1; # installed, but too old
68 my $ver = `$^X -e "use $mod (); print $mod->VERSION"`;
70 "WARNING: $mod is installed, but its version ($ver) is too old (< $least).\n",
71 " Please update $mod after installation of Mouse.\n",
77 # cc_want deals with the '--pp' and '--xs' options
78 my $use_xs = ($] >= 5.008_001 && want_xs());
81 print "Mouse configured with XS.\n";
86 cc_src_paths('xs-src');
88 test_target test_pp => (
89 env => { PERL_ONLY => 1 },
90 ($Module::Install::AUTHOR ? (alias => 'test') : ()),
95 print "Mouse configured with Pure Perl.\n";
98 tests 't/*.t t/*/*.t';
101 repository 'git://git.moose.perl.org/Mouse.git';
103 system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
104 or warn "Cannot generate Mouse::Tiny: $!";
105 makemaker_args PL_FILES => {
106 'tool/generate-mouse-tiny.pl' => 'lib/Mouse/Tiny.pm',
109 if ($Module::Install::AUTHOR) {
110 require 'lib/Mouse/Spec.pm'; # for the version
111 my $require_version = Mouse::Spec->MooseVersion;
113 if ($ENV{COMPAT_TEST}
114 && eval { require Moose; Moose->VERSION($require_version) }) {
115 print "You have Moose ", Moose->VERSION, ".\n";
116 do 'tool/create-moose-compatibility-tests.pl';
117 test_target test_moose => (
118 tests => ['xt/compat/t/*/*.t'],
122 print "You don't have Moose $require_version. skipping moose compatibility test\n";
126 # Hack to disable Test::Exception, which might pull a perl internal bug.
127 # See also Test::Exception::LessClever.
128 open my $out, '>', 'inc/Test/Exception.pm' or die $!;
130 package Test::Exception; # wapper to T::E::LessClever
131 require Test::Exception::LessClever;
132 $INC{'Test/Exception.pm'} = __FILE__;
135 Test::Exception::LessClever->export_to_level(1, @_);
139 close $out or die $!;
143 lib/Mouse/Tiny.pm $(O_FILES) test-mydeps-*.log
145 cover_db xs-src/*.gc{v,no,da}
148 WriteAll check_nmake => 0;