On Jun 14, 2007, at 1:22 PM, Shlomi Fish wrote:
Hi all!
In this report:
http://www.nntp.perl.org/group/perl.cpan.testers/2007/06/
msg508523.html
I receive the following errors for one of my modules, which is a
Test-Run
plugin:
{{{{{{{{{{{{{{{{{{{
t/00-load...........# Testing Test::Run::Plugin::ColorFileVerdicts
0.0101,
Perl 5.008008, /home/chris/perl588/bin/perl
ok
t/01-run............ok
t/02-cmdline-run....
# Failed test 'ok is colored'
# at t/02-cmdline-run.t line 56.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-
run.t line
46.
# Failed test 'ok is colored in a different color'
# at t/02-cmdline-run.t line 74.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-
run.t line
64.
# Failed test 'ok is colored in a different color'
# at t/02-cmdline-run.t line 92.
# $trap->stdout() is
# $trap->stderr() is
# Can't exec "runprove": No such file or directory at t/02-cmdline-
run.t line
82.
# Looks like you failed 3 tests of 3.
}}}}}}}}}}}}}}}}}}}
As you can see the "runprove" utility (that is installed as part of
Test-Run-CmdLine, which is a dependency of that plugin), could not be
executed for some reason. My guess is that its installation path
was not in
$ENV{PATH}.
So my questions are:
1. Shouldn't the path where the scripts and executables are
installed should
be configured before CPANPLUS.pm or CPAN.pm are invoked for
installing the
modules as part of the smoking? Isn't it a bug at their end?
2. Should I somehow convert the command line invocation to a
command line
application disguised as a module (e.g: <<perl -MApp::Runprove -e
'run()' --
@args>>), so I'll avoid such problems in the future?
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
If it's not in my E-mail it doesn't happen. And if my E-mail is saying
one thing, and everything else says something else - E-mail will
conquer.
-- An Israeli Linuxer
If you have the power to do so, the second alternative sounds like
the best,
although to be sure the test doesn't break on a missing program you
could skip the test with something like this:
use strict;
use warnings;
use Test::More;
use File::Spec;
my $path_to_runprove;
# Try to find runprove somewhere in $ENV{PATH}.
my @path = File::Spec->path( );
PATH:
for my $path_entry (@path) {
my $path_to_try = File::Spec->catfile($path_entry, 'runprove');
if (-x $path_to_try) {
$path_to_runprove = $path_to_try;
last PATH;
}
}
if (! $path_to_runprove) {
plan( skip_all =>
qq{This test requires the `runprove` program installed with
Test::Run::CmdLine } .
qq{Please be sure it's executable and in your PATH.}
);
}
plan( tests => 1 );
ok( 1 );
--
ad()((!!!ÆÆ::)(,..c.xz("F(=ÀxS&@#.da####!!();
cell: +47 41545862 http://www.0x61736b.net