mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Improve code quality in run-tests.php (#12889)
This commit is contained in:
parent
1816403d84
commit
36a5f4ffaf
1 changed files with 48 additions and 105 deletions
151
run-tests.php
151
run-tests.php
|
@ -23,12 +23,6 @@
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Temporary variables while this file is being refactored. */
|
|
||||||
/** @var ?JUnit $junit */
|
|
||||||
$junit = null;
|
|
||||||
|
|
||||||
/* End temporary variables. */
|
|
||||||
|
|
||||||
/* Let there be no top-level code beyond this point:
|
/* Let there be no top-level code beyond this point:
|
||||||
* Only functions and classes, thanks!
|
* Only functions and classes, thanks!
|
||||||
*
|
*
|
||||||
|
@ -150,17 +144,16 @@ function main(): void
|
||||||
* looks like it doesn't belong, it probably doesn't; cull at will.
|
* looks like it doesn't belong, it probably doesn't; cull at will.
|
||||||
*/
|
*/
|
||||||
global $DETAILED, $PHP_FAILED_TESTS, $SHOW_ONLY_GROUPS, $argc, $argv, $cfg,
|
global $DETAILED, $PHP_FAILED_TESTS, $SHOW_ONLY_GROUPS, $argc, $argv, $cfg,
|
||||||
$cfgfiles, $cfgtypes, $conf_passed, $end_time, $environment,
|
$end_time, $environment,
|
||||||
$exts_skipped, $exts_tested, $exts_to_test, $failed_tests_file,
|
$exts_skipped, $exts_tested, $exts_to_test, $failed_tests_file,
|
||||||
$ignored_by_ext, $ini_overwrites, $is_switch, $colorize,
|
$ignored_by_ext, $ini_overwrites, $colorize,
|
||||||
$log_format, $matches, $no_clean, $no_file_cache,
|
$log_format, $no_clean, $no_file_cache,
|
||||||
$optionals, $pass_option_n, $pass_options,
|
$pass_options, $php, $php_cgi, $preload,
|
||||||
$pattern_match, $php, $php_cgi, $phpdbg, $preload, $redir_tests,
|
$result_tests_file, $slow_min_ms, $start_time,
|
||||||
$repeat, $result_tests_file, $slow_min_ms, $start_time, $switch,
|
$temp_source, $temp_target, $test_cnt,
|
||||||
$temp_source, $temp_target, $test_cnt, $test_dirs,
|
$test_files, $test_idx, $test_results, $testfile,
|
||||||
$test_files, $test_idx, $test_list, $test_results, $testfile,
|
$valgrind, $sum_results, $shuffle, $file_cache, $num_repeats,
|
||||||
$user_tests, $valgrind, $sum_results, $shuffle, $file_cache, $num_repeats,
|
$show_progress;
|
||||||
$bless, $show_progress;
|
|
||||||
// Parallel testing
|
// Parallel testing
|
||||||
global $workers, $workerID;
|
global $workers, $workerID;
|
||||||
global $context_line_count;
|
global $context_line_count;
|
||||||
|
@ -243,10 +236,6 @@ function main(): void
|
||||||
$environment["SystemRoot"] = getenv("SystemRoot");
|
$environment["SystemRoot"] = getenv("SystemRoot");
|
||||||
}
|
}
|
||||||
|
|
||||||
$php = null;
|
|
||||||
$php_cgi = null;
|
|
||||||
$phpdbg = null;
|
|
||||||
|
|
||||||
if (getenv('TEST_PHP_LOG_FORMAT')) {
|
if (getenv('TEST_PHP_LOG_FORMAT')) {
|
||||||
$log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
|
$log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -269,10 +258,9 @@ function main(): void
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether user test dirs are requested.
|
// Check whether user test dirs are requested.
|
||||||
|
$user_tests = [];
|
||||||
if (getenv('TEST_PHP_USER')) {
|
if (getenv('TEST_PHP_USER')) {
|
||||||
$user_tests = explode(',', getenv('TEST_PHP_USER'));
|
$user_tests = explode(',', getenv('TEST_PHP_USER'));
|
||||||
} else {
|
|
||||||
$user_tests = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$exts_to_test = [];
|
$exts_to_test = [];
|
||||||
|
@ -655,25 +643,11 @@ function main(): void
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$php) {
|
if (!$php) {
|
||||||
$php = getenv('TEST_PHP_EXECUTABLE');
|
$php = getenv('TEST_PHP_EXECUTABLE') ?: PHP_BINARY;
|
||||||
}
|
|
||||||
if (!$php) {
|
|
||||||
$php = PHP_BINARY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$php_cgi) {
|
$php_cgi = getenv('TEST_PHP_CGI_EXECUTABLE') ?: get_binary($php, 'php-cgi', 'sapi/cgi/php-cgi');
|
||||||
$php_cgi = getenv('TEST_PHP_CGI_EXECUTABLE');
|
$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE') ?: get_binary($php, 'phpdbg', 'sapi/phpdbg/phpdbg');
|
||||||
}
|
|
||||||
if (!$php_cgi) {
|
|
||||||
$php_cgi = get_binary($php, 'php-cgi', 'sapi/cgi/php-cgi');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$phpdbg) {
|
|
||||||
$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE');
|
|
||||||
}
|
|
||||||
if (!$phpdbg) {
|
|
||||||
$phpdbg = get_binary($php, 'phpdbg', 'sapi/phpdbg/phpdbg');
|
|
||||||
}
|
|
||||||
|
|
||||||
putenv("TEST_PHP_EXECUTABLE=$php");
|
putenv("TEST_PHP_EXECUTABLE=$php");
|
||||||
$environment['TEST_PHP_EXECUTABLE'] = $php;
|
$environment['TEST_PHP_EXECUTABLE'] = $php;
|
||||||
|
@ -702,8 +676,8 @@ function main(): void
|
||||||
// Run selected tests.
|
// Run selected tests.
|
||||||
$test_cnt = count($test_files);
|
$test_cnt = count($test_files);
|
||||||
|
|
||||||
verify_config();
|
verify_config($php);
|
||||||
write_information();
|
write_information($user_tests, $phpdbg);
|
||||||
|
|
||||||
if ($test_cnt) {
|
if ($test_cnt) {
|
||||||
putenv('NO_INTERACTION=1');
|
putenv('NO_INTERACTION=1');
|
||||||
|
@ -742,18 +716,12 @@ function main(): void
|
||||||
$exts_tested = $exts_to_test;
|
$exts_tested = $exts_to_test;
|
||||||
$exts_skipped = [];
|
$exts_skipped = [];
|
||||||
sort($exts_to_test);
|
sort($exts_to_test);
|
||||||
$test_dirs = [];
|
|
||||||
$optionals = ['Zend', 'tests', 'ext', 'sapi'];
|
|
||||||
|
|
||||||
foreach ($optionals as $dir) {
|
foreach (['Zend', 'tests', 'ext', 'sapi'] as $dir) {
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$test_dirs[] = $dir;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($test_dirs as $dir) {
|
|
||||||
find_files(TEST_PHP_SRCDIR . "/{$dir}", $dir == 'ext');
|
find_files(TEST_PHP_SRCDIR . "/{$dir}", $dir == 'ext');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($user_tests as $dir) {
|
foreach ($user_tests as $dir) {
|
||||||
find_files($dir, $dir == 'ext');
|
find_files($dir, $dir == 'ext');
|
||||||
|
@ -820,10 +788,8 @@ if (!function_exists("hrtime")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function verify_config(): void
|
function verify_config(string $php): void
|
||||||
{
|
{
|
||||||
global $php;
|
|
||||||
|
|
||||||
if (empty($php) || !file_exists($php)) {
|
if (empty($php) || !file_exists($php)) {
|
||||||
error('environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!');
|
error('environment variable TEST_PHP_EXECUTABLE must be set to specify PHP executable!');
|
||||||
}
|
}
|
||||||
|
@ -833,9 +799,12 @@ function verify_config(): void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function write_information(): void
|
/**
|
||||||
|
* @param string[] $user_tests
|
||||||
|
*/
|
||||||
|
function write_information(array $user_tests, $phpdbg): void
|
||||||
{
|
{
|
||||||
global $php, $php_cgi, $phpdbg, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test, $valgrind, $no_file_cache;
|
global $php, $php_cgi, $php_info, $ini_overwrites, $pass_options, $exts_to_test, $valgrind, $no_file_cache;
|
||||||
$php_escaped = escapeshellarg($php);
|
$php_escaped = escapeshellarg($php);
|
||||||
|
|
||||||
// Get info from php
|
// Get info from php
|
||||||
|
@ -930,8 +899,7 @@ VALGRIND : " . ($valgrind ? $valgrind->getHeader() : 'Not used') . "
|
||||||
|
|
||||||
function save_results(string $output_file, bool $prompt_to_save_results): void
|
function save_results(string $output_file, bool $prompt_to_save_results): void
|
||||||
{
|
{
|
||||||
global $sum_results, $failed_test_summary,
|
global $sum_results, $failed_test_summary, $PHP_FAILED_TESTS, $php;
|
||||||
$PHP_FAILED_TESTS, $php;
|
|
||||||
|
|
||||||
if (getenv('NO_INTERACTION') || TRAVIS_CI) {
|
if (getenv('NO_INTERACTION') || TRAVIS_CI) {
|
||||||
return;
|
return;
|
||||||
|
@ -1266,10 +1234,7 @@ function system_with_timeout(
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function run_all_tests(array $test_files, array $env, ?string $redir_tested = null): void
|
||||||
* @param string|array|null $redir_tested
|
|
||||||
*/
|
|
||||||
function run_all_tests(array $test_files, array $env, $redir_tested = null): void
|
|
||||||
{
|
{
|
||||||
global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx, $file_cache;
|
global $test_results, $failed_tests_file, $result_tests_file, $php, $test_idx, $file_cache;
|
||||||
global $preload;
|
global $preload;
|
||||||
|
@ -1347,12 +1312,9 @@ function run_all_tests(array $test_files, array $env, $redir_tested = null): voi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The heart of parallel testing.
|
function run_all_tests_parallel(array $test_files, array $env, ?string $redir_tested): void
|
||||||
* @param string|array|null $redir_tested
|
|
||||||
*/
|
|
||||||
function run_all_tests_parallel(array $test_files, array $env, $redir_tested): void
|
|
||||||
{
|
{
|
||||||
global $workers, $test_idx, $test_cnt, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $SHOW_ONLY_GROUPS, $valgrind, $show_progress;
|
global $workers, $test_idx, $test_results, $failed_tests_file, $result_tests_file, $PHP_FAILED_TESTS, $shuffle, $valgrind, $show_progress;
|
||||||
|
|
||||||
global $junit;
|
global $junit;
|
||||||
|
|
||||||
|
@ -1860,7 +1822,6 @@ function run_test(string $php, $file, array $env): string
|
||||||
$retried = false;
|
$retried = false;
|
||||||
retry:
|
retry:
|
||||||
|
|
||||||
$temp_filenames = null;
|
|
||||||
$org_file = $file;
|
$org_file = $file;
|
||||||
|
|
||||||
$php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'] ?? null;
|
$php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'] ?? null;
|
||||||
|
@ -1921,6 +1882,7 @@ TEST $file
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
|
/* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
|
||||||
|
$uses_cgi = false;
|
||||||
if ($test->isCGI()) {
|
if ($test->isCGI()) {
|
||||||
if (!$php_cgi) {
|
if (!$php_cgi) {
|
||||||
return skip_test($tested, $tested_file, $shortname, 'CGI not available');
|
return skip_test($tested, $tested_file, $shortname, 'CGI not available');
|
||||||
|
@ -1993,7 +1955,7 @@ TEST $file
|
||||||
$temp_skipif .= 's';
|
$temp_skipif .= 's';
|
||||||
$temp_file .= 's';
|
$temp_file .= 's';
|
||||||
$temp_clean .= 's';
|
$temp_clean .= 's';
|
||||||
$copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename(is_array($file) ? $file[1] : $file) . '.phps';
|
$copy_file = $temp_dir . DIRECTORY_SEPARATOR . basename($file) . '.phps';
|
||||||
|
|
||||||
if (!is_dir(dirname($copy_file))) {
|
if (!is_dir(dirname($copy_file))) {
|
||||||
mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file));
|
mkdir(dirname($copy_file), 0777, true) or error("Cannot create output directory - " . dirname($copy_file));
|
||||||
|
@ -2002,19 +1964,6 @@ TEST $file
|
||||||
if ($test->hasSection('FILE')) {
|
if ($test->hasSection('FILE')) {
|
||||||
save_text($copy_file, $test->getSection('FILE'));
|
save_text($copy_file, $test->getSection('FILE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_filenames = [
|
|
||||||
'file' => $copy_file,
|
|
||||||
'diff' => $diff_filename,
|
|
||||||
'log' => $log_filename,
|
|
||||||
'exp' => $exp_filename,
|
|
||||||
'out' => $output_filename,
|
|
||||||
'mem' => $memcheck_filename,
|
|
||||||
'sh' => $sh_filename,
|
|
||||||
'php' => $temp_file,
|
|
||||||
'skip' => $temp_skipif,
|
|
||||||
'clean' => $temp_clean
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($IN_REDIRECT)) {
|
if (is_array($IN_REDIRECT)) {
|
||||||
|
@ -2195,9 +2144,9 @@ TEST $file
|
||||||
|
|
||||||
if (!strncasecmp('skip', $output, 4)) {
|
if (!strncasecmp('skip', $output, 4)) {
|
||||||
if (preg_match('/^skip\s*(.+)/i', $output, $m)) {
|
if (preg_match('/^skip\s*(.+)/i', $output, $m)) {
|
||||||
show_result('SKIP', $tested, $tested_file, "reason: $m[1]", $temp_filenames);
|
show_result('SKIP', $tested, $tested_file, "reason: $m[1]");
|
||||||
} else {
|
} else {
|
||||||
show_result('SKIP', $tested, $tested_file, '', $temp_filenames);
|
show_result('SKIP', $tested, $tested_file, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = !empty($m[1]) ? $m[1] : '';
|
$message = !empty($m[1]) ? $m[1] : '';
|
||||||
|
@ -2217,7 +2166,7 @@ TEST $file
|
||||||
// Pretend we have an XLEAK section
|
// Pretend we have an XLEAK section
|
||||||
$test->setSection('XLEAK', ltrim(substr($output, 5)));
|
$test->setSection('XLEAK', ltrim(substr($output, 5)));
|
||||||
} elseif ($output !== '') {
|
} elseif ($output !== '') {
|
||||||
show_result("BORK", $output, $tested_file, 'reason: invalid output from SKIPIF', $temp_filenames);
|
show_result("BORK", $output, $tested_file, 'reason: invalid output from SKIPIF');
|
||||||
$PHP_FAILED_TESTS['BORKED'][] = [
|
$PHP_FAILED_TESTS['BORKED'][] = [
|
||||||
'name' => $file,
|
'name' => $file,
|
||||||
'test_name' => '',
|
'test_name' => '',
|
||||||
|
@ -2233,7 +2182,7 @@ TEST $file
|
||||||
|
|
||||||
if (!extension_loaded("zlib") && $test->hasAnySections("GZIP_POST", "DEFLATE_POST")) {
|
if (!extension_loaded("zlib") && $test->hasAnySections("GZIP_POST", "DEFLATE_POST")) {
|
||||||
$message = "ext/zlib required";
|
$message = "ext/zlib required";
|
||||||
show_result('SKIP', $tested, $tested_file, "reason: $message", $temp_filenames);
|
show_result('SKIP', $tested, $tested_file, "reason: $message");
|
||||||
$junit->markTestAs('SKIP', $shortname, $tested, null, $message);
|
$junit->markTestAs('SKIP', $shortname, $tested, null, $message);
|
||||||
return 'SKIPPED';
|
return 'SKIPPED';
|
||||||
}
|
}
|
||||||
|
@ -2280,7 +2229,7 @@ TEST $file
|
||||||
}
|
}
|
||||||
|
|
||||||
$bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory.";
|
$bork_info = "Redirect info must contain exactly one TEST string to be used as redirect directory.";
|
||||||
show_result("BORK", $bork_info, '', '', $temp_filenames);
|
show_result("BORK", $bork_info, '', '');
|
||||||
$PHP_FAILED_TESTS['BORKED'][] = [
|
$PHP_FAILED_TESTS['BORKED'][] = [
|
||||||
'name' => $file,
|
'name' => $file,
|
||||||
'test_name' => '',
|
'test_name' => '',
|
||||||
|
@ -2296,7 +2245,7 @@ TEST $file
|
||||||
}
|
}
|
||||||
|
|
||||||
$bork_info = "Redirected test did not contain redirection info";
|
$bork_info = "Redirected test did not contain redirection info";
|
||||||
show_result("BORK", $bork_info, '', '', $temp_filenames);
|
show_result("BORK", $bork_info, '', '');
|
||||||
$PHP_FAILED_TESTS['BORKED'][] = [
|
$PHP_FAILED_TESTS['BORKED'][] = [
|
||||||
'name' => $file,
|
'name' => $file,
|
||||||
'test_name' => '',
|
'test_name' => '',
|
||||||
|
@ -2315,7 +2264,7 @@ TEST $file
|
||||||
show_file_block('php', $test->getSection('FILE'), 'TEST');
|
show_file_block('php', $test->getSection('FILE'), 'TEST');
|
||||||
save_text($test_file, $test->getSection('FILE'), $temp_file);
|
save_text($test_file, $test->getSection('FILE'), $temp_file);
|
||||||
} else {
|
} else {
|
||||||
$test_file = $temp_file = "";
|
$test_file = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($test->hasSection('GET')) {
|
if ($test->hasSection('GET')) {
|
||||||
|
@ -2567,7 +2516,7 @@ COMMAND $cmd
|
||||||
/* when using CGI, strip the headers from the output */
|
/* when using CGI, strip the headers from the output */
|
||||||
$headers = [];
|
$headers = [];
|
||||||
|
|
||||||
if (!empty($uses_cgi) && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) {
|
if ($uses_cgi && preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $out, $match)) {
|
||||||
$output = trim($match[2]);
|
$output = trim($match[2]);
|
||||||
$rh = preg_split("/[\n\r]+/", $match[1]);
|
$rh = preg_split("/[\n\r]+/", $match[1]);
|
||||||
|
|
||||||
|
@ -2608,9 +2557,7 @@ COMMAND $cmd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ksort($wanted_headers);
|
|
||||||
$wanted_headers = implode("\n", $wanted_headers);
|
$wanted_headers = implode("\n", $wanted_headers);
|
||||||
ksort($output_headers);
|
|
||||||
$output_headers = implode("\n", $output_headers);
|
$output_headers = implode("\n", $output_headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2664,7 +2611,7 @@ COMMAND $cmd
|
||||||
if (!$leaked && !$failed_headers) {
|
if (!$leaked && !$failed_headers) {
|
||||||
// If the test passed and CLEAN produced output, report test as borked.
|
// If the test passed and CLEAN produced output, report test as borked.
|
||||||
if ($clean_output) {
|
if ($clean_output) {
|
||||||
show_result("BORK", $output, $tested_file, 'reason: invalid output from CLEAN', $temp_filenames);
|
show_result("BORK", $output, $tested_file, 'reason: invalid output from CLEAN');
|
||||||
$PHP_FAILED_TESTS['BORKED'][] = [
|
$PHP_FAILED_TESTS['BORKED'][] = [
|
||||||
'name' => $file,
|
'name' => $file,
|
||||||
'test_name' => '',
|
'test_name' => '',
|
||||||
|
@ -2688,7 +2635,7 @@ COMMAND $cmd
|
||||||
$warn = true;
|
$warn = true;
|
||||||
$info = " (warn: Test passed on retry attempt)";
|
$info = " (warn: Test passed on retry attempt)";
|
||||||
} else {
|
} else {
|
||||||
show_result("PASS", $tested, $tested_file, '', $temp_filenames);
|
show_result("PASS", $tested, $tested_file, '');
|
||||||
$junit->markTestAs('PASS', $shortname, $tested);
|
$junit->markTestAs('PASS', $shortname, $tested);
|
||||||
return 'PASSED';
|
return 'PASSED';
|
||||||
}
|
}
|
||||||
|
@ -2779,7 +2726,7 @@ $output
|
||||||
foreach ($env as $env_var => $env_val) {
|
foreach ($env as $env_var => $env_val) {
|
||||||
$env_lines[] = "export $env_var=" . escapeshellarg($env_val ?? "");
|
$env_lines[] = "export $env_var=" . escapeshellarg($env_val ?? "");
|
||||||
}
|
}
|
||||||
$exported_environment = $env_lines ? "\n" . implode("\n", $env_lines) . "\n" : "";
|
$exported_environment = "\n" . implode("\n", $env_lines) . "\n";
|
||||||
$sh_script = <<<SH
|
$sh_script = <<<SH
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
{$exported_environment}
|
{$exported_environment}
|
||||||
|
@ -2812,7 +2759,7 @@ SH;
|
||||||
show_file_block('mem', file_get_contents($memcheck_filename));
|
show_file_block('mem', file_get_contents($memcheck_filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
show_result(implode('&', $restype), $tested, $tested_file, $info, $temp_filenames);
|
show_result(implode('&', $restype), $tested, $tested_file, $info);
|
||||||
|
|
||||||
foreach ($restype as $type) {
|
foreach ($restype as $type) {
|
||||||
$PHP_FAILED_TESTS[$type . 'ED'][] = [
|
$PHP_FAILED_TESTS[$type . 'ED'][] = [
|
||||||
|
@ -2978,7 +2925,7 @@ function error(string $message): void
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function settings2array(array $settings, &$ini_settings): void
|
function settings2array(array $settings, array &$ini_settings): void
|
||||||
{
|
{
|
||||||
foreach ($settings as $setting) {
|
foreach ($settings as $setting) {
|
||||||
if (strpos($setting, '=') !== false) {
|
if (strpos($setting, '=') !== false) {
|
||||||
|
@ -3220,12 +3167,12 @@ EXPECTED LEAK TEST SUMMARY
|
||||||
return $summary;
|
return $summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_start($start_time): void
|
function show_start(int $start_time): void
|
||||||
{
|
{
|
||||||
echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n";
|
echo "TIME START " . date('Y-m-d H:i:s', $start_time) . "\n=====================================================================\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_end($end_time): void
|
function show_end(int $end_time): void
|
||||||
{
|
{
|
||||||
echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n";
|
echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n";
|
||||||
}
|
}
|
||||||
|
@ -3291,8 +3238,7 @@ function show_result(
|
||||||
string $result,
|
string $result,
|
||||||
string $tested,
|
string $tested,
|
||||||
string $tested_file,
|
string $tested_file,
|
||||||
string $extra = '',
|
string $extra = ''
|
||||||
?array $temp_filenames = null
|
|
||||||
): void {
|
): void {
|
||||||
global $SHOW_ONLY_GROUPS, $colorize, $show_progress;
|
global $SHOW_ONLY_GROUPS, $colorize, $show_progress;
|
||||||
|
|
||||||
|
@ -3685,7 +3631,6 @@ class SkipCache
|
||||||
|
|
||||||
class RuntestsValgrind
|
class RuntestsValgrind
|
||||||
{
|
{
|
||||||
protected string $version;
|
|
||||||
protected string $header;
|
protected string $header;
|
||||||
protected bool $version_3_8_0;
|
protected bool $version_3_8_0;
|
||||||
protected string $tool;
|
protected string $tool;
|
||||||
|
@ -3708,9 +3653,7 @@ class RuntestsValgrind
|
||||||
if ($count != 1) {
|
if ($count != 1) {
|
||||||
error("Valgrind returned invalid version info (\"{$header}\") for {$this->tool}, cannot proceed.");
|
error("Valgrind returned invalid version info (\"{$header}\") for {$this->tool}, cannot proceed.");
|
||||||
}
|
}
|
||||||
$this->version = $version;
|
$this->header = sprintf("%s (%s)", trim($header), $this->tool);
|
||||||
$this->header = sprintf(
|
|
||||||
"%s (%s)", trim($header), $this->tool);
|
|
||||||
$this->version_3_8_0 = version_compare($version, '3.8.0', '>=');
|
$this->version_3_8_0 = version_compare($version, '3.8.0', '>=');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3849,7 +3792,7 @@ class TestFile
|
||||||
|
|
||||||
// Match the beginning of a section.
|
// Match the beginning of a section.
|
||||||
if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
|
if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
|
||||||
$section = (string) $r[1];
|
$section = $r[1];
|
||||||
|
|
||||||
if (isset($this->sections[$section]) && $this->sections[$section]) {
|
if (isset($this->sections[$section]) && $this->sections[$section]) {
|
||||||
throw new BorkageException("duplicated $section section");
|
throw new BorkageException("duplicated $section section");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue