forked from Test-More/test-more
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.PL
78 lines (61 loc) · 2.03 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# A template for Makefile.PL used by Arena Networks.
# - Set the $PACKAGE variable to the name of your module.
# - Set $LAST_API_CHANGE to reflect the last version you changed the API
# of your module.
# - Fill in your dependencies in PREREQ_PM
# Alternatively, you can say the hell with this and use h2xs.
use 5.004;
use ExtUtils::MakeMaker;
$PACKAGE = 'Test::Simple';
($PACKAGE_FILE = $PACKAGE) =~ s|::|/|g;
$LAST_API_CHANGE = 0.34;
eval "require $PACKAGE";
unless ($@) { # Make sure we did find the module.
if( ${$PACKAGE.'::VERSION'} < $LAST_API_CHANGE ) {
print <<"CHANGE_WARN";
NOTE: There have been API changes between this version and any older
than version $LAST_API_CHANGE! Please read the Changes file if you
are upgrading from a version older than $LAST_API_CHANGE.
CHANGE_WARN
sleep 5;
}
}
WriteMakefile(
NAME => $PACKAGE,
VERSION_FROM => "lib/$PACKAGE_FILE.pm", # finds $VERSION
PREREQ_PM => {
Test::Harness => 2.03,
File::Spec => 0.6,
},
# Added to the core somewhere around 5.7.2.
INSTALLDIRS => $] >= 5.00702 ? 'perl' : 'site'
);
{
package MY;
sub test_via_harness {
my($self, $orig_perl, $tests) = @_;
my @perls = ($orig_perl);
push @perls, qw(
perl5.4.0
perl5.5.3
perl5.6.0
perl5.6.1
perl
perl5.8.0
perl5.8.0-ithreads
bleadperl
)
if $ENV{PERL_TEST_ALL};
my $out;
foreach my $perl (@perls) {
$out .= $self->SUPER::test_via_harness($perl, $tests) . "\n";
}
$out =~ s{-I\$\(PERL_\w*LIB\)}{}g;
return $out;
}
}
# Older versions of Test::Simple were very naughty about being required and
# exitted with 255. This overrides that behavior so it builds from CPAN.
END {
exit(0);
}