From f40170ee6f7fa3385b5e9616ba0cb3881b106e7a Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Fri, 18 Apr 2025 15:43:54 +0700 Subject: [PATCH] update extension tests to support shared extensions --- src/globals/test-extensions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 9de7fb5a..57cb9933 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -30,7 +30,7 @@ $test_os = [ ]; // whether enable thread safe -$zts = false; +$zts = true; $no_strip = false; @@ -46,6 +46,12 @@ $extensions = match (PHP_OS_FAMILY) { 'Windows' => 'pgsql,pdo_pgsql', }; +// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). +$shared_extensions = match (PHP_OS_FAMILY) { + 'Linux' => 'apcu,ffi,xdebug,xsl,zip', + 'Windows', 'Darwin' => '', +}; + // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { 'Linux', 'Darwin' => '', @@ -87,6 +93,7 @@ if (!isset($argv[1])) { $trim_value = "\r\n \t,"; $final_extensions = trim(trim($extensions, $trim_value) . ',' . _getCombination($base_combination), $trim_value); +$download_extensions = trim($final_extensions . ',' . $shared_extensions, $trim_value); $final_libs = trim($with_libs, $trim_value); if (PHP_OS_FAMILY === 'Windows') { @@ -107,7 +114,7 @@ function quote2(string $param): string // generate download command if ($argv[1] === 'download_cmd') { $down_cmd = 'download '; - $down_cmd .= '--for-extensions=' . quote2($final_extensions) . ' '; + $down_cmd .= '--for-extensions=' . quote2($download_extensions) . ' '; $down_cmd .= '--for-libs=' . quote2($final_libs) . ' '; $down_cmd .= '--with-php=' . quote2($argv[3]) . ' '; $down_cmd .= '--ignore-cache-sources=php-src '; @@ -128,6 +135,7 @@ if ($argv[1] === 'install_upx_cmd') { if ($argv[1] === 'build_cmd' || $argv[1] === 'build_embed_cmd') { $build_cmd = 'build '; $build_cmd .= quote2($final_extensions) . ' '; + $build_cmd .= $shared_extensions ? '--build-shared=' . quote2($shared_extensions) . ' ' : ''; $build_cmd .= $zts ? '--enable-zts ' : ''; $build_cmd .= $no_strip ? '--no-strip ' : ''; $build_cmd .= $upx ? '--with-upx-pack ' : '';