From: Peter Kokot Date: Fri, 19 Oct 2018 23:05:00 +0000 (+0200) Subject: Fix run-tests.php for running phpdbg and certain test sections X-Git-Tag: php-7.4.0alpha1~1626 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=220a2239a6c2cc76621d5b7d0584ab3b2797958e;p=php Fix run-tests.php for running phpdbg and certain test sections Certain sections, such as --EXTENSIONS--, --SKIPIF--, and --CLEAN-- require to be executed using only PHP CLI or PHP CGI SAPIs and cannot be processed with the phpdbg. --- diff --git a/run-tests.php b/run-tests.php index df53645ef2..aa9f67e07a 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1448,6 +1448,7 @@ TEST $file } /* For phpdbg tests, check if phpdbg sapi is available and if it is, use it. */ + $extra_options = ''; if (array_key_exists('PHPDBG', $section_text)) { if (!isset($section_text['STDIN'])) { $section_text['STDIN'] = $section_text['PHPDBG']."\n"; @@ -1455,6 +1456,10 @@ TEST $file if (isset($phpdbg)) { $php = $phpdbg . ' -qIb'; + + // Additional phpdbg command line options for sections that need to + // be run straight away. For example, EXTENSIONS, SKIPIF, CLEAN. + $extra_options = '-rr'; } else { show_result('SKIP', $tested, $tested_file, "reason: phpdbg not available"); @@ -1571,9 +1576,9 @@ TEST $file $ext_params = array(); settings2array($ini_overwrites, $ext_params); settings2params($ext_params); - $ext_dir=`$php $pass_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`; + $ext_dir=`$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`; $extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS'])); - $loaded = explode(",", `$php $pass_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); + $loaded = explode(",", `$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`); $ext_prefix = substr(PHP_OS, 0, 3) === "WIN" ? "php_" : ""; foreach ($extensions as $req_ext) { if (!in_array($req_ext, $loaded)) { @@ -1623,7 +1628,7 @@ TEST $file junit_start_timer($shortname); - $output = system_with_timeout("$extra $php $pass_options -q $ini_settings $no_file_cache -d display_errors=0 \"$test_skipif\"", $env); + $output = system_with_timeout("$extra $php $pass_options $extra_options -q $ini_settings $no_file_cache -d display_errors=0 \"$test_skipif\"", $env); junit_finish_timer($shortname); @@ -1961,7 +1966,7 @@ COMMAND $cmd settings2params($clean_params); $extra = substr(PHP_OS, 0, 3) !== "WIN" ? "unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;": ""; - system_with_timeout("$extra $php $pass_options -q $clean_params $no_file_cache \"$test_clean\"", $env); + system_with_timeout("$extra $php $pass_options $extra_options -q $clean_params $no_file_cache \"$test_clean\"", $env); } if (!$cfg['keep']['clean']) {