Add a test file for duck_type
[gitmo/Mouse.git] / Makefile.PL
CommitLineData
08f7a8db 1use strict;
2use warnings;
c3398f5b 3use inc::Module::Install;
4
884bf37f 5# for co-developpers
fdee07cc 6use Module::Install::XSUtil 0.19;
884bf37f 7
bd0fe31f 8system($^X, 'tool/generate-mouse-tiny.pl', 'lib/Mouse/Tiny.pm') == 0
3f9d4c2b 9 or warn "Cannot generate Mouse::Tiny: $!";
10
c3398f5b 11name 'Mouse';
12all_from 'lib/Mouse.pm';
13
ec53d678 14# Scalar::Util < 1.14 has a bug.
15# > Fixed looks_like_number(undef) to return false for perl >= 5.009002
16requires 'Scalar::Util' => 1.14;
272a1930 17
eb88905f 18test_requires 'Test::More' => 0.88;
19test_requires 'Test::Exception' => 0.27;
f1c70cbe 20# test_requires 'Test::Output' => 0.16; # too many dependencies!
21
c6cb4ba0 22include_deps 'Test::Exception'; # work around 0.27_0x (its use of diehook might be wrong)
c3398f5b 23
92ff14d0 24if($] < 5.010) {
25 recommends 'Class::C3';
26}
179ac6cc 27
98f255c5 28require 'lib/Mouse/Spec.pm'; # for the version
29
4c0fe06f 30#if(Mouse::Spec->MouseVersion =~ /_/){ # DEVEL RELEASE
31# require Carp::Always; Carp::Always->import();
32# include_deps 'Carp::Always';
33#}
98f255c5 34
fdee07cc 35# cc_available recognizes the '--pp' and '--xs' options
36my $use_xs = ($] >= 5.008_001 && cc_available());
0e81c55d 37
38if($use_xs){
7b92a82b 39 print "Mouse configured with XS.\n",
98f255c5 40 "NOTE: You can try --pp option to configure Mouse with Pure Perl.\n";
bb543d7f 41
0e81c55d 42 cc_warnings();
fdee07cc 43 use_ppport(3.19);
0e81c55d 44 cc_src_paths('xs-src');
0e81c55d 45}
46else{
7b92a82b 47 print "Mouse configured with Pure Perl.\n";
0e81c55d 48}
49
125dc1a8 50
51tests 't/*.t t/*/*.t';
52
53repository 'git://git.moose.perl.org/Mouse.git';
54
55clean_files 'lib/Mouse/Tiny.pm $(O_FILES)';
56
57
83eab7b3 58if (author_context()) {
121acb8a 59 my $require_version = Mouse::Spec->MooseVersion;
bf9f3f91 60
64f61124 61 if (eval { require Moose; Moose->VERSION($require_version) }) {
92ff14d0 62 print "You have Moose ", Moose->VERSION, ".\n";
64f61124 63 if (eval { require Module::Install::AuthorTests }) {
bd0fe31f 64 do 'tool/create-moose-compatibility-tests.pl';
314fe304 65 recursive_author_tests('xt');
66 } else {
92ff14d0 67 print "You don't have a M::I::AuthorTests.\n";
314fe304 68 }
69 } else {
92ff14d0 70 print "You don't have Moose $require_version. skipping moose compatibility test\n";
314fe304 71 }
4358792d 72
73 if($use_xs){
74 # repeat testing
75 # see also ExtUtils::MM_Any::test_via_harness()
76 my $test_via_harness = q{$(FULLPERLRUN) -MExtUtils::Command::MM -e}
bd0fe31f 77 .q{ "do 'tool/force-pp.pl'; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"}
4358792d 78 .q{ $(TEST_FILES)} . "\n";
79
80 postamble qq{test_dynamic :: test_pp\n\n}
81 . qq{test_pp :: pure_all\n}
82 . qq{\t} . $test_via_harness;
83 }
314fe304 84}
85
eb88905f 86WriteAll check_nmake => 0;