Subject: | App::Prove problem with .proverc when requesting --exec '' |
App::Prove has trouble recognizing empty string arguments in .proverc.
This is problematic for --exec '', which works fine from the command
line, but will not function from .proverc
Lines 147,148 in App::Prove.pm Version 3.14 are, I beleive, the source
of the problem:
147 push @{ $self->{rc_opts} }, grep $_ && $_ !~ /^#/,
148 $line =~ m{ ' ([^']*) ' | " ([^"]*) " | (\#.*) | (\S*) }xg;
The following was found to work to my satisfaction. Note that two
changes are required, testing for defined on $_, not just truth, and
changing \S* to \S+ in the fourth capture.
push @{ $self->{rc_opts} },
grep{ defined and not /^#/ }
$line =~ m{ ' ([^']*) ' | " ([^"]*) " | (\#.*) | (\S+) }xg;
This is perl, v5.10.0 built for i686-linux
To reproduce from Linux:bash:
1) mkdir abc
2) cd abc
3) mkdir t
4) cd t
5) cat > 01.t <<EOF
#!/bin/bash
echo 1..1
echo ok 1
EOF
6) chmod +x 01.t
7) cd ..
8) prove --exec ''
t/01......ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
Result: PASS
9) echo "--exec ''" > .proverc
10) prove
Option exec requires an argument
Unable to continue at /usr/bin/prove line 10