Front page | perl.perl5.porters |
Postings from March 2007
Re: [PATCH] p55 tests
From: Gerard Goossen
March 22, 2007 10:37
Re: [PATCH] p55 tests
Message ID: 20070322174056.GE24152@ostwald
On Thu, Mar 22, 2007 at 12:41:37AM +0000, Dave Mitchell wrote:
> On Tue, Mar 20, 2007 at 07:14:18PM +0100, Gerard Goossen wrote:
> > This patch adds a test for p55, the "Perl 5 to Perl 5" translator.
> > The patch is a bit large, because I made 'nomad' into a package
> > 'Nomad.pm', but I don't think I changed anything to its internals.
> > Important part is the mad/t/p55.t other changes are moving things or
> > helper routines.
> Can I suggest that you submit this is two separate patches. First,
> where you strictly just cut-paste the body of mad/nomad to Nomad.pm,
> with no changes. Then in a second patch, include any fixups to Noamd.pm
> plus the other changes. That way it's easier for people reviewing
> history to see and understand any changes.
> Also, when adding new files, you should also patch MANIFEST.
These two patches replace the previous patch.
The first one should also include a 'mv mad/nomad mad/Nomad.pm'
And it is a lot more readable :)
MANIFEST is also patched.
> > About running the mad/t/p55.t test:
> Some suggestions about p55.t. First off, I think it may be worthwhile
> investing effort in t/TEST instead (or as well), to give it a new
> command-line option (-mad say) that runs the p55 converter on the listed
> test files, eg
> t/TEST -mad op/*.t
> That way you quickly get wide coverage all all the nooks and crannies in
> perl's syntax.
> Actually it might be worth having two new options: one that just runs the
> p5 to xml converter on each test file (to see if anything blows up); this
> can then be easily run from smokes; and a second option, which requires
> XML::Parser and does the full p5 to p5 round trip on each test file and
> compares the differences.
> If you prefer to stick with p55.t, then I'd suggest putting the test
> programs after __END__ and extract them out with a delimiter such as
> '########', which makes it easier and cleaner to add tests. See
> t/op/anonsub.t for one example of many. (In this case you can skip the
> EXPECT section since what we expect is the same as what we're testing :-)
Currently I think the p55 has too many bugs to be worth adding it to
t/TEST, but when these are resolved having it automaticly tested would
And I think the mad/t/p55.t is a good place to list the known
failures, and simplified test cases.
So I kept the p55.t but put the test programs at the end after __DATA__