On Fri, Jun 11, 2004 at 09:36:41PM +0100, Adrian Howard wrote:
> What does an empty test file give you over an absent one?
Cleaner build system. You simply say, for every Perl file, run pod2test
to build a test file, then run all the test files. Something like:
%.pm.t: %.pm
pod2test $< $@
test: *.pm.t
perl -MTest::Harness -e 'runtests(@ARGV)' $^
The alternative is to figure out which modules contain tests every time
you run make, which requires extra code and is less efficient as well.
You could instead maintain a list (in your Makefile) of which modules
have tests, but ewww.
As a general principle, there should be a file to represent every piece
of work that make has to do--even if it is just a dummy--so that it
knows when the work has already been done.
I suppose you could say that I'm overly concerned with efficiency and I
should just rebuild all the test files every time I run the tests. That
may be a fair argument.
Andrew