
demerphq at gmail
Sep 14, 2012, 5:01 AM
Post #10 of 11
(121 views)
Permalink
|
|
Re: [perl #114296] Refactor t/op/lop.t to use test.pl instead of making TAP by hand
[In reply to]
|
|
On 14 September 2012 13:34, Dave Mitchell <davem [at] iabyn> wrote: > On Wed, Aug 29, 2012 at 09:36:18PM +0100, Nicholas Clark wrote: >> On Sat, Jul 28, 2012 at 02:21:05PM -0700, Colin Kuskie wrote: >> > I stayed away from using done_testing in this patch since someone >> > corrected one of the earlier ones where I did use it. >> >> We don't all agree on everything. I personally tend to find it easier >> (because I hate repeatedly re-editing test conts, and I guess historically >> I also got burned by them often conflicting on maint-branch integrations) > > As the 5.10.1 maint pumpking, I also hated all the merge conflicts caused > by updates to the test count. However, I *really* hate the idea that some > tests are quietly dying or misbehaving or being skipped, and we never > notice. > > I've wondered from time to time whether the test infrastructure could be > made to deduce the test count from code comments, e.g. > > plan(use_comments); > > # TESTS=2 > { > is(...); > is(...); > } > > # TESTS=3 > { > is(...); > is(...); > is(...); > } > > so plan() scans the source file and sums all the TESTS=N. Some of the regex tests used to do this via a BEGIN. BEGIN { $testcount+=3 } and then the $testcount was used in the plan. But the code police decided this was bad style and patched it away and I didn't notice until it was pretty much done. I always thought it was a better solution than a hard coded test count. cheers, Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
|