Skip to content

Commit 8793a21

Browse files
sproutmohawk2
authored andcommitted
Reinstate %Recognized_Att_Keys
1 parent f5cdee6 commit 8793a21

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ t/prereq.t
137137
t/prereq_print.t
138138
t/problems.t
139139
t/prompt.t
140+
t/rec_att_keys.t
140141
t/recurs.t
141142
t/revision.t
142143
t/several_authors.t

lib/ExtUtils/MakeMaker.pm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ our @Get_from_Config; # referenced by MM_Unix
2121
our @MM_Sections;
2222
our @Overridable;
2323
my @Prepend_parent;
24-
my %Recognized_Att_Keys;
24+
our %Recognized_Att_Keys;
2525
our %macro_fsentity; # whether a macro is a filesystem name
2626
our %macro_dep; # whether a macro is a dependency
2727

@@ -1768,6 +1768,11 @@ The following attributes may be specified as arguments to WriteMakefile()
17681768
or as NAME=VALUE pairs on the command line. Attributes that became
17691769
available with later versions of MakeMaker are indicated.
17701770
1771+
A computer-readable list of recognized attributes is available as
1772+
C<%ExtUtils::MakeMakers::Recognized_Att_Keys>, supported since 7.72. You
1773+
can check whether a particular parameter is supported by the current
1774+
version of ExtUtils::MakeMaker by checking whether it exists in the hash.
1775+
17711776
In order to maintain portability of attributes with older versions of
17721777
MakeMaker you may want to use L<App::EUMM::Upgrade> with your C<Makefile.PL>.
17731778

t/rec_att_keys.t

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/perl -w
2+
3+
# This script tests %ExtUtils::MakeMaker::Recognized_Att_Keys;
4+
5+
use strict;
6+
use Test::More;
7+
8+
# We don’t need to test all parameters; just enough to verify that the
9+
# mechanism is working. This list is somewhat random, but it works.
10+
11+
my @supported = qw(
12+
ABSTRACT_FROM
13+
AUTHOR
14+
BUILD_REQUIRES
15+
clean
16+
dist
17+
DISTNAME
18+
DISTVNAME
19+
LIBS
20+
MAN3PODS
21+
META_MERGE
22+
MIN_PERL_VERSION
23+
NAME
24+
PL_FILES
25+
PREREQ_PM
26+
VERSION
27+
VERSION_FROM
28+
);
29+
30+
my @unsupported = qw(
31+
WIBBLE
32+
wump
33+
);
34+
35+
plan tests => @supported+@unsupported;
36+
37+
use ExtUtils::MakeMaker ();
38+
39+
for (@supported) {
40+
ok exists $ExtUtils::MakeMaker::Recognized_Att_Keys{$_},
41+
"EUMM says it supports param '$_'";
42+
}
43+
for (@unsupported) {
44+
ok !exists $ExtUtils::MakeMaker::Recognized_Att_Keys{$_},
45+
"EUMM claims not to support param '$_'";
46+
}

0 commit comments

Comments
 (0)