Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Zend/tests/partial_application/preloading.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PFA preloading
opcache.enable=1
opcache.enable_cli=1
opcache.preload={PWD}/preloading.inc
opcache.file_cache_only=0
--SKIPIF--
<?php
if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows');
Expand Down
17 changes: 12 additions & 5 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ function main(): void
verify_config($php);
write_information($user_tests, $phpdbg);

if ($file_cache === 'prime') {
$cache_dir = get_file_cache_dir();
rmdir_recursive($cache_dir);
mkdir($cache_dir, recursive: true);
}

if ($test_cnt) {
$exts_tested = [];
$exts_skipped = [];
Expand Down Expand Up @@ -1054,6 +1060,11 @@ function find_files(string $dir, bool $is_ext_dir = false, bool $ignore = false)
closedir($o);
}

function get_file_cache_dir(): string
{
return sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php-run-tests-file-cache';
}

function rmdir_recursive($dir)
{
if (!file_exists($dir)) {
Expand Down Expand Up @@ -2091,11 +2102,7 @@ function run_test(string $php, $file, array $env): string
$orig_ini_settings = settings2params($ini_settings);

if ($file_cache !== null) {
$ini_settings['opcache.file_cache'] = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php-run-tests-file-cache';
if ($file_cache === 'prime') {
rmdir_recursive($ini_settings['opcache.file_cache']);
mkdir($ini_settings['opcache.file_cache'], recursive: true);
}
$ini_settings['opcache.file_cache'] = get_file_cache_dir();
// Make sure warnings still show up on the second run.
$ini_settings['opcache.record_warnings'] = '1';
// File cache is currently incompatible with JIT.
Expand Down
Loading