diff options
author | Peter Kokot <peterkokot@gmail.com> | 2018-10-20 01:05:00 +0200 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2018-10-24 16:21:57 +0200 |
commit | 220a2239a6c2cc76621d5b7d0584ab3b2797958e (patch) | |
tree | b85f03606fccf0bd4a2f10bfadda149f7b0351d0 | |
parent | 0b63544f25adc6517fc221ee925ff6f94b84d47d (diff) | |
download | php-git-220a2239a6c2cc76621d5b7d0584ab3b2797958e.tar.gz |
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.
-rwxr-xr-x | run-tests.php | 13 |
1 files changed, 9 insertions, 4 deletions
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']) { |