From dbed2883419e3e2e131053d5b2c299b262a10894 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Mon, 18 Nov 2024 09:29:36 +0100 Subject: [PATCH] - fixed program path using search. Fixes path problems within Dist::Zilla calls --- lib/Test/TA.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Test/TA.pm b/lib/Test/TA.pm index 8132b4d..5eac397 100644 --- a/lib/Test/TA.pm +++ b/lib/Test/TA.pm @@ -33,13 +33,25 @@ sub is_testhost_available () { sub testapp () { # contains common code for tests under t/ my $perl = $^X; + my $searchpath = path(__FILE__)->parent->parent->parent; + my $prog; + $searchpath->visit( + sub { + my ($path) = @_; + $prog = $path if $path =~ m/ta-tool.pl/; + }, + { recurse => 1} + ); + + my $testapp = Test::Cmd->new( - prog => path(__FILE__)->parent->parent->parent->child('bin')->child('ta-tool.pl'), + prog => $prog, workdir => '', subdir => 'bin', #verbose => 1, interpreter => "$perl -I lib/ ", ); + $config_dir = path($testapp->workpath())->child('.config'); $config_dir->mkpath(); $config_file = $config_dir->child('ta-tool.rc'); -- GitLab