http://www.perlmonks.org?node_id=645169


in reply to Re: tests & logging
in thread tests & logging

Are all 40k tests in one file?
In that case I would seriously consider splitting the tests into smaller sets (i.e. files). Current modules on CPAN could serve as examples, e.g. a simple and easily understood one such as Number::Bytes::Human. Some test files contain just a handful tests/lines each:
[Number-Bytes-Human-0.07]# wc -l t/* 7 t/01use.t 42 t/02basic.t 27 t/03large.t 31 t/04base1000.t 14 t/05zero.t 15 t/06si.t 9 t/07unit.t 29 t/08base1M.t 137 t/10parse_args.t 17 t/20oo.t 8 t/90pod.t 8 t/98pod-coverage.t 344 total
Run all tests:
[Number-Bytes-Human-0.07]# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/01use.............ok 1/1# Testing Number::Bytes::Human 0.07, Perl 5. +008005, /usr/bin/perl t/01use.............ok t/02basic...........ok t/03large...........ok 1/4number too large (>= 1024**10) at t/03large. +t line 26 t/03large...........ok t/04base1000........ok t/05zero............ok t/06si..............ok t/07unit............ok t/08base1M..........ok t/10parse_args......ok t/20oo..............ok t/90pod.............ok t/98pod-coverage....ok All tests successful. Files=12, Tests=128, 1 wallclock secs ( 0.89 cusr + 0.10 csys = 0.9 +9 CPU)
Run a single test:
[Number-Bytes-Human-0.07]# prove t/05zero.t t/05zero....ok All tests successful. Files=1, Tests=6, 0 wallclock secs ( 0.05 cusr + 0.00 csys = 0.05 C +PU)
--
Andreas