# HG changeset patch # User Sergey Kandaurov # Date 1459530987 -10800 # Node ID f4189a38c3a4db25776954b44fa32c09bd2905be # Parent b06beed07bc88ef1b9086a2f7761b0e0b327b76e Tests: mark 'phantom event' alerts on Solaris as TODO (iff any). diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm --- a/lib/Test/Nginx.pm +++ b/lib/Test/Nginx.pm @@ -66,9 +66,14 @@ sub DESTROY { if (Test::More->builder->expected_tests) { local $Test::Nginx::TODO = 'alerts' unless $self->{_alerts}; - my $alerts = $self->read_file('error.log'); - $alerts = join "\n", $alerts =~ /.+\[alert\].+/gm; - Test::More::is($alerts, '', 'no alerts'); + my @alerts = $self->read_file('error.log') =~ /.+\[alert\].+/gm; + + if ($^O eq 'solaris') { + $Test::Nginx::TODO = 'alerts' if @alerts + && ! grep { $_ !~ /phantom event/ } @alerts; + } + + Test::More::is(join("\n", @alerts), '', 'no alerts'); } if (Test::More->builder->expected_tests) { diff --git a/limit_conn.t b/limit_conn.t --- a/limit_conn.t +++ b/limit_conn.t @@ -23,8 +23,6 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy limit_conn limit_req shmem/); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF')->plan(8); %%TEST_GLOBALS%% diff --git a/mail_imap_ssl.t b/mail_imap_ssl.t --- a/mail_imap_ssl.t +++ b/mail_imap_ssl.t @@ -37,8 +37,6 @@ my $t = Test::Nginx->new() ->has(qw/mail mail_ssl imap http rewrite/)->has_daemon('openssl') ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon)->plan(12); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/proxy_unfinished.t b/proxy_unfinished.t --- a/proxy_unfinished.t +++ b/proxy_unfinished.t @@ -33,8 +33,6 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy cache sub shmem/)->plan(15); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/stream_access.t b/stream_access.t --- a/stream_access.t +++ b/stream_access.t @@ -25,8 +25,6 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/stream stream_access ipv6/); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/stream_proxy_ssl_verify.t b/stream_proxy_ssl_verify.t --- a/stream_proxy_ssl_verify.t +++ b/stream_proxy_ssl_verify.t @@ -24,8 +24,6 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/stream stream_ssl/)->has_daemon('openssl'); -$t->todo_alerts() if $^O eq 'solaris'; - $t->write_file_expand('nginx.conf', <<'EOF')->plan(6); %%TEST_GLOBALS%% diff --git a/stream_ssl.t b/stream_ssl.t --- a/stream_ssl.t +++ b/stream_ssl.t @@ -35,8 +35,6 @@ plan(skip_all => 'Net::SSLeay not instal my $t = Test::Nginx->new()->has(qw/stream stream_ssl/)->has_daemon('openssl'); -$t->todo_alerts() if $^O eq 'solaris'; - $t->plan(7)->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% diff --git a/stream_tcp_nodelay.t b/stream_tcp_nodelay.t --- a/stream_tcp_nodelay.t +++ b/stream_tcp_nodelay.t @@ -28,8 +28,6 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/stream/); -$t->todo_alerts() if $^O eq 'solaris'; - plan(skip_all => 'no tcp_nodelay') unless $t->has_version('1.9.4'); $t->plan(2)->write_file_expand('nginx.conf', <<'EOF');