Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Test::More Too Verbose

by jethro (Monsignor)
on Mar 25, 2010 at 23:37 UTC ( [id://830996]=note: print w/replies, xml ) Need Help??


in reply to Test::More Too Verbose

Executing a command to test if it exists is a bit overkill. `which lxs` will tell you whether lxs exists without executing it and without printing something unwanted on STDERR.

Replies are listed 'Best First'.
Re^2: Test::More Too Verbose
by DrHyde (Prior) on Mar 26, 2010 at 11:17 UTC

    Sometimes you have to execute a binary to see if it exists. eg, if you're checking to see if you have GNU cp, you can't just see if there's a file called cp, you need to examine the binary. The easiest way of examining the binary is to execute it.

    See, eg, App::Rsnapshot::CheckGNUcp

    (please don't use App::Rsnapshot, it's an experimental and as-yet-incomplete rewrite of rsnapshot)

      maybe safer to try binary --help
        Yes, but even so, you still have to run the thing. In the case of that particular module, the feature of GNU cp I care about is the -l flag, so that's what I test. If you look in the tests for the module, you'll see that they use --help, so that I'm comparing data from two sources.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found