diff --git a/lib/Test/TA.pm b/lib/Test/TA.pm index 8132b4d57f7c37a5211c2ed5ff31135d907bfaf8..5eac3976faccbd0e8a5a347110ec0809c19d89e9 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');