Skip to content

Commit 1015eef

Browse files
committed
Automatically skip ext/opcache tests under --preload
Also skip observer tests, as these will observe the additional preload file inserted by the test runner.
1 parent 1a370d3 commit 1015eef

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Diff for: run-tests.php

+15-5
Original file line numberDiff line numberDiff line change
@@ -1326,14 +1326,24 @@ function system_with_timeout(
13261326
function run_all_tests(array $test_files, array $env, $redir_tested = null): void
13271327
{
13281328
global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx, $file_cache;
1329+
global $preload;
13291330
// Parallel testing
13301331
global $PHP_FAILED_TESTS, $workers, $workerID, $workerSock;
13311332

1332-
if ($file_cache !== null) {
1333-
/* Automatically skip opcache tests in --file-cache mode,
1334-
* because opcache generally doesn't expect those to run under file cache */
1335-
$test_files = array_filter($test_files, function($test) {
1336-
return !is_string($test) || false === strpos($test, 'ext/opcache');
1333+
if ($file_cache !== null || $preload) {
1334+
/* Automatically skip opcache tests in --file-cache and --preload mode,
1335+
* because opcache generally expects these to run under a default configuration. */
1336+
$test_files = array_filter($test_files, function($test) use($preload) {
1337+
if (!is_string($test)) {
1338+
return true;
1339+
}
1340+
if (false !== strpos($test, 'ext/opcache')) {
1341+
return false;
1342+
}
1343+
if ($preload && false !== strpos($test, 'ext/zend_test/tests/observer')) {
1344+
return false;
1345+
}
1346+
return true;
13371347
});
13381348
}
13391349

0 commit comments

Comments
 (0)