comparison lib/Test/Nginx.pm @ 1308:58fdd9515f81

Tests: fixed printing try_run() diagnostics. Previously, error log path could point to junk on unsuccessful regex match.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 26 Mar 2018 14:27:57 +0300
parents beed8146d045
children fda743e92b31
comparison
equal deleted inserted replaced
1307:23026106e439 1308:58fdd9515f81
289 }; 289 };
290 290
291 return $self unless $@; 291 return $self unless $@;
292 292
293 if ($ENV{TEST_NGINX_VERBOSE}) { 293 if ($ENV{TEST_NGINX_VERBOSE}) {
294 $self->{_configure_args} =~ m!--error-log-path=(\S+)!; 294 my $path = $self->{_configure_args} =~ m!--error-log-path=(\S+)!
295 my $path = $1 || 'logs/error.log'; 295 ? $1 : 'logs/error.log';
296 $path = "$self->{_testdir}/$path" if index($path, '/'); 296 $path = "$self->{_testdir}/$path" if index($path, '/');
297 297
298 open F, '<', $path or die "Can't open $path: $!"; 298 open F, '<', $path or die "Can't open $path: $!";
299 log_core($_) while (<F>); 299 log_core($_) while (<F>);
300 close F; 300 close F;