Fix an env setting
[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('.');
21da4e86 18delete $ENV{ANY_MOOSE}; # use Mouse by default
2462603a 19
20my @modules = qw(
21 MouseX::Types
22 MouseX::Types::Path::Class
23
24 MouseX::AttributeHelpers
25 MouseX::Getopt
26 MouseX::ConfigFromFile
27
28 Any::Moose
29
30 HTTP::Engine
31 HTTP::Engine::Middleware
32
33 HTML::Shakan
66a33f3d 34 Net::Google::DataAPI
2462603a 35);
36
37test_module($_) for @modules;
38
39done_testing;
40
41__END__
42# TODO
43BEGIN{
44 $ENV{PERL5OPT} = '-Mblib' if exists $INC{'blib.pm'};
45 #$ENV{PERL_CPANM_DEV} = 1;
46}
47
48use strict;
49use warnings;
50use Test::Requires qw(App::cpanminus::script);
51use Test::More;
52
53BEGIN{
54 package Test::UserModules;
55 our @ISA = qw(App::cpanminus::script);
56
57 sub init {
58 my($self) = @_;
59 $self->hook('test_user_modules', 'install_success' => \&_install_success);
60 $self->hook('test_user_modules', 'build_failure' => \&_build_failure);
61 $self->SUPER::init();
62 }
63
64 sub log {
65 my($self, @messages) = @_;
66 #Test::More->builder->note(@messages);
67 return;
68 }
69
70 sub _install_success {
71 my($args) = @_;
72 Test::More->builder->ok(1, "install $args->{module}");
73 }
74
75 sub _build_failure {
76 my($args) = @_;
77 Test::More->builder->ok(0, "install $args->{module} ($args->{message})");
78 }
79}
80
81# See also http://cpants.perl.org/dist/used_by/Any-Moose
82
83my @user_modules = qw(
84 MouseX::Types
85 MouseX::Types::Path::Class
86
87 MouseX::AttributeHelpers
88 MouseX::Getopt
89 MouseX::ConfigFromFile
90
91 Any::Moose
92
93 HTTP::Engine
94 HTTP::Engine::Middleware
95
96 git://github.com/typester/ark-perl.git
97 HTML::Shakan
98 Net::Google::API
99);
100
101my $t = Test::UserModules->new();
102$t->parse_options(@user_modules);
103$t->doit();
104
105
106done_testing;