# HG changeset patch # User Sergey Kandaurov # Date 1455637291 -10800 # Node ID d39e98893265082aa471a37dca10ee4ca4a9ecb6 # Parent 47d64d2fd68d8c3cd3ad475b97a4622c74fcd29b Tests: use TEST_NGINX_MODULES to find dynamic modules directory. If not specified, fallback to dirname of TEST_NGINX_BINARY. Either way, the path is normalised to an absolute one for use in "load_module". diff --git a/README b/README --- a/README +++ b/README @@ -18,6 +18,10 @@ TEST_NGINX_BINARY Sets path to nginx binary to be tested, defaults to "../nginx/objs/nginx". +TEST_NGINX_MODULES + + Sets path to modules directory, defaults to dirname of TEST_NGINX_BINARY. + TEST_NGINX_VERBOSE Be a bit more verbose (in particular, print requests sent and responses diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -459,7 +459,14 @@ sub test_globals() { sub test_globals_modules() { my ($self) = @_; - my $modules = File::Spec->rel2abs((File::Spec->splitpath($NGINX))[1]); + my $modules = $ENV{TEST_NGINX_MODULES}; + + if (!defined $modules) { + my ($volume, $dir) = File::Spec->splitpath($NGINX); + $modules = File::Spec->catpath($volume, $dir, ''); + } + + $modules = File::Spec->rel2abs($modules); $modules =~ s!\\!/!g if $^O eq 'MSWin32'; my $s = '';