comparison gunzip_static.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 6a0d934950bc
children 847ea345becb
comparison
equal deleted inserted replaced
391:915ef26ac6eb 392:c28ecaef065f
72 72
73 $t->write_file('t1.gz', $out); 73 $t->write_file('t1.gz', $out);
74 $t->write_file('t2.gz', $out . $out); 74 $t->write_file('t2.gz', $out . $out);
75 $t->write_file('t3', 'not compressed'); 75 $t->write_file('t3', 'not compressed');
76 76
77 eval { 77 $t->try_run('no gzip_static always')->plan(12);
78 open OLDERR, ">&", \*STDERR; close STDERR;
79 $t->run();
80 open STDERR, ">&", \*OLDERR;
81 };
82 plan(skip_all => 'no gzip_static always') if $@;
83
84 $t->plan(12);
85 78
86 ############################################################################### 79 ###############################################################################
87 80
88 pass('runs'); 81 pass('runs');
89 82