# HG changeset patch # User Sergey Kandaurov # Date 1473076937 -10800 # Node ID 6ef255ed4bbcb25106dde3f3df1c8aab4e072259 # Parent e74a9342eb96ec98af2ee6ea12a0ad9e4fbb3263 Tests: set "env PERL5LIB" modules paths fallback for perl module. Paths are based on build directory to ease running nginx built with perl module. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -521,6 +521,7 @@ sub test_globals() { if $ENV{TEST_NGINX_GLOBALS}; $s .= $self->test_globals_modules(); + $s .= $self->test_globals_perl5lib() if $s !~ /env PERL5LIB/; $self->{_test_globals} = $s; } @@ -558,6 +559,21 @@ sub test_globals_modules() { return $s; } +sub test_globals_perl5lib() { + my ($self) = @_; + + return '' unless $self->has_module('perl'); + + my ($volume, $dir) = File::Spec->splitpath($NGINX); + my $objs = File::Spec->catpath($volume, $dir, ''); + + $objs = File::Spec->rel2abs($objs); + $objs =~ s!\\!/!g if $^O eq 'MSWin32'; + + return "env PERL5LIB=$objs/src/http/modules/perl:" + . "$objs/src/http/modules/perl/blib/arch;\n"; +} + sub test_globals_http() { my ($self) = @_;