# HG changeset patch # User Maxim Dounin # Date 1723169931 -10800 # Node ID e9235c647f45bc6a333fccbbc0d4e8f6d0ea716a # Parent 6b1222de82860405a1563d7f3cdb79765a53ec09 Tests: better binary path handling on Windows. The ".exe" extension is no longer required, and testing is allowed if it is omitted. Additionally, forward slashes in the binary path are automatically replaced with reverse slashes, since CMD cannot properly handle relative paths with forward slashes, and such paths previously resulted in various issues, including non-working $t->has() and $t->has_version(). In particular, with these changes the default binary path, which is "../nginx/objs/nginx", works properly, and testing can be done without any additional options. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -49,8 +49,10 @@ sub new { or die "Can't create temp directory: $!\n"; $self->{_testdir} =~ s!\\!/!g if $^O eq 'MSWin32'; + $NGINX =~ s!/!\\!g if $^O eq 'MSWin32'; + Test::More::BAIL_OUT("no $NGINX binary found") - unless -x $NGINX; + unless -x $NGINX or ($^O eq 'MSWin32' and -x "$NGINX.exe"); return $self; }