changeset 861:6868e610eacc

Tests: detect Sanitizer errors.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 01 Mar 2016 12:55:59 +0300
parents cba4b1bccfd1
children 3021b44d0594
files lib/Test/Nginx.pm
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }