run-tests.php improvement for PHP 7.0+

From: Date: Mon, 09 May 2016 18:36:19 +0000
Subject: run-tests.php improvement for PHP 7.0+
Groups: php.internals 
Request: Send a blank email to internals+get-93130@lists.php.net to get a copy of this message
Hi! I've recently been having some looks at issues between xdebug and opcache, and this meant that I need to write a test case for it. Ages ago I added support for the "--EXTENSIONS--" section in .phpt files, to load extensions that the test 'depends' on. Each item would be added to the php invocation as a "-dextension=name.so". For opcache however, that needs to be "-dzend_extension=opcache.so". The attached patch checks for opcache in the list of extensions and then uses zend_extension=. I'd like to have this in PHP 7.0 and trunk - any objections? cheers, Derick

--- run-tests.php 2016-05-08 20:51:02.188875622 -0400 +++ /home/derick/dev/php/run-tests-fixed.php 2016-05-07 10:37:18.086250277 -0400 @@ -1509,7 +1547,11 @@ $loaded = explode(",", `$php -n -r 'echo join(",", get_loaded_extensions());'`); foreach ($extensions as $req_ext) { if (!in_array($req_ext, $loaded)) { - $ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX; + if ($req_ext == 'opcache') { + $ini_settings['zend_extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX; + } else { + $ini_settings['extension'][] = $ext_dir . DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX; + } } } } @@ -2336,7 +2378,7 @@ $name = trim($setting[0]); $value = trim($setting[1]); - if ($name == 'extension') { + if ($name == 'extension' || $name == 'zend_extension') { if (!isset($ini_settings[$name])) { $ini_settings[$name] = array();
« previous php.internals (#93130) next »