diff gunzip_memcached.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 6c5597ad40a3
children 847ea345becb
line wrap: on
line diff
--- a/gunzip_memcached.t
+++ b/gunzip_memcached.t
@@ -71,14 +71,7 @@ if ($memhelp =~ /-U/) {
 
 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081', @memopts);
 
-eval {
-	open OLDERR, ">&", \*STDERR; close STDERR;
-	$t->run();
-	open STDERR, ">&", \*OLDERR;
-};
-plan(skip_all => 'no memcached_gzip_flag') if $@;
-
-$t->plan(2);
+$t->try_run('no memcached_gzip_flag')->plan(2);
 
 $t->waitforsocket('127.0.0.1:8081')
 	or die "Can't start memcached";