Skip to content

run-tests: revert "EXTENSIONS" section bug introduced in #2673 #6910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down