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:
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:
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/
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.