This is a re-submission of the new files and patches originally
submitted in http://rt.perl.org/rt3/Ticket/Display.html?id=41608.
(Yesterday I twice tried submitting mail with individual file
attachments, but it never showed up. So I'm trying again with just
a single patch ops2c.pl.refactored.svn.diff.txt.)
These files constitute a refactoring of Parrot build tool tools/build/
ops2c.pl. The refactoring was conducted along the same lines as my
recent refactoring of tools/build/ops2pm.pl and tools/build/
pmc2c.pl. In each case, the interface to the build tool (i.e., what
is invoked by make) was left untouched, but the code within the
script was refactored into two Perl packages: one dubbed Utils.pm,
holding most of the functionality in methods; and another one dubbed
Auxiliary.pm, holding miscellaneous subroutines.
This refactoring was suggested by particle for the purpose of more
thoroughly testing Parrot's build tools, being able to demonstrate
the soundness of that refactoring and the thoroughness of the testing
via coverage analysis, and thereby setting a firm foundation for any
refactorings needed in the future.
The test suite in t/tools/ops2cutils/ is component-focused. It is
intended to be run after you have run Configure.pl but before you
have invoked make. Some of the tests are designed to fail if run
after make. Hence, these tests are not meant to be part of make
test's targets. Instead, once you have run Configure.pl you can run
them via: make buildtools_tests
This refactoring has been conducted largely in the 'buildtools'
branch of the repository, but has passed 'make' and 'make test' in
a fresh checkout of HEAD from trunk.
You can see the coverage analysis here: http://thenceforward.net/
I have tested this on Darwin ('make' and 'make test') and on Debian
Linux ('make' and 'make test'); particle has tested then on Win32.
So I will apply these files to trunk after the March release unless I
hear of test failures on other OSes.
Thank you very much.