test(compiler): update test configuration and execution setup

- Add empty ini directory placeholders for test isolation
- Set PHP_INI_SCAN_DIR environment in include_require and python tests
- Replace no-leak.ini with descriptive comment for dedicated configuration
- Modify ref-call-arg.phpt to use temporary files instead of fixed paths
- Add ZipArchive operations in ref-call-arg.phpt for proper test data generation
- Update expected output values in ref-call-arg.phpt test results
- Add display_startup_errors=1 to php ini-values in workflow configuration
- Enable opcache.jit=0 setting in workflow configuration for consistency
- Increase
master
韩天峰 10 hours ago
parent e4bb7b2605
commit 2986f3db70
  1. 8
      .github/workflows/tests.yml
  2. 1
      tests/compiler/include_require/001.phpt
  3. 1
      tests/compiler/include_require/empty-ini-dir/.gitkeep
  4. 2
      tests/compiler/include_require/no-leak.ini
  5. 1
      tests/compiler/python/empty-ini-dir/.gitkeep
  6. 1
      tests/compiler/python/missing-phpy.phpt
  7. 20
      tests/compiler/ref/ref-call-arg.phpt

@ -44,7 +44,7 @@ jobs:
php-version: ${{ matrix.php }}
coverage: none
extensions: embed
ini-values: precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, log_errors=0
ini-values: precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, display_startup_errors=1, log_errors=0
tools: composer:v2
- name: Patch php_hash.h C++ compatibility
@ -115,7 +115,7 @@ jobs:
php-version: ${{ matrix.php }}
coverage: none
extensions: embed, curl, redis, mbstring, ffi
ini-values: ffi.enable=1, phpy.enable_operator_overloading=0, precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, log_errors=0
ini-values: ffi.enable=1, phpy.enable_operator_overloading=0, precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, display_startup_errors=1, log_errors=0
tools: composer:v2
- name: Patch php_hash.h C++ compatibility
@ -181,7 +181,7 @@ jobs:
php-version: ${{ matrix.php }}
coverage: none
extensions: embed, curl, redis, mbstring, ffi
ini-values: ffi.enable=1, phpy.enable_operator_overloading=0, precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, log_errors=0
ini-values: ffi.enable=1, phpy.enable_operator_overloading=0, opcache.jit=0, precision=17, memory_limit=4G, error_reporting=E_ERROR|E_WARNING, display_errors=1, display_startup_errors=1, log_errors=0
tools: composer:v2
- name: Patch php_hash.h C++ compatibility
@ -238,7 +238,7 @@ jobs:
- name: Run compiler PHPT suite with bootstrap compiler
run: |
mkdir -p build
php run-tests.php -q -j4 --compiler ./tpc \
php run-tests.php -q -j8 --compiler ./tpc \
-w build/failed-tests.txt -W build/test-results.txt tests/compiler
- name: Upload PHPT failure artifacts

@ -2,6 +2,7 @@
include/require unwind safely when ZendVM calls a compiled function that throws
--ENV--
PHPRC=tests/compiler/include_require/no-leak.ini
PHP_INI_SCAN_DIR={PWD}/empty-ini-dir
--FILE--
<?php
declare(strict_types=1);

@ -1 +1 @@
report_memleaks=0
; Keep a dedicated empty configuration so this test does not inherit local PHP settings.

@ -2,6 +2,7 @@
Using a Python module without phpy raises a catchable PHP Error
--ENV--
PHPRC=tests/compiler/python/empty.ini
PHP_INI_SCAN_DIR={PWD}/empty-ini-dir
--FILE--
<?php
use python\math;

@ -4,8 +4,15 @@ ref call arg
<?php
function main()
{
$path = tempnam(sys_get_temp_dir(), 'typephp-ref-');
$zip = new ZipArchive();
$path = realpath(__DIR__ . '/../../../../data/test.zip');
$zip->open($path, ZipArchive::CREATE | ZipArchive::OVERWRITE);
for ($idx = 0; $idx < 4; $idx++) {
$zip->addFromString('entry-' . $idx, 'data');
$zip->setExternalAttributesIndex($idx, ZipArchive::OPSYS_UNIX, 0100644 << 16);
}
$zip->close();
if ($zip->open($path) === TRUE) {
for ($idx = 0; $s = $zip->statIndex($idx); $idx++) {
$rs = $zip->getExternalAttributesIndex($idx, $opsys, $attr);
@ -14,6 +21,7 @@ function main()
$zip->close();
echo "OK\n";
}
unlink($path);
$str = "first=value&arr[]=foo+bar&arr[]=baz";
parse_str($str, $output);
@ -27,21 +35,21 @@ function main()
bool(true)
int(0)
int(3)
int(1107099648)
int(2175008768)
bool(true)
int(1)
int(3)
int(2176057344)
int(2175008768)
bool(true)
int(2)
int(3)
int(2176057344)
int(2175008768)
bool(true)
int(3)
int(3)
int(2176057344)
int(2175008768)
OK
value
foo bar
baz
DONE
DONE

Loading…
Cancel
Save