line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Prereq::Build; |
2
|
3
|
|
|
3
|
|
3264
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
101
|
|
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
16
|
use parent qw(Test::Prereq); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
19
|
|
5
|
3
|
|
|
3
|
|
205
|
use vars qw($VERSION @EXPORT); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
140
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
29
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
109
|
|
8
|
3
|
|
|
3
|
|
17
|
no warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
175
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=encoding utf8 |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Test::Prereq::Build - test prerequisites in Module::Build scripts |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use Test::Prereq::Build; |
19
|
|
|
|
|
|
|
prereq_ok(); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$VERSION = '2.002'; |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
3
|
|
1730
|
use Module::Build; |
|
3
|
|
|
|
|
215778
|
|
|
3
|
|
|
|
|
222
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $Test = __PACKAGE__->builder; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
If you have problems, send me your F. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This module overrides methods in C to make it work with |
34
|
|
|
|
|
|
|
C. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
This module does not have any public methods. See L. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
To make everything work out with C, this module overrides |
39
|
|
|
|
|
|
|
some methods to do nothing. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=over 4 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item create_build_script |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item add_build_element |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item args |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item notes |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
brian d foy, C<< >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Copyright © 2002-2015, brian d foy . All rights reserved. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
62
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub import |
68
|
|
|
|
|
|
|
{ |
69
|
2
|
|
|
2
|
|
17
|
my $self = shift; |
70
|
2
|
|
|
|
|
7
|
my $caller = caller; |
71
|
3
|
|
|
3
|
|
27
|
no strict 'refs'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
800
|
|
72
|
2
|
|
|
|
|
5
|
*{$caller.'::prereq_ok'} = \&prereq_ok; |
|
2
|
|
|
|
|
11
|
|
73
|
|
|
|
|
|
|
|
74
|
2
|
|
|
|
|
11
|
$Test->exported_to($caller); |
75
|
2
|
|
|
|
|
25
|
$Test->plan(@_); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub prereq_ok |
79
|
|
|
|
|
|
|
{ |
80
|
0
|
0
|
|
0
|
1
|
0
|
$Test->plan( tests => 1 ) unless $Test->has_plan; |
81
|
0
|
|
|
|
|
0
|
__PACKAGE__->_prereq_check( @_ ); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
1
|
|
13
|
sub _master_file { 'Build.PL' } |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# override Module::Build |
87
|
|
|
|
|
|
|
sub Module::Build::new { |
88
|
1
|
|
|
1
|
0
|
4
|
my $class = shift; |
89
|
|
|
|
|
|
|
|
90
|
1
|
|
|
|
|
50
|
my %hash = @_; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my @requires = sort grep $_ ne 'perl', ( |
93
|
1
|
|
|
|
|
5
|
keys %{ $hash{requires} }, |
94
|
1
|
|
|
|
|
4
|
keys %{ $hash{build_requires} }, |
95
|
1
|
|
|
|
|
3
|
keys %{ $hash{test_requires} }, |
96
|
1
|
|
|
|
|
5
|
keys %{ $hash{configure_requires} }, |
97
|
1
|
|
|
|
|
4
|
keys %{ $hash{recommends} }, |
|
1
|
|
|
|
|
11
|
|
98
|
|
|
|
|
|
|
); |
99
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
10
|
@Test::Prereq::prereqs = @requires; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# intercept further calls to this object |
103
|
1
|
|
|
|
|
7
|
return bless {}, __PACKAGE__; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# fake Module::Build methods |
107
|
1
|
|
|
1
|
1
|
37
|
sub create_build_script { 1 }; |
108
|
0
|
|
|
0
|
1
|
|
sub add_build_element { 1 }; |
109
|
0
|
|
|
0
|
1
|
|
sub args { 1 }; |
110
|
0
|
|
|
0
|
1
|
|
sub notes { 1 }; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; |