Are these modules only for testing perl code?

No, they are fairly general-purpose. Ignoring the internals, the simplest tests just do a boolean check (e.g. ok() from Test::More) and generate TAP output. You can and probably should use these modules to generate TAP output for you.

use Test::More; ok connect_to_ftp(), "connect"; is get_something(), "expected string", "get_something"; is system("external command"), 0, "external command"; ... done_testing; # or use "plan tests => 123;" above

Here, connect_to_ftp() can do whatever you want, be it shelling out to some external command, calling a Java API, etc. - as long as it returns a true value on success and a false value on failure you can use it in ok() (even dieing is fine, since Test::More will report that as an error too). Same goes for get_something(), it can read from a socket, file, whatever. If you're going to be doing a lot of calling of external commands, I can highly recommend IPC::Run3 (one of the few modules that handles redirection of all three STDIN, STDOUT, and STDERR streams, and according to the test stats does it well).

Your idea to have a set of *.t files is a good one, this is how just about every module on CPAN with tests does it. Then, you can use the prove command and all the other tools that handle Perl and TAP tests. So you probably don't need a "master script" that executes your tests.

Although this is a design issue, personally I would limit your "test library" to be as small as necessary, since if you end up writing a big test library, you really should write tests for that, too. Instead, make your test cases as small and self-contained as possible (granted, that's not always possible).

(By the way, have you seen Inline::Java, maybe that's useful to you?)


In reply to Re: Automation using perl by Anonymous Monk
in thread Automation using perl by jaypal

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.