Rearrange test files
[gitmo/Mouse.git] / t / 800_with_external / 002-externals.t
CommitLineData
2462603a 1#!perl
2
1a3ecabc 3use constant NEED_TESTING => $ENV{RELEASE_TESTING} || (grep { $_ eq '--test' } @ARGV);
4use if !NEED_TESTING, 'Test::More' => (skip_all => "for release testing");
2462603a 5
6use strict;
7use warnings;
8use Test::Requires qw(Test::DependentModules);
9use Test::More;
10
11use Test::DependentModules qw(test_module);
12
13use Cwd qw(abs_path);
14
15note("Testing user modules which depend on Mouse");
16
17$ENV{PERL_TEST_DM_LOG_DIR} = abs_path('.');
18
19my @modules = qw(
20 MouseX::Types
21 MouseX::Types::Path::Class
22
23 MouseX::AttributeHelpers
24 MouseX::Getopt
25 MouseX::ConfigFromFile
26
27 Any::Moose
28
29 HTTP::Engine
30 HTTP::Engine::Middleware
31
32 HTML::Shakan
66a33f3d 33 Net::Google::DataAPI
2462603a 34);
35
36test_module($_) for @modules;
37
38done_testing;
39
40__END__
41# TODO
42BEGIN{
43 $ENV{PERL5OPT} = '-Mblib' if exists $INC{'blib.pm'};
44 #$ENV{PERL_CPANM_DEV} = 1;
45}
46
47use strict;
48use warnings;
49use Test::Requires qw(App::cpanminus::script);
50use Test::More;
51
52BEGIN{
53 package Test::UserModules;
54 our @ISA = qw(App::cpanminus::script);
55
56 sub init {
57 my($self) = @_;
58 $self->hook('test_user_modules', 'install_success' => \&_install_success);
59 $self->hook('test_user_modules', 'build_failure' => \&_build_failure);
60 $self->SUPER::init();
61 }
62
63 sub log {
64 my($self, @messages) = @_;
65 #Test::More->builder->note(@messages);
66 return;
67 }
68
69 sub _install_success {
70 my($args) = @_;
71 Test::More->builder->ok(1, "install $args->{module}");
72 }
73
74 sub _build_failure {
75 my($args) = @_;
76 Test::More->builder->ok(0, "install $args->{module} ($args->{message})");
77 }
78}
79
80# See also http://cpants.perl.org/dist/used_by/Any-Moose
81
82my @user_modules = qw(
83 MouseX::Types
84 MouseX::Types::Path::Class
85
86 MouseX::AttributeHelpers
87 MouseX::Getopt
88 MouseX::ConfigFromFile
89
90 Any::Moose
91
92 HTTP::Engine
93 HTTP::Engine::Middleware
94
95 git://github.com/typester/ark-perl.git
96 HTML::Shakan
97 Net::Google::API
98);
99
100my $t = Test::UserModules->new();
101$t->parse_options(@user_modules);
102$t->doit();
103
104
105done_testing;