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.