# HG changeset patch # User Sergey Kandaurov # Date 1510662858 -10800 # Node ID e35cc79ed4a12f80cbed956383aa23b473edf74b # Parent e4974af3fb12eac2c42a418ac7ae986e58c5fc86 Tests: show try_run() errors in verbose mode. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -287,7 +287,19 @@ sub try_run($$) { open STDERR, ">&", \*OLDERR; }; - Test::More::plan(skip_all => $message) if $@; + return $self unless $@; + + if ($ENV{TEST_NGINX_VERBOSE}) { + $self->{_configure_args} =~ m!--error-log-path=(\S+)!; + my $path = $1 || 'logs/error.log'; + $path = "$self->{_testdir}/$path" if index($path, '/'); + + open F, '<', $path or die "Can't open $path: $!"; + log_core($_) while (); + close F; + } + + Test::More::plan(skip_all => $message); return $self; }