line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Prereq::Build; |
2
|
3
|
|
|
3
|
|
2741
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
102
|
|
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
12
|
use parent qw(Test::Prereq); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
23
|
|
5
|
3
|
|
|
3
|
|
220
|
use vars qw($VERSION @EXPORT); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
152
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
85
|
|
8
|
3
|
|
|
3
|
|
10
|
no warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
131
|
|
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
|
|
2281
|
use Module::Build; |
|
3
|
|
|
|
|
187305
|
|
|
3
|
|
|
|
|
195
|
|
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
|
|
25
|
my $self = shift; |
70
|
2
|
|
|
|
|
6
|
my $caller = caller; |
71
|
3
|
|
|
3
|
|
22
|
no strict 'refs'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
747
|
|
72
|
2
|
|
|
|
|
4
|
*{$caller.'::prereq_ok'} = \&prereq_ok; |
|
2
|
|
|
|
|
11
|
|
73
|
|
|
|
|
|
|
|
74
|
2
|
|
|
|
|
10
|
$Test->exported_to($caller); |
75
|
2
|
|
|
|
|
29
|
$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
|
|
7
|
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
|
|
|
|
|
19
|
my %hash = @_; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my @requires = sort grep $_ ne 'perl', ( |
93
|
1
|
|
|
|
|
5
|
keys %{ $hash{requires} }, |
94
|
1
|
|
|
|
|
2
|
keys %{ $hash{build_requires} }, |
95
|
1
|
|
|
|
|
3
|
keys %{ $hash{test_requires} }, |
96
|
1
|
|
|
|
|
4
|
keys %{ $hash{configure_requires} }, |
97
|
1
|
|
|
|
|
3
|
keys %{ $hash{recommends} }, |
|
1
|
|
|
|
|
10
|
|
98
|
|
|
|
|
|
|
); |
99
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
7
|
@Test::Prereq::prereqs = @requires; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# intercept further calls to this object |
103
|
1
|
|
|
|
|
6
|
return bless {}, __PACKAGE__; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# fake Module::Build methods |
107
|
1
|
|
|
1
|
1
|
29
|
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; |