From: Nikita Popov Date: Fri, 15 Feb 2019 10:23:23 +0000 (+0100) Subject: Add a --preload testing mode to run-tests.php X-Git-Tag: php-7.4.0alpha1~1038 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2e953479857451640afa604a533ca177f2a9bf5;p=php Add a --preload testing mode to run-tests.php Not intended for general use, it has many false positives. --- diff --git a/run-tests.php b/run-tests.php index 7c135b2dd4..92d605c4e7 100755 --- a/run-tests.php +++ b/run-tests.php @@ -264,7 +264,6 @@ $ini_overwrites = array( 'log_errors_max_len=0', 'opcache.fast_shutdown=0', 'opcache.file_update_protection=0', - 'opcache.preload=', 'zend.assertions=1', ); @@ -510,6 +509,7 @@ $temp_urlbase = null; $conf_passed = null; $no_clean = false; $slow_min_ms = INF; +$preload = false; $cfgtypes = array('show', 'keep'); $cfgfiles = array('skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem'); @@ -625,6 +625,9 @@ if (isset($argc) && $argc > 1) { case 'e': $pass_options .= ' -e'; break; + case '--preload': + $preload = true; + break; case '--no-clean': $no_clean = true; break; @@ -1256,6 +1259,7 @@ function run_test($php, $file, $env) global $SHOW_ONLY_GROUPS; global $no_file_cache; global $slow_min_ms; + global $preload; $temp_filenames = null; $org_file = $file; @@ -1496,6 +1500,7 @@ TEST $file $test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php'; $temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php'; $test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'clean.php'; + $preload_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'preload.php'; $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('/phpt.'); $tmp_relative_file = str_replace(__DIR__ . DIRECTORY_SEPARATOR, '', $test_file) . 't'; @@ -1546,6 +1551,7 @@ TEST $file @unlink($tmp_post); @unlink($temp_clean); @unlink($test_clean); + @unlink($preload_filename); // Reset environment from any previous test. $env['REDIRECT_STATUS'] = ''; @@ -1790,6 +1796,14 @@ TEST $file $args = isset($section_text['ARGS']) ? ' -- ' . $section_text['ARGS'] : ''; + if ($preload) { + save_text($preload_filename, "