@@ -2135,17 +2135,18 @@ function run_test($php, $file, $env)
2135
2135
2136
2136
junit_start_timer ($ shortname );
2137
2137
2138
- $ output = system_with_timeout ("$ extra $ php $ pass_options $ extra_options -q $ orig_ini_settings $ no_file_cache -d display_errors=0 \"$ test_skipif \"" , $ env );
2138
+ $ output = system_with_timeout ("$ extra $ php $ pass_options $ extra_options -q $ orig_ini_settings $ no_file_cache -d display_errors=1 \"$ test_skipif \"" , $ env );
2139
+ $ output = trim ($ output );
2139
2140
2140
2141
junit_finish_timer ($ shortname );
2141
2142
2142
2143
if (!$ cfg ['keep ' ]['skip ' ]) {
2143
2144
@unlink ($ test_skipif );
2144
2145
}
2145
2146
2146
- if (!strncasecmp ('skip ' , ltrim ( $ output) , 4 )) {
2147
+ if (!strncasecmp ('skip ' , $ output , 4 )) {
2147
2148
2148
- if (preg_match ('/^\s* skip\s*(.+)\s* /i ' , $ output , $ m )) {
2149
+ if (preg_match ('/^skip\s*(.+)/i ' , $ output , $ m )) {
2149
2150
show_result ('SKIP ' , $ tested , $ tested_file , "reason: $ m [1 ]" , $ temp_filenames );
2150
2151
} else {
2151
2152
show_result ('SKIP ' , $ tested , $ tested_file , '' , $ temp_filenames );
@@ -2160,22 +2161,26 @@ function run_test($php, $file, $env)
2160
2161
return 'SKIPPED ' ;
2161
2162
}
2162
2163
2163
- if (!strncasecmp ('info ' , ltrim ($ output ), 4 )) {
2164
- if (preg_match ('/^\s*info\s*(.+)\s*/i ' , $ output , $ m )) {
2165
- $ info = " (info: $ m [1 ]) " ;
2166
- }
2167
- }
2168
-
2169
- if (!strncasecmp ('warn ' , ltrim ($ output ), 4 )) {
2170
- if (preg_match ('/^\s*warn\s*(.+)\s*/i ' , $ output , $ m )) {
2171
- $ warn = true ; /* only if there is a reason */
2172
- $ info = " (warn: $ m [1 ]) " ;
2173
- }
2174
- }
2175
-
2176
- if (!strncasecmp ('xfail ' , ltrim ($ output ), 5 )) {
2164
+ if (!strncasecmp ('info ' , $ output , 4 ) && preg_match ('/^info\s*(.+)/i ' , $ output , $ m )) {
2165
+ $ info = " (info: $ m [1 ]) " ;
2166
+ } elseif (!strncasecmp ('warn ' , $ output , 4 ) && preg_match ('/^warn\s*(.+)/i ' , $ output , $ m )) {
2167
+ $ warn = true ; /* only if there is a reason */
2168
+ $ info = " (warn: $ m [1 ]) " ;
2169
+ } elseif (!strncasecmp ('xfail ' , $ output , 5 )) {
2177
2170
// Pretend we have an XFAIL section
2178
- $ section_text ['XFAIL ' ] = trim (substr (ltrim ($ output ), 5 ));
2171
+ $ section_text ['XFAIL ' ] = ltrim (substr ($ output , 5 ));
2172
+ } elseif ($ output !== '' ) {
2173
+ show_result ("BORK " , $ output , $ tested_file , 'reason: invalid output from SKIPIF ' , $ temp_filenames );
2174
+ $ PHP_FAILED_TESTS ['BORKED ' ][] = array (
2175
+ 'name ' => $ file ,
2176
+ 'test_name ' => '' ,
2177
+ 'output ' => '' ,
2178
+ 'diff ' => '' ,
2179
+ 'info ' => "$ output [ $ file] " ,
2180
+ );
2181
+
2182
+ junit_mark_test_as ('BORK ' , $ shortname , $ tested , null , $ output );
2183
+ return 'BORKED ' ;
2179
2184
}
2180
2185
}
2181
2186
}
@@ -2232,7 +2237,7 @@ function run_test($php, $file, $env)
2232
2237
} else {
2233
2238
2234
2239
$ bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory. " ;
2235
- show_result ("BORK " , $ bork_info , '' , $ temp_filenames );
2240
+ show_result ("BORK " , $ bork_info , '' , '' , $ temp_filenames );
2236
2241
$ PHP_FAILED_TESTS ['BORKED ' ][] = array (
2237
2242
'name ' => $ file ,
2238
2243
'test_name ' => '' ,
@@ -2250,7 +2255,7 @@ function run_test($php, $file, $env)
2250
2255
}
2251
2256
2252
2257
$ bork_info = "Redirected test did not contain redirection info " ;
2253
- show_result ("BORK " , $ bork_info , '' , $ temp_filenames );
2258
+ show_result ("BORK " , $ bork_info , '' , '' , $ temp_filenames );
2254
2259
$ PHP_FAILED_TESTS ['BORKED ' ][] = array (
2255
2260
'name ' => $ file ,
2256
2261
'test_name ' => '' ,
0 commit comments