cc'ing perl-qa for input Jonathan Swartz wrote: > We use Test::Class for all our tests, with a single script (_t.pl) > that automatically loads and runs all test classes. > > Unfortunately, with prove and the standard test harness, this causes > test output in which all tests are isted under a single script. > > /home/swartz/env/hm/lib/HM/t/_t....ok > All tests successful. > Files=1, Tests=628, 112 wallclock secs > > When viewing on standard output, this is annoying, but we live with > it, as we can always turn on -v to get more detail. > > However, now that we're using smolder, the problem becomes more > prounounced, as the smolder display and the color bar is really > optimized for tests to be split up among many scripts. What we get is > a single gigantic color bar for _t.pl. > > How have others used smolder with Test::Class? Do you just live with > the above situation, or do you write individual test scripts for each > class?
We use Test::Class a lot too and we do indeed write a separate script for each testing module. > I dislike the latter solution for its inefficiency, as Perl > and all our common modules would have to be loaded many times. Our > test suite already takes too long to run within a single script. You're right that it does increase the run time of the test suite. The full test suite for one of our projects takes about 45 minutes to run as it is, so adding a few seconds here of or there doesn't really mean much in the end... at least to us (that's why it's nice to have an automated build-test smoker). > It seems that we could write a custom test harness that causes each > test class to be treated as each test script does normally. But I'm > not sure where to begin, especially with the current changing status > of Test::Harness. One of the Goals of TH 3.0 is to make it easier to customize the parsing, reporting, etc. If you want TH to treat each Test::Class object like a separate .t file, then I think the best approach would be to make a T::H plugin that does this. I think it would be a useful CPANable module. Just remember that to use Smolder you need a TAP Archive, so you'd have to have prove use both the T::C and the Archive modules. I'm not sure how the plugin API has settled (or if it even has) and whether or not it is currently possible to have prove use 2 different plugins. -- Michael Peters Developer Plus Three, LP