1
1
use 5.018;
2
2
use strict;
3
3
use warnings;
4
+ use Config;
4
5
use ExtUtils::MakeMaker;
5
6
6
- sub MY ::postamble {
7
- return " authortest:\n\t RELEASE_TESTING=1 prove -l xt" ;
8
- }
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)
24
+ return <<EOT ;
25
+ authortest:
26
+ \t RELEASE_TESTING=1 prove -l xt"
27
+
28
+ testhere: # Run the tests from lib rather than blib
29
+ \t "$secure_perl_path " -Ilib -e 'use Test::Harness "runtests"; runtests \@ ARGV;' -- t/*.t
30
+ EOT
31
+ } # postamble
9
32
10
33
WriteMakefile(
11
34
NAME => ' XML::Axk' ,
@@ -16,34 +39,44 @@ WriteMakefile(
16
39
EXE_FILES => [ ' bin/axk' ],
17
40
MIN_PERL_VERSION => ' 5.018' ,
18
41
CONFIGURE_REQUIRES => {
42
+ ' Config' => ' 0' ,
19
43
' ExtUtils::MakeMaker' => ' 0' ,
44
+ ' strict' => ' 0' ,
20
45
' version' => ' 0.77' ,
46
+ ' warnings' => ' 0' ,
21
47
},
22
- BUILD_REQUIRES => {
48
+ TEST_REQUIRES => {
49
+ ' Capture::Tiny' => ' 0' ,
50
+ ' File::Spec' => ' 0' ,
51
+ ' Module::Loaded' => ' 0' ,
52
+ ' parent' => ' 0' ,
53
+ ' rlib' => ' 0' ,
23
54
' Test::More' => ' 0.92' ,
24
55
' Test::Kit' => ' 0' ,
25
56
' Test::Class' => ' 0' ,
26
57
' Test::Class::Load' => ' 0' ,
27
- ' Capture::Tiny' => ' 0' ,
28
- ' Module::Loaded' => ' 0' ,
29
- ' File::Spec' => ' 0' ,
30
58
},
31
59
PREREQ_PM => {
60
+ ' Carp' => ' 0' ,
32
61
' Data::Dumper' => ' 0' ,
62
+ ' Exporter' => ' 0' ,
33
63
' Getopt::Long' => ' 2.50' ,
34
- ' Pod::Usage' => ' 0' ,
35
- ' Pod::Find' => ' 0' ,
36
- ' Carp' => ' 0' ,
37
- # 'Web::Query' => '0',
38
- # 'Web::Query::LibXML' => '0',
64
+ ' Hash::Util::FieldHash' => ' 0' ,
65
+ ' HTML::Selector::XPath' => ' 0' ,
39
66
' Import::Into' => ' 0' ,
40
- ' Object::Tiny::XS' => ' 0' ,
41
- ' Tie::Scalar' => ' 0' ,
67
+ ' Object::Tiny' => ' 0' ,
68
+ ' Pod::Find' => ' 0' ,
69
+ ' Pod::Usage' => ' 0' ,
42
70
' Tie::Array' => ' 0' ,
43
71
' Tie::Hash' => ' 0' ,
72
+ ' Tie::Scalar' => ' 0' ,
73
+ ' vars' => ' 0' ,
74
+ # 'Web::Query' => '0',
75
+ # 'Web::Query::LibXML' => '0',
76
+ ' XML::DOM' => ' 0' ,
44
77
' XML::DOM::XPath' => ' 0' ,
45
78
' XML::Handler::BuildDOM' => ' 0' ,
46
- ' HTML::Selector::XPath ' => ' 0' ,
79
+ ' XML::SAX::ParserFactory ' => ' 0' ,
47
80
# 'XML::LibXML::jQuery' => '0',
48
81
# Do I actually need full X::L::jQuery?
49
82
},
0 commit comments