Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Okay, so I've built this big Perl app. It started a long time ago as a giant kludge, since I didn't know squat about decent package-building practices, and not that much about good programming (although enough that the thing worked and wasn't too hard to maintain).

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:

  1. perl -wc filename
  2. perl -e'use mod;' (modules only)

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


In reply to MakeMaker, testing, and packages with modules by Rhys

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-18 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found