[tpm] Makefile and proper use of t/*.t
linux at alteeve.com
Thu Sep 10 06:08:06 PDT 2009
This is a follow-up to my last question on testing. I followed Adam
and Michael's advice and read up on and became comfortable with Test::*
(Harness, Tutorial, Simple and More, specifically). My test code is much
cleaner and more concise now, so thank you again.
The two topic I still need help on are;
I couldn't find a good overview of the proper use of the t/*.t files.
For now, I've created a base 'test.pl' in the root of my module that
makes sure I can do the basics of loading my "parent" (main sibling)
module. Then it uses 'require_ok(t/Foo.t)' for each of the test files.
The exact name of each *.t file matches the corresponding *.pm file it
However, I've seen references to these files being automatically
loaded is some regard, but found no specifics. Also, I understood the
reasoning behind breaking up testing between *.t files was to keep the
test count under 255. The way I am doing it currently runs them
concurrently with the test number constantly growing. As simple as my
tests are, I'm already over 40 tests and I have a *lot* more methods to
The last thing I need to do before I can even think about getting my
modules on CPAN is to learn how to create a Makefile.pl. I've looked at
other modules for examples, but none have any comments I found useful. I
know that there is a reference to using h2xs to create a framework which
sets up a module from the beginning, but my modules are already well
under way. Also, I'd like to understand the theory better so that my
talk next month will be as complete as possible.
More information about the toronto-pm