mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Add ability to pass -n to the executed php
This commit is contained in:
parent
4f855044c7
commit
4da754e868
1 changed files with 13 additions and 3 deletions
|
@ -213,6 +213,8 @@ $PHP_FAILED_TESTS = array();
|
||||||
|
|
||||||
// If parameters given assume they represent selected tests to run.
|
// If parameters given assume they represent selected tests to run.
|
||||||
$failed_tests_file= false;
|
$failed_tests_file= false;
|
||||||
|
$pass_option_n = false;
|
||||||
|
$pass_options = '';
|
||||||
if (isset($argc) && $argc > 1) {
|
if (isset($argc) && $argc > 1) {
|
||||||
for ($i=1; $i<$argc; $i++) {
|
for ($i=1; $i<$argc; $i++) {
|
||||||
if (substr($argv[$i],0,1) == '-') {
|
if (substr($argv[$i],0,1) == '-') {
|
||||||
|
@ -234,6 +236,12 @@ if (isset($argc) && $argc > 1) {
|
||||||
case 'a':
|
case 'a':
|
||||||
$failed_tests_file = fopen($argv[++$i], 'a+t');
|
$failed_tests_file = fopen($argv[++$i], 'a+t');
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
if (!$pass_option_n) {
|
||||||
|
$pass_options .= ' -n';
|
||||||
|
}
|
||||||
|
$pass_option_n = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
echo "Illegal switch specified!\n";
|
echo "Illegal switch specified!\n";
|
||||||
case "h":
|
case "h":
|
||||||
|
@ -255,6 +263,8 @@ Options:
|
||||||
|
|
||||||
-a <file> Same as -w but append rather then truncating <file>.
|
-a <file> Same as -w but append rather then truncating <file>.
|
||||||
|
|
||||||
|
-n Pass -n option to the php binary.
|
||||||
|
|
||||||
-h <file> This Help.
|
-h <file> This Help.
|
||||||
|
|
||||||
HELP;
|
HELP;
|
||||||
|
@ -638,7 +648,7 @@ function system_with_timeout($commandline)
|
||||||
|
|
||||||
function run_test($php, $file, $test_cnt, $test_idx)
|
function run_test($php, $file, $test_cnt, $test_idx)
|
||||||
{
|
{
|
||||||
global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS;
|
global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS, $pass_options;
|
||||||
|
|
||||||
if (DETAILED) echo "
|
if (DETAILED) echo "
|
||||||
=================
|
=================
|
||||||
|
@ -804,7 +814,7 @@ TEST $file
|
||||||
putenv("CONTENT_TYPE=application/x-www-form-urlencoded");
|
putenv("CONTENT_TYPE=application/x-www-form-urlencoded");
|
||||||
putenv("CONTENT_LENGTH=$content_length");
|
putenv("CONTENT_LENGTH=$content_length");
|
||||||
|
|
||||||
$cmd = "$php$ini_settings -f $tmp_file 2>&1 < $tmp_post";
|
$cmd = "$php$pass_options$ini_settings -f $tmp_file 2>&1 < $tmp_post";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -812,7 +822,7 @@ TEST $file
|
||||||
putenv("CONTENT_TYPE=");
|
putenv("CONTENT_TYPE=");
|
||||||
putenv("CONTENT_LENGTH=");
|
putenv("CONTENT_LENGTH=");
|
||||||
|
|
||||||
$cmd = "$php$ini_settings -f $tmp_file$args 2>&1";
|
$cmd = "$php$pass_options$ini_settings -f $tmp_file$args 2>&1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DETAILED) echo "
|
if (DETAILED) echo "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue