Boy oh boy, does nested TAP make Test::Aggregate much cleaner. It's not uploaded yet -- still documenting and working out corner cases for the new Test::Aggregate::Nexted -- but here's what aggregated test output used to look like. Remember, this is five separate test programs. Can you tell where each starts and ends?
Test-Aggregate $ prove -lv t/pre_post.t t/pre_post.t .. # ******** running tests for aggtests/check_plan.t ******** ok 1 - aggtests/check_plan.t ***** 1 ok 2 - aggtests/check_plan.t ***** 2 ok 3 # skip checking plan (aggtests/check_plan.t ***** 3) ok 4 - env variables should not hang around ok 5 - aggtests/check_plan.t ***** 4 ok 6 - findbin is reinitialized for every test ok 7 # skip Testing skip all # ok - aggtests/check_plan.t (1 out of 5) # ******** running tests for aggtests/findbin.t ******** # ok - aggtests/findbin.t (2 out of 5) # ******** running tests for aggtests/skip_all.t ******** # ok - aggtests/skip_all.t (3 out of 5) # ******** running tests for aggtests/slow_load.t ******** ok 8 - slow loading module loaded ok 9 - env variables should not hang around ok 10 - subs work! ok 11 - Startup should be called once ok 12 - ... as should shutdown ok 13 - Setup should be called once for each test program ok 14 - ... as should teardown 1..14 # ok - aggtests/slow_load.t (4 out of 5) # ******** running tests for aggtests/subs.t ******** # ok - aggtests/subs.t (5 out of 5) ok All tests successful. Files=1, Tests=14, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.11 cusr 0.01 csys = 0.15 CPU) Result: PASS
Now let's run that with Test::Aggregate::Nested (requires the development version of Test::More):
Test-Aggregate $ prove -lv t/pre_post_nested.t t/pre_post_nested.t .. 1..5 1..5 1..0 # SKIP Testing skip all ok 1 # skip Testing skip all 1..1 ok 1 - findbin is reinitialized for every test ok 2 - aggtests/findbin.t 1..1 ok 1 - subs work! ok 3 - aggtests/subs.t 1..2 ok 1 - slow loading module loaded ok 2 - env variables should not hang around ok 4 - aggtests/slow_load.t 1..5 ok 1 - aggtests/check_plan.t ***** 1 ok 2 - aggtests/check_plan.t ***** 2 ok 3 # skip checking plan (aggtests/check_plan.t ***** 3) ok 4 - env variables should not hang around ok 5 - aggtests/check_plan.t ***** 4 ok 5 - aggtests/check_plan.t ok 1 - nested tests ok 2 - Startup should be called once ok 3 - ... as should shutdown ok 4 - Setup should be called once for each test program ok 5 - ... as should teardown ok All tests successful. Files=1, Tests=5, 2 wallclock secs ( 0.03 usr 0.01 sys + 0.11 cusr 0.02 csys = 0.17 CPU) Result: PASS
Much, much nicer. As an added bonus, plans can now be cleanly asserted. I hope to have it on github soon, and later on the CPAN.