[perl #42270] [PATCH]: Configure.pl: refactor options processing functionality

0 views
Skip to first unread message

James Keenan

unread,
Apr 1, 2007, 12:38:12 PM4/1/07
to bugs-bi...@rt.perl.org
# New Ticket Created by James Keenan
# Please include the string: [perl #42270]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42270 >


This patch transfers one aspect of Configure.pl's functionality --
its command-line options-processing -- out of that script and places
it in a new package: lib/Parrot/Configure/Options.pm.

Parrot::Configure::Options exports two subroutines on demand:
process_options()
get_valid_options().

By placing this functionality in subroutines exported by a class, we
can write tests for it using Perl's standard testing apparatus.
Accordingly, a test file is supplied as part of this patch:
t/configure/01-options.t

A number of Parrot hackers and I will be submitting a series of
patches which refactor Configure.pl and the various
Parrot::Configure::* classes. This is the first of that series.
This refactoring will be focused primarily on increasing the
testability -- and, by extension, the long-term maintainability -- of
Parrot's configuration code.

Assuming that our refactoring is correct, the end result of the
configuration process should not change in the least. (To confirm,
do a 'diff' on lib/Parrot/Config/Generated.pm versus an unpatched
version.) However, if in the future you are proposing revisions to
functionality originally found in Configure.pl (e.g., adding a new
command-line option), you may have to look in a new place to make
such a revision.

Coke and chromatic have recommended that I submit patches one element
at a time, the better to review and digest them. So what I would
like to do is submit this patch, allow about three days for review,
apply the patch to trunk if no one objects, then submit the next
patch. Each patch will entail a revision to Configure.pl, a new
class and/or revisions to a Parrot::Configure::* class, and one or
more test files.

Note: If you are applying this patch locally, then running 'make
test', you will have to locally set SVN properties to pass t/distro/
file_metadata.t :

Setting SVN properties on: t/configure/01-options.t
property 'svn:eol-style' set on 't/configure/01-options.t'
property 'svn:keywords' set on 't/configure/01-options.t'
property 'svn:mime-type' set on 't/configure/01-options.t'
Setting SVN properties on: lib/Parrot/Configure/Options.pm
property 'svn:eol-style' set on 'lib/Parrot/Configure/Options.pm'
property 'svn:keywords' set on 'lib/Parrot/Configure/Options.pm'

Thank you very much.

kid51

configure.options.patch.txt

James Keenan via RT

unread,
Apr 4, 2007, 9:56:44 PM4/4/07
to perl6-i...@perl.org
Patch applied in r17983 and 17984.
Reply all
Reply to author
Forward
0 new messages