Is there a way to nest usage of Test::Harness? I have an application 
with a number of custom modules. I want to structure my test suite this 
way:

    myapp.t
       module_a.t
       module_b.t
       
    module_a.t
       foo.t
       bar.t

    module_a.t
       baz.t
       quux.t

That is, I want the top-level test suite to call the module test suites, 
and the module suites to call their own test sets (often one *.t for 
each sub in the module).

I want to do this because:
1) I want to be able to run either the full suite or just one module's 
   tests.
2) I don't want to have to make changes in two places when I add a new 
   subtest.
3) I want to tweak the flags to Devel::Cover for each module so that it 
   only collects data for the module I'm actively testing and doesn't 
   get incidental coverage for things it depends on.

Test::Harness::runtests() doesn't seem happy about being (indirectly) 
nested. When I get it to work at all (path/cwd issues) I get results 
like this:

Module_A......................skipped
        all skipped: no reason given
Module_B....skipped
        all skipped: no reason given
All tests successful, 2 tests skipped.
Files=2, Tests=0, 10 wallclock secs (0.00 cusr + 0.00 csys = 0.00 CPU)

Does anyone know of a way to get Test::Harness to DWIM here? Or failing 
that, does anyone have a suggestion for an alternate approach?

-mjc

Reply via email to