X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2Flib%2FApp%2FRgit%2FTestUtils.pm;h=de5b808da0e38a4a9ea52cd6889d22d778043da8;hb=a35a1fae17b8e75696ef1e5474aaa99222594a6a;hp=07b1bd7c4e5212260a9f9dcdf3c243cf7fe133b6;hpb=e09a125b42420241c34529697c250ad795f1c59e;p=perl%2Fmodules%2Frgit.git diff --git a/t/lib/App/Rgit/TestUtils.pm b/t/lib/App/Rgit/TestUtils.pm index 07b1bd7..de5b808 100644 --- a/t/lib/App/Rgit/TestUtils.pm +++ b/t/lib/App/Rgit/TestUtils.pm @@ -3,9 +3,10 @@ package App::Rgit::TestUtils; use strict; use warnings; -use Cwd qw/abs_path/; -use File::Temp qw/tempfile/; -use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG SIGINT SIGQUIT/; +use Cwd qw/abs_path/; +use File::Temp qw/tempfile/; +use File::Spec::Functions qw/curdir catfile/; +use POSIX qw/WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG/; BEGIN { no warnings 'redefine'; @@ -23,26 +24,26 @@ sub can_run_git { my @ret = (1, ''); -CHECK: +TRY: { my @args = ( abs_path($filename), 'version', ); - my $git = 't/bin/git'; + my $git = catfile(curdir, qw/t bin git/); if ($^O eq 'MSWin32') { unless (-x $git) { $git .= '.bat'; unless (-x $git) { @ret = (0, "no $git executable"); - last CHECK; + last TRY; } } } else { unless (-x $git) { @ret = (0, "no $git executable"); - last CHECK; + last TRY; } } @@ -50,7 +51,7 @@ CHECK: if ($? == -1) { @ret = (0, $! || "unknown"); - last CHECK; + last TRY; } my $status;