@@ -2,20 +2,38 @@ use 5.010;
2
2
use strict;
3
3
use warnings;
4
4
use ExtUtils::MakeMaker;
5
+ use Config;
5
6
6
- sub MY ::postamble {
7
+ # Get the filename of the Perl interpreter running this. Modified from perlvar.
8
+ # The -x test is for cygwin or other systems where $Config{perlpath} has no
9
+ # extension and $Config{_exe} is nonempty. E.g., symlink perl->perl5.10.1.exe.
10
+ # There is no "perl.exe" on such a system.
11
+ sub get_perl_filename {
12
+ my $secure_perl_path = $Config {perlpath };
13
+ if ($^O ne ' VMS' ) {
14
+ $secure_perl_path .= $Config {_exe }
15
+ unless (-x $secure_perl_path ) ||
16
+ ($secure_perl_path =~ m /$Config {_exe}$ / i );
17
+ }
18
+ return $secure_perl_path ;
19
+ } # get_perl_filename()
20
+
21
+ my $secure_perl_path = get_perl_filename();
22
+
23
+ sub MY ::postamble { # TODO also handle Windows nmake syntax (SET vs. export)
7
24
return <<EOT ;
8
25
authortest:
9
26
\t RELEASE_TESTING=1 prove -l xt"
10
27
11
28
testhere: # Run the tests from lib rather than blib
12
- \t export PERLPP_CMD="perl -Ilib bin/perlpp"; \\
13
- \t perl -Ilib -e 'use Test::Harness "runtests"; runtests \@ ARGV;' -- t/*.t
29
+ \t "$secure_perl_path " -Ilib -e 'use Test::Harness "runtests"; runtests \@ ARGV;' -- t/*.t
14
30
15
- testpacked: pack # Test the packed version
16
- \t export PERLPP_NOUSE =1 PERLPP_CMD="perl blib/perlpp"; \\
17
- \t perl -e 'use Test::Harness "runtests"; runtests \@ ARGV;' -- t/*.t
31
+ testpacked: pack # Test the packed version.
32
+ \t PERLPP_NOUSE =1 PERLPP_PERLOPTS=" blib/perlpp" \\
33
+ \t " $secure_perl_path " -Ilib -e 'use Test::Harness "runtests"; runtests \@ ARGV;' -- t/*.t
18
34
EOT
35
+ # Note: testpacked uses -Ilib so that I don't have to conditionally
36
+ # use Text::PerlPP in t/lib/PerlPPTest.pm.
19
37
} # postamble
20
38
21
39
WriteMakefile(
@@ -32,8 +50,17 @@ WriteMakefile(
32
50
},
33
51
BUILD_REQUIRES => {
34
52
' App::FatPacker' => ' 0' ,
53
+ },
54
+ TEST_REQUIRES => {
55
+ ' Capture::Tiny' => ' 0' ,
56
+ ' Carp' => ' 0' ,
57
+ ' Config' => ' 0' ,
58
+ ' File::Spec' => ' 0' ,
35
59
' IPC::Run3' => ' 0' ,
60
+ ' rlib' => ' 0' ,
36
61
' Test::More' => ' 0' ,
62
+ ' Text::ParseWords' => ' 0' ,
63
+ ' Text::Diff' => ' 0' , # for t/03-idempotency.t
37
64
},
38
65
PREREQ_PM => {
39
66
' Getopt::Long' => ' 2.5' , # Per issue #17
0 commit comments