Commit | Line | Data |
2462603a |
1 | #!perl |
2 | |
1a3ecabc |
3 | use constant NEED_TESTING => $ENV{RELEASE_TESTING} || (grep { $_ eq '--test' } @ARGV); |
4 | use if !NEED_TESTING, 'Test::More' => (skip_all => "for release testing"); |
2462603a |
5 | |
6 | use strict; |
7 | use warnings; |
8 | use Test::Requires qw(Test::DependentModules); |
9 | use Test::More; |
10 | |
11 | use Test::DependentModules qw(test_module); |
12 | |
13 | use Cwd qw(abs_path); |
14 | |
15 | note("Testing user modules which depend on Mouse"); |
16 | |
17 | $ENV{PERL_TEST_DM_LOG_DIR} = abs_path('.'); |
21da4e86 |
18 | delete $ENV{ANY_MOOSE}; # use Mouse by default |
2462603a |
19 | |
20 | my @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 | |
37 | test_module($_) for @modules; |
38 | |
39 | done_testing; |
40 | |
41 | __END__ |
42 | # TODO |
43 | BEGIN{ |
44 | $ENV{PERL5OPT} = '-Mblib' if exists $INC{'blib.pm'}; |
45 | #$ENV{PERL_CPANM_DEV} = 1; |
46 | } |
47 | |
48 | use strict; |
49 | use warnings; |
50 | use Test::Requires qw(App::cpanminus::script); |
51 | use Test::More; |
52 | |
53 | BEGIN{ |
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 | |
83 | my @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 | |
101 | my $t = Test::UserModules->new(); |
102 | $t->parse_options(@user_modules); |
103 | $t->doit(); |
104 | |
105 | |
106 | done_testing; |