On Tue, 13 Jul 2004, Stas Bekman wrote:
> Randy Kobes wrote:
> > Here's a diff for making the code for the APR::Table
> > test run from both t/apr/ and t/apr-ext/.
>
> +1, perfect.
>
> > +require TestAPRlib::table;
>
> why not 'use'?
OK, I'll change that.
> Further, I'd suggest to have a parallel function which returns the
> number of sub-tests will be run. e.g. in this tests case
> TestAPRlib::table::test_number(), which will do all the calculations and
> tell the caller how many tests TestAPRlib::table::test() is going to
> run. So the skeleton will become:
>
> use TestAPRlib::foo;
>
> my $local_tests = 5;
> my $common_tests = TestAPRlib::foo::test_number();
>
> plan tests => $local_tests + $common_tests;
>
> TestAPRlib::foo::test();
>
> # now run local tests if any (e.g. mp-specific ones)
>
> In the case of apr::table that will be a hardcoded number:
>
> package TestAPRlib::table;
>
> sub test_number { 38 }
>
> in the case of more complicated tests with skips, it can be a more
> complicated function, but the added value that now the caller doesn't
> need to hardcoded that number and the library can adjust things
> dynamically, and have a different number of tests for apr/mp and apr-ext.
That's a great idea - I'll do that for the table test
and commit it. I also have similar patches available
for some of the other tests that don't intimately
rely on $r - I'll post those in separate messages.
--
best regards,
randy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]