# HG changeset patch # User Sergey Kandaurov # Date 1456826159 -10800 # Node ID 6868e610eacc168ac798bfafdf15d13abf28f815 # Parent cba4b1bccfd1fbcb81430e7a775b21e2593eea66 Tests: detect Sanitizer errors. diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -71,6 +71,12 @@ sub DESTROY { Test::More::is($alerts, '', 'no alerts'); } + if (Test::More->builder->expected_tests) { + my $errors = $self->read_file('error.log'); + $errors = join "\n", $errors =~ /.+Sanitizer.+/gm; + Test::More::is($errors, '', 'no sanitizer errors'); + } + if ($ENV{TEST_NGINX_CATLOG}) { system("cat $self->{_testdir}/error.log"); } @@ -240,7 +246,7 @@ sub try_run($$) { sub plan($) { my ($self, $plan) = @_; - Test::More::plan(tests => $plan + 1); + Test::More::plan(tests => $plan + 2); return $self; }