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('.'); |
18 | |
19 | my @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 | |
36 | test_module($_) for @modules; |
37 | |
38 | done_testing; |
39 | |
40 | __END__ |
41 | # TODO |
42 | BEGIN{ |
43 | $ENV{PERL5OPT} = '-Mblib' if exists $INC{'blib.pm'}; |
44 | #$ENV{PERL_CPANM_DEV} = 1; |
45 | } |
46 | |
47 | use strict; |
48 | use warnings; |
49 | use Test::Requires qw(App::cpanminus::script); |
50 | use Test::More; |
51 | |
52 | BEGIN{ |
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 | |
82 | my @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 | |
100 | my $t = Test::UserModules->new(); |
101 | $t->parse_options(@user_modules); |
102 | $t->doit(); |
103 | |
104 | |
105 | done_testing; |