Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: using Test::* modules for generic testing of non perl stuff?

by jfroebe (Parson)
on Oct 15, 2004 at 20:49 UTC ( [id://399660]=note: print w/replies, xml ) Need Help??


in reply to Re: using Test::* modules for generic testing of non perl stuff?
in thread using Test::* modules for generic testing of non perl stuff?

some is command line based but I'm trying to avoid calling os commands directly if possible (hetergenous environment where output isn't always the same for the same commands). I would prefer to use pure perl where possible.

Can you elaborate on your misuse of the Test::* modules for testing non code things? Specifically why it was 'misused'. I'm trying to come up with pros and cons as well for the use of Test::* for non-code things.

Jason L. Froebe

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

  • Comment on Re^2: using Test::* modules for generic testing of non perl stuff?

Replies are listed 'Best First'.
Re^3: using Test::* modules for generic testing of non perl stuff?
by biosysadmin (Deacon) on Oct 15, 2004 at 21:04 UTC
    I used the word "misuse" because I think that the Test::* modules were originally used for testing code, and I've adapted them to some orthogonal uses.

    At it's most fundamental, you just need to define a set of "things" you want to test and define their acceptable output. This can be tricky, as you might need to define a range of acceptable output values. One strategy that I've used in the past is to predefine a hash like this:

    %commands = { $cmd1 => $output1, ... };
    Then execute the commands and test the dynamic output against the predefined output.

    I've actually got to run and catch a plane, but I'll be sure to check on this thread when I get back. Cheers. :)

      I understand where you're coming from now. I *think* the Test::* should work okay as long as I code a pass/fail. What I do like is the fact that the Test::* are already built and are relatively simple to use. I agree that depending on what I'm testing, I might have to shoehorn it.

      I guess I'm looking for reasons NOT to use it.. At this point, I see only that some extra coding of the test may only need to be done.. But since I've fallen for too good to be true with some perl modules on cpan before (fits my need but no maintainer, doesn't fit my need exactly but maintainer goes ballistic when I submit a patch extending it without getting permission first from the maintainer to modify the module in the first place for my own use, etc.), I'm skeptical

      Jason L. Froebe

      p.s. Hava a good flight! No delays!

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://399660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-19 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found