diff options
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/run-tests.php b/run-tests.php index cc20febf71..1b5bcec253 100755 --- a/run-tests.php +++ b/run-tests.php @@ -850,7 +850,7 @@ $exts_skipped = 0; $ignored_by_ext = 0; sort($exts_to_test); $test_dirs = array(); -$optionals = array('tests', 'ext', 'Zend', 'ZendEngine2', 'sapi/cli', 'sapi/cgi'); +$optionals = array('tests', 'ext', 'Zend', 'ZendEngine2', 'sapi/cli', 'sapi/cgi', 'sapi/fpm'); foreach($optionals as $dir) { if (@filetype($dir) == 'dir') { @@ -1291,16 +1291,20 @@ TEST $file unset($section_text['FILEEOF']); } - if (@count($section_text['FILE_EXTERNAL']) == 1) { - // don't allow tests to retrieve files from anywhere but this subdirectory - $section_text['FILE_EXTERNAL'] = dirname($file) . '/' . trim(str_replace('..', '', $section_text['FILE_EXTERNAL'])); + foreach (array( 'FILE', 'EXPECT', 'EXPECTF', 'EXPECTREGEX' ) as $prefix) { + $key = $prefix . '_EXTERNAL'; - if (file_exists($section_text['FILE_EXTERNAL'])) { - $section_text['FILE'] = file_get_contents($section_text['FILE_EXTERNAL'], FILE_BINARY); - unset($section_text['FILE_EXTERNAL']); - } else { - $bork_info = "could not load --FILE_EXTERNAL-- " . dirname($file) . '/' . trim($section_text['FILE_EXTERNAL']); - $borked = true; + if (@count($section_text[$key]) == 1) { + // don't allow tests to retrieve files from anywhere but this subdirectory + $section_text[$key] = dirname($file) . '/' . trim(str_replace('..', '', $section_text[$key])); + + if (file_exists($section_text[$key])) { + $section_text[$prefix] = file_get_contents($section_text[$key], FILE_BINARY); + unset($section_text[$key]); + } else { + $bork_info = "could not load --" . $key . "-- " . dirname($file) . '/' . trim($section_text[$key]); + $borked = true; + } } } |