Adjust run-tests.php to dynamic extension loading

PR #6787 changed the behavior of the `--EXTENSIONS--` section, so that
not yet loaded extensions are dynamically loaded if possible.  However,
when no tests are specified for the runner, only tests for already
loaded extensions are run, what defeats the purpose of the improvement
of the `--EXTENSIONS--` behavior.  We cater to that by detecting
loadable extensions, and also run their tests.
This commit is contained in:
Christoph M. Becker 2021-05-16 16:55:28 +02:00
parent f57526a07a
commit 6f89da78d0
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6

View file

@ -860,9 +860,22 @@ More .INIs : " , (function_exists(\'php_ini_scanned_files\') ? str_replace("\n"
} }
@unlink($info_file); @unlink($info_file);
// load list of enabled extensions // load list of enabled and loadable extensions
save_text($info_file, save_text($info_file, <<<'PHP'
'<?php echo str_replace("Zend OPcache", "opcache", implode(",", get_loaded_extensions())); ?>'); <?php
echo str_replace("Zend OPcache", "opcache", implode(",", get_loaded_extensions()));
$ext_dir = ini_get("extension_dir");
foreach (scandir($ext_dir) as $file) {
if (!preg_match('/^(?:php_)?([_a-zA-Z0-9]+)\.(?:so|dll)$/', $file, $matches)) {
continue;
}
$ext = $matches[1];
if (!extension_loaded($ext) && @dl($file)) {
echo ",", $ext;
}
}
?>
PHP);
$exts_to_test = explode(',', `$php $pass_options $info_params $no_file_cache "$info_file"`); $exts_to_test = explode(',', `$php $pass_options $info_params $no_file_cache "$info_file"`);
// check for extensions that need special handling and regenerate // check for extensions that need special handling and regenerate
$info_params_ex = [ $info_params_ex = [