From 797cae7278c40ca289fe058642b1becabf5d622f Mon Sep 17 00:00:00 2001 From: Mark Gallagher Date: Sun, 25 Apr 2021 17:02:55 +0100 Subject: [PATCH 1/2] run-tests: revert "EXTENSIONS" section bug introduced in #2673 documented behaviour of loading extensions from shared modules was broken some time ago, this patch reintroduces that feature whilst retaining other changes which allow the skip cache to work --- run-tests.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/run-tests.php b/run-tests.php index 3b11bf2c2ad49..836564282de04 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2051,7 +2051,7 @@ function run_test(string $php, $file, array $env): string settings2array($ini_overwrites, $ext_params); $ext_params = settings2params($ext_params); $extensions = preg_split("/[\n\r]+/", trim($test->getSection('EXTENSIONS'))); - [$ext_dir, $loaded] = $skipCache->getExtensions("$php $pass_options $extra_options $ext_params $no_file_cache"); + [$ext_dir, $loaded] = $skipCache->getExtensions("$php", "$pass_options $extra_options $ext_params $no_file_cache"); $ext_prefix = IS_WINDOWS ? "php_" : ""; $missing = []; foreach ($extensions as $req_ext) { @@ -3664,22 +3664,22 @@ public function checkSkip(string $php, string $code, string $checkFile, string $ return $result; } - public function getExtensions(string $php): array + public function getExtensions(string $php, string $extensionsOptions): array { - if (isset($this->extensions[$php])) { + if (isset($this->extensions[$php . " " . $extensionsOptions])) { $this->extHits++; - return $this->extensions[$php]; + return $this->extensions[$php . " " . $extensionsOptions]; } $extDir = `$php -d display_errors=0 -r "echo ini_get('extension_dir');"`; - $extensions = explode(",", `$php -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); + $extensions = explode(",", `$php $extensionsOptions -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); $extensions = array_map('strtolower', $extensions); if (in_array('zend opcache', $extensions)) { $extensions[] = 'opcache'; } $result = [$extDir, $extensions]; - $this->extensions[$php] = $result; + $this->extensions[$php . " " . $extensionsOptions] = $result; $this->extMisses++; return $result; From da4ce303bfb7ca1c2f9df7e8ca5e67c62662a699 Mon Sep 17 00:00:00 2001 From: maaarghk Date: Sun, 25 Apr 2021 18:54:30 +0100 Subject: [PATCH 2/2] run-tests: style fix Co-authored-by: Markus Staab --- run-tests.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 836564282de04..ae0a3d186ad84 100755 --- a/run-tests.php +++ b/run-tests.php @@ -2051,7 +2051,7 @@ function run_test(string $php, $file, array $env): string settings2array($ini_overwrites, $ext_params); $ext_params = settings2params($ext_params); $extensions = preg_split("/[\n\r]+/", trim($test->getSection('EXTENSIONS'))); - [$ext_dir, $loaded] = $skipCache->getExtensions("$php", "$pass_options $extra_options $ext_params $no_file_cache"); + [$ext_dir, $loaded] = $skipCache->getExtensions($php, "$pass_options $extra_options $ext_params $no_file_cache"); $ext_prefix = IS_WINDOWS ? "php_" : ""; $missing = []; foreach ($extensions as $req_ext) {