Mercurial > hg > nginx-tests
comparison lib/Test/Nginx.pm @ 1027:6ef255ed4bbc
Tests: set "env PERL5LIB" modules paths fallback for perl module.
Paths are based on build directory to ease running nginx built with perl module.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 05 Sep 2016 15:02:17 +0300 |
parents | 196d33c2bb45 |
children | c0accd6fab6c |
comparison
equal
deleted
inserted
replaced
1026:e74a9342eb96 | 1027:6ef255ed4bbc |
---|---|
519 | 519 |
520 $s .= $ENV{TEST_NGINX_GLOBALS} | 520 $s .= $ENV{TEST_NGINX_GLOBALS} |
521 if $ENV{TEST_NGINX_GLOBALS}; | 521 if $ENV{TEST_NGINX_GLOBALS}; |
522 | 522 |
523 $s .= $self->test_globals_modules(); | 523 $s .= $self->test_globals_modules(); |
524 $s .= $self->test_globals_perl5lib() if $s !~ /env PERL5LIB/; | |
524 | 525 |
525 $self->{_test_globals} = $s; | 526 $self->{_test_globals} = $s; |
526 } | 527 } |
527 | 528 |
528 sub test_globals_modules() { | 529 sub test_globals_modules() { |
554 | 555 |
555 $s .= "load_module $modules/ngx_stream_module.so;\n" | 556 $s .= "load_module $modules/ngx_stream_module.so;\n" |
556 if $self->has_module('stream=dynamic'); | 557 if $self->has_module('stream=dynamic'); |
557 | 558 |
558 return $s; | 559 return $s; |
560 } | |
561 | |
562 sub test_globals_perl5lib() { | |
563 my ($self) = @_; | |
564 | |
565 return '' unless $self->has_module('perl'); | |
566 | |
567 my ($volume, $dir) = File::Spec->splitpath($NGINX); | |
568 my $objs = File::Spec->catpath($volume, $dir, ''); | |
569 | |
570 $objs = File::Spec->rel2abs($objs); | |
571 $objs =~ s!\\!/!g if $^O eq 'MSWin32'; | |
572 | |
573 return "env PERL5LIB=$objs/src/http/modules/perl:" | |
574 . "$objs/src/http/modules/perl/blib/arch;\n"; | |
559 } | 575 } |
560 | 576 |
561 sub test_globals_http() { | 577 sub test_globals_http() { |
562 my ($self) = @_; | 578 my ($self) = @_; |
563 | 579 |