Mercurial > hg > nginx-tests
comparison lib/Test/Nginx.pm @ 1063:d62747c321a6
Tests: support dynamic geoip modules.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 19 Oct 2016 20:21:58 +0300 |
parents | fbf731526f49 |
children | cca0bff99733 |
comparison
equal
deleted
inserted
replaced
1062:f1cc64e4e67d | 1063:d62747c321a6 |
---|---|
194 if !defined $self->{_configure_args}; | 194 if !defined $self->{_configure_args}; |
195 | 195 |
196 return 1 if $self->{_configure_args} =~ $re; | 196 return 1 if $self->{_configure_args} =~ $re; |
197 | 197 |
198 my %modules = ( | 198 my %modules = ( |
199 http_geoip | |
200 => 'ngx_http_geoip_module', | |
199 image_filter | 201 image_filter |
200 => 'ngx_http_image_filter_module', | 202 => 'ngx_http_image_filter_module', |
201 perl => 'ngx_http_perl_module', | 203 perl => 'ngx_http_perl_module', |
202 xslt => 'ngx_http_xslt_filter_module', | 204 xslt => 'ngx_http_xslt_filter_module', |
203 mail => 'ngx_mail_module', | 205 mail => 'ngx_mail_module', |
204 stream => 'ngx_stream_module', | 206 stream => 'ngx_stream_module', |
207 stream_geoip | |
208 => 'ngx_stream_geoip_module', | |
205 ); | 209 ); |
206 | 210 |
207 my $module = $modules{$feature}; | 211 my $module = $modules{$feature}; |
208 if (defined $module && defined $ENV{TEST_NGINX_GLOBALS}) { | 212 if (defined $module && defined $ENV{TEST_NGINX_GLOBALS}) { |
209 $re = qr/load_module\s+[^;]*\Q$module\E[-\w]*\.so\s*;/; | 213 $re = qr/load_module\s+[^;]*\Q$module\E[-\w]*\.so\s*;/; |
563 $modules = File::Spec->rel2abs($modules); | 567 $modules = File::Spec->rel2abs($modules); |
564 $modules =~ s!\\!/!g if $^O eq 'MSWin32'; | 568 $modules =~ s!\\!/!g if $^O eq 'MSWin32'; |
565 | 569 |
566 my $s = ''; | 570 my $s = ''; |
567 | 571 |
572 $s .= "load_module $modules/ngx_http_geoip_module.so;\n" | |
573 if $self->has_module('http_geoip\S+=dynamic'); | |
574 | |
568 $s .= "load_module $modules/ngx_http_image_filter_module.so;\n" | 575 $s .= "load_module $modules/ngx_http_image_filter_module.so;\n" |
569 if $self->has_module('image_filter\S+=dynamic'); | 576 if $self->has_module('image_filter\S+=dynamic'); |
570 | 577 |
571 $s .= "load_module $modules/ngx_http_perl_module.so;\n" | 578 $s .= "load_module $modules/ngx_http_perl_module.so;\n" |
572 if $self->has_module('perl\S+=dynamic'); | 579 if $self->has_module('perl\S+=dynamic'); |
577 $s .= "load_module $modules/ngx_mail_module.so;\n" | 584 $s .= "load_module $modules/ngx_mail_module.so;\n" |
578 if $self->has_module('mail=dynamic'); | 585 if $self->has_module('mail=dynamic'); |
579 | 586 |
580 $s .= "load_module $modules/ngx_stream_module.so;\n" | 587 $s .= "load_module $modules/ngx_stream_module.so;\n" |
581 if $self->has_module('stream=dynamic'); | 588 if $self->has_module('stream=dynamic'); |
589 | |
590 $s .= "load_module $modules/ngx_stream_geoip_module.so;\n" | |
591 if $self->has_module('stream_geoip\S+=dynamic'); | |
582 | 592 |
583 return $s; | 593 return $s; |
584 } | 594 } |
585 | 595 |
586 sub test_globals_perl5lib() { | 596 sub test_globals_perl5lib() { |