Rhys has asked for the wisdom of the Perl Monks concerning the following question:
Years have gone by, and the app now has POD (which needs updating), several included modules, and gets built/installed with MakeMaker. All very cool so far.
My questions involve testing and the modules. At present, I can't even do a simple t/Basic.t test that does use MyApp::EachMod; because I use SNMP; (from Net-SNMP). On RedHat, anyway, this fails with:
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/Basic....Can't load '/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thr +ead-multi/auto/SNMP/SNMP.so' for module SNMP: /usr/lib/perl5/vendor_p +erl/5.8.0/i386-linux-thread-multi/auto/SNMP/SNMP.so: undefined symbol +: PerlIO_fprintf at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Dyna +Loader.pm line 229, <DATA> line 48.
According to the net-snmp-users list archive, this is fixed in Net-SNMP-5.1, whereas RHEL is still using 5.0.9, but I digress...
Anyway, I can only think of two generic tests that one can run on a given module/script/chunk of code. They are:
In the 'big app', my current t/Basic.t does use MyApp::EachMod; on any module that doesn't use SNMP; for the moment, and another little package I built to distribute a bunch of little scripts using a simple Makefile does perl -wc $(PERLFILES), when I do make test or make check. I also have use strict; in everything (although I don't use warnings;).
SO... aside from attempting to give each piece of code a known set of inputs and looking for a known set of outputs (stuff that Test::More is good at), are there any other generic tests or procedures that folks use to make sure their code doesn't have junk in it?
More importantly, is there a TFM I should R on this topic? :-)
--J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MakeMaker, testing, and packages with modules
by grantm (Parson) on Sep 06, 2004 at 00:59 UTC | |
|
Re: MakeMaker, testing, and packages with modules
by tachyon (Chancellor) on Sep 06, 2004 at 02:02 UTC | |
by Rhys (Pilgrim) on Sep 06, 2004 at 02:34 UTC | |
|
Re: MakeMaker, testing, and packages with modules
by jbodoni (Monk) on Sep 06, 2004 at 04:46 UTC |