1 use inc::Module::Install;
4 all_from 'lib/Mouse.pm';
8 # Scalar::Util < 1.14 has a bug.
9 # > Fixed looks_like_number(undef) to return false for perl >= 5.009002
10 requires 'Scalar::Util' => 1.14;
12 build_requires 'Test::Exception';
13 build_requires 'Test::More';
15 if ($Module::Install::AUTHOR) {
16 if (eval "package foo; use Moose; 1;") {
17 if (eval 'use Module::Install::AuthorTests; 1') {
18 create_moose_compatibility_test();
19 recursive_author_tests('xt');
21 print "you don't have a M::I::AuthorTests.\n";
24 print "you don't have a moose. skipping moose compatibility test\n";
31 sub create_moose_compatibility_test {
34 require File::Basename;
36 # some test does not pass... currently skip it.
38 '016-trigger.t' => "trigger's argument is incompatble :(",
39 '020-load-class.t' => "&Moose::is_class_loaded doesn't exists",
40 '019-handles.t' => 'incompatible',
41 '025-more-isa.t' => 'Class::MOP::is_class_loaded is not compatible with Mouse::is_class_loaded',
42 '029-new.t' => 'Class->new(undef) incompatible',
43 '010-isa-or.t' => 'Mouse has a [BUG]',
44 '044-attribute-metaclass.t' => 'Moose::Meta::Attribute does not have a "create"',
45 '047-attribute-metaclass-role.t' => 'Moose::Meta::Attribute does not have a "create"',
46 '201-squirrel.t' => 'skip Squirrel',
47 '202-squirrel-role.t' => 'Squirrel is ...',
48 '400-define-role.t' => 'incompatibility',
49 '600-tiny-tiny.t' => "Moose doesn't support ::Tiny",
50 '601-tiny-mouse.t' => "Moose doesn't support ::Tiny",
51 '602-mouse-tiny.t' => "Moose doesn't support ::Tiny",
52 '031_roles_applied_in_create.t' => 'wtf?',
59 my $basename = File::Basename::basename($_);
60 return if $basename =~ /^\./;
61 return if $SKIP_TEST{$basename};
63 my $dirname = File::Basename::dirname($_);
65 my $tmpdir = File::Spec->catfile('xt', 'compatibility', $dirname);
66 File::Path::make_path($tmpdir);
68 my $tmpfile = File::Spec->catfile($tmpdir, $basename);
69 open my $wfh, '>', $tmpfile or die $!;
72 open my $rfh, '<', $_ or die $!;
73 my $s = do { local $/; <$rfh> };
77 $src =~ s/Mouse/Moose/g;