diff http_resolver_aaaa.t @ 392:c28ecaef065f

Tests: try_run() introduced. This method replaces multiple ad-hoc solutions to grecefully skip tests if nginx startup fails, e.g., due to no support for a particular directive.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 18 Apr 2014 18:36:26 +0400
parents 82db241184e0
children 847ea345becb
line wrap: on
line diff
--- a/http_resolver_aaaa.t
+++ b/http_resolver_aaaa.t
@@ -68,12 +68,7 @@ http {
 
 EOF
 
-eval {
-	open OLDERR, ">&", \*STDERR; close STDERR;
-	$t->run();
-	open STDERR, ">&", \*OLDERR;
-};
-plan(skip_all => 'no inet6 support') if $@;
+$t->try_run('no inet6 support')->plan(72);
 
 $t->run_daemon(\&dns_daemon, 8081, $t);
 $t->run_daemon(\&dns_daemon, 8082, $t);
@@ -81,8 +76,6 @@ plan(skip_all => 'no inet6 support') if 
 $t->waitforfile($t->testdir . '/8081');
 $t->waitforfile($t->testdir . '/8082');
 
-$t->plan(72);
-
 ###############################################################################
 
 my (@n, $response);