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