Greets to all. Hope the new year is treating everyone ok.

I'm currently writing a set of client side modules to interface with some 3rd party connectivity software we have running on our mainframe. The client software in that package was a windows only dll, so some packet sniffing and perl coding and I now have a perl client for *nix. :-) But I digress.

Even though these module will probably never hit the public, I'm forcing myself to Do The Right Thing by completing the inline pod, putting it all in a CPAN style package, etc. The last thing on my plate is the module tests, which leads me to my real question.

What would be the most sensible way to do test for these modules? I would either need to do pre-test config questions to get connect info to a live server, or I could write a tcp server module that mimics the real server.

I've looked into Net::Server and NetServer::Generic and while none of it looks terribly difficult, I have no idea where to start. Would it be better to run a 'simple'/'single' server within the test script, or should I just bite the bullet and write a real ::Server module to accompany the ::Client modules in this package? I guess they would be useful from the standpoint that new application mocksups could be built locally using the client and server parts without the 'real' server parts being available yet. What's the best way to have a client and server talking to each other within the same script?

I know. I know. "Network Programming with Perl". It's ordered and on the way. :-) I just want to get a head start.

Thanks,
-=Chris


In reply to Best Approach: package module tests with tcp by jk2addict

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.