summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorJohn Boehr <jbboehr@gmail.com>2017-08-06 15:04:36 -0700
committerAnatol Belski <ab@php.net>2017-08-18 17:34:48 +0200
commit59558ffd961c5002be5cf99245c6c76be569cf1e (patch)
treea0e3ee40cb7df3f9cff0d0be61c477a6171092ac /run-tests.php
parentdebbaba93f3c8bbc1ca02744c3489800e7dfd76a (diff)
downloadphp-git-59558ffd961c5002be5cf99245c6c76be569cf1e.tar.gz
Fix issues with phpt and EXTENSION on windows (BUG 75042)
* Commands are not properly escaped for windows * Specifying "-n" to check loaded modules causes "Module already loaded" warning * Extensions to be loaded need the "php_" prefix on Windows Bug: https://bugs.php.net/bug.php?id=75042 Add back -n flag to fetch loaded extensions in run-tests.php Add test for phpt EXTENSIONS directive Add a second test for bug 75042 Add test to test loading of nonexistent shared module with the EXTENSIONS phpt block Pass ini settings when checking loaded extensions
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/run-tests.php b/run-tests.php
index 8cdaa03b20..a32db44bf8 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1575,15 +1575,19 @@ TEST $file
// Additional required extensions
if (array_key_exists('EXTENSIONS', $section_text)) {
- $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+ $ext_params = array();
+ settings2array($ini_overwrites, $ext_params);
+ settings2params($ext_params);
+ $ext_dir=`$php $pass_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`;
$extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS']));
- $loaded = explode(",", `$php -n -r 'echo implode(",", get_loaded_extensions());'`);
+ $loaded = explode(",", `$php $pass_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`);
+ $ext_prefix = substr(PHP_OS, 0, 3) === "WIN" ? "php_" : "";
foreach ($extensions as $req_ext) {
if (!in_array($req_ext, $loaded)) {
if ($req_ext == 'opcache') {
- $ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+ $ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
} else {
- $ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+ $ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $ext_prefix . $req_ext . '.' . PHP_SHLIB_SUFFIX;
}
}
}