summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php56
1 files changed, 15 insertions, 41 deletions
diff --git a/run-tests.php b/run-tests.php
index d50e4b7861..4f0c793260 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -59,27 +59,6 @@ NO_PROC_OPEN_ERROR;
exit;
}
-// Version constants only available as of 5.2.8
-if (!defined("PHP_VERSION_ID")) {
- list($major, $minor, $bug) = explode(".", phpversion(), 3);
- $bug = (int)$bug; // Many distros make up their own versions
- if ($bug < 10) {
- $bug = "0$bug";
- }
-
- define("PHP_VERSION_ID", "{$major}0{$minor}$bug");
- define("PHP_MAJOR_VERSION", $major);
-}
-
-// __DIR__ is available from 5.3.0
-if (PHP_VERSION_ID < 50300) {
- define('__DIR__', realpath(dirname(__FILE__)));
- // FILE_BINARY is available from 5.2.7
- if (PHP_VERSION_ID < 50207) {
- define('FILE_BINARY', 0);
- }
-}
-
// If timezone is not set, use UTC.
if (ini_get('date.timezone') == '') {
date_default_timezone_set('UTC');
@@ -113,22 +92,6 @@ while(@ob_end_clean());
if (ob_get_level()) echo "Not all buffers were deleted.\n";
error_reporting(E_ALL);
-if (PHP_MAJOR_VERSION < 6) {
- if (ini_get('safe_mode')) {
- echo <<< SAFE_MODE_WARNING
-
-+-----------------------------------------------------------+
-| ! WARNING ! |
-| You are running the test-suite with "safe_mode" ENABLED ! |
-| |
-| Chances are high that no test will work at all, |
-| depending on how you configured "safe_mode" ! |
-+-----------------------------------------------------------+
-
-
-SAFE_MODE_WARNING;
- }
-}
$environment = isset($_ENV) ? $_ENV : array();
if ((substr(PHP_OS, 0, 3) == "WIN") && empty($environment["SystemRoot"])) {
@@ -247,7 +210,6 @@ $exts_to_test = array();
$ini_overwrites = array(
'output_handler=',
'open_basedir=',
- 'safe_mode=0',
'disable_functions=',
'output_buffering=Off',
'error_reporting=' . (E_ALL | E_STRICT),
@@ -311,10 +273,13 @@ More .INIs : " , (function_exists(\'php_ini_scanned_files\') ? str_replace("\n"
$phpdbg_info = '';
}
+ if (function_exists('opcache_invalidate')) {
+ opcache_invalidate($info_file, true);
+ }
@unlink($info_file);
// load list of enabled extensions
- save_text($info_file, '<?php echo join(",", get_loaded_extensions()); ?>');
+ save_text($info_file, '<?php echo str_replace("Zend OPcache", "opcache", join(",", get_loaded_extensions())); ?>');
$exts_to_test = explode(',',`$php $pass_options $info_params $no_file_cache "$info_file"`);
// check for extensions that need special handling and regenerate
$info_params_ex = array(
@@ -331,6 +296,9 @@ More .INIs : " , (function_exists(\'php_ini_scanned_files\') ? str_replace("\n"
}
}
+ if (function_exists('opcache_invalidate')) {
+ opcache_invalidate($info_file, true);
+ }
@unlink($info_file);
// Write test context information.
@@ -1411,6 +1379,7 @@ TEST $file
return 'SKIPPED';
}
}
+ $uses_cgi = true;
}
/* For phpdbg tests, check if phpdbg sapi is available and if it is, use it. */
@@ -1631,6 +1600,11 @@ TEST $file
$info = " (warn: $m[1])";
}
}
+
+ if (!strncasecmp('xfail', ltrim($output), 5)) {
+ // Pretend we have an XFAIL section
+ $section_text['XFAIL'] = trim(substr(ltrim($output), 5));
+ }
}
}
@@ -1951,7 +1925,7 @@ COMMAND $cmd
/* when using CGI, strip the headers from the output */
$headers = "";
- if (isset($old_php) && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) {
+ if (!empty($uses_cgi) && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) {
$output = trim($match[2]);
$rh = preg_split("/[\n\r]+/", $match[1]);
$headers = array();
@@ -2832,7 +2806,7 @@ function junit_mark_test_as($type, $file_name, $test_name, $time = null, $messag
} elseif ('WARN' == $type) {
junit_suite_record($suite, 'test_warn');
$JUNIT['files'][$file_name]['xml'] .= "<warning>$escaped_message</warning>\n";
- } elseif('FAIL' == $type) {
+ } elseif ('FAIL' == $type) {
junit_suite_record($suite, 'test_fail');
$JUNIT['files'][$file_name]['xml'] .= "<failure type='$output_type' message='$escaped_message'>$escaped_details</failure>\n";
} else {