Oct 2, 2013, 11:29 PM
Post #1 of 1
makefile.PL or make dist skips my test modules, rendering make test useless
I have uploaded one module to CPAN and I'm trying to prepare another. I carefully wrote 5 test modules (suffixed .t) in my <module>/t directory and, before trying to do run makefile.pl, have run each of those test modules.
Following Sam Tregar's book Writing Perl Modules for CPAN to the letter (I'd like to think) I ran perl Makefile.pl before the make dist.
In order to simulate a download, I copied the .tar.gz file to a Download directory and unpacked it. Upon running make test I get pretty useless output:
Eh! Wo hoppen to my verbose test output?!
PERL_DL_NONLAZY=1 /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Math-Yapp.t .. t/Math-Yapp.t .. 1/1 t/Math-Yapp.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.09 sys + 0.19 cusr 0.08 csys = 0.39 CPU)
I then discovered that none of my test modules in my development t directory had made it out to the distribution copy. All that got "distributed" was the original <module-name>.t file that was created when I ran h2xs in the first place.
My test modules are named things like:
Yes, I could probably stuff all that testing code into the <module-name>.t file but I didn't have to do that with my other CPAN module. And I don't believe I should need to either; the book specifically mentions naming the test modules with numeric prefixes, presumably to control the order of the tests.
So now I get to the obvious question:
How do I get these all the files in <module-name>.t to distribute with the rest of the module?
-- Rasputin Paskudniak (In perpetual pursuit of undomesticated, semi-aquatic avians)