Mercurial > hg > nginx-tests
comparison lib/Test/Nginx.pm @ 1238:e35cc79ed4a1
Tests: show try_run() errors in verbose mode.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 14 Nov 2017 15:34:18 +0300 |
parents | 93f749c1d5c5 |
children | ea3c7659b6c1 |
comparison
equal
deleted
inserted
replaced
1237:e4974af3fb12 | 1238:e35cc79ed4a1 |
---|---|
285 open OLDERR, ">&", \*STDERR; close STDERR; | 285 open OLDERR, ">&", \*STDERR; close STDERR; |
286 $self->run(); | 286 $self->run(); |
287 open STDERR, ">&", \*OLDERR; | 287 open STDERR, ">&", \*OLDERR; |
288 }; | 288 }; |
289 | 289 |
290 Test::More::plan(skip_all => $message) if $@; | 290 return $self unless $@; |
291 | |
292 if ($ENV{TEST_NGINX_VERBOSE}) { | |
293 $self->{_configure_args} =~ m!--error-log-path=(\S+)!; | |
294 my $path = $1 || 'logs/error.log'; | |
295 $path = "$self->{_testdir}/$path" if index($path, '/'); | |
296 | |
297 open F, '<', $path or die "Can't open $path: $!"; | |
298 log_core($_) while (<F>); | |
299 close F; | |
300 } | |
301 | |
302 Test::More::plan(skip_all => $message); | |
291 return $self; | 303 return $self; |
292 } | 304 } |
293 | 305 |
294 sub plan($) { | 306 sub plan($) { |
295 my ($self, $plan) = @_; | 307 my ($self, $plan) = @_; |