develooper Front page | perl.perl5.porters | Postings from April 2016

Re: [perl #124050] t/harness can mistakenly run tests outside of theperl source tree

Thread Previous
From:
wolfsage
Date:
April 24, 2016 17:47
Subject:
Re: [perl #124050] t/harness can mistakenly run tests outside of theperl source tree
Message ID:
CAJ0K8bgN15gQM-9CmF_UAtRZ46KQjkjXFXYTjmj19aJVidxjmA@mail.gmail.com
On Thu, Mar 12, 2015 at 5:24 AM, Steve Hay <perlbug-followup@perl.org> wrote:
> If I have a cpan/Text-Balanced folder (containing a Git workspace of the CPAN Text-Balanced distro) alongside my perl source tree then t/harness will mistakenly run the tests in ../../cpan/Text-Balanced/t/ (outside the perl source tree) instead of the intended ../cpan/Text-Balanced/t/ (inside the perl source tree).
>
> It happens because of this little snippet in t/harness:
>
> # Allow eg ./perl t/harness t/op/lc.t
> for (@tests) {
>     if (-f "../$_") {
>         $_ = "../$_";
>         s{^\.\./t/}{};
>     }
> }
>
> but I'm not sure off-hand how best to fix it to be absolutely sure that it doesn't end up outside of the perl source tree.
>

Possible patch attached. This may be 'better than nothing' (provided I
didn't break something else).

-- Matthew Horsfall (alh)

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About