Skip to content

Commit b195412

Browse files
committed
run-tests: Don't pass --INI-- settings to --SKIPIF--
If we're testing ini settings that cause startup failures, we'll never get to that SKIPIF block... Also change settings2param to return a value instead of modifying (to a different type no less!) in place.
1 parent 70fa471 commit b195412

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

run-tests.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ function write_information()
857857
save_text($info_file, $php_info);
858858
$info_params = array();
859859
settings2array($ini_overwrites, $info_params);
860-
settings2params($info_params);
860+
$info_params = settings2params($info_params);
861861
$php_info = `$php $pass_options $info_params $no_file_cache "$info_file"`;
862862
define('TESTED_PHP_VERSION', `$php -n -r "echo PHP_VERSION;"`);
863863

@@ -2091,7 +2091,7 @@ function run_test($php, $file, $env)
20912091
if (array_key_exists('EXTENSIONS', $section_text)) {
20922092
$ext_params = array();
20932093
settings2array($ini_overwrites, $ext_params);
2094-
settings2params($ext_params);
2094+
$ext_params = settings2params($ext_params);
20952095
$ext_dir = `$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo ini_get('extension_dir');"`;
20962096
$extensions = preg_split("/[\n\r]+/", trim($section_text['EXTENSIONS']));
20972097
$loaded = explode(",", `$php $pass_options $extra_options $ext_params -d display_errors=0 -r "echo implode(',', get_loaded_extensions());"`);
@@ -2111,6 +2111,8 @@ function run_test($php, $file, $env)
21112111
//$ini_overwrites[] = 'setting=value';
21122112
settings2array($ini_overwrites, $ini_settings);
21132113

2114+
$orig_ini_settings = settings2params($ini_settings);
2115+
21142116
// Any special ini settings
21152117
// these may overwrite the test defaults...
21162118
if (array_key_exists('INI', $section_text)) {
@@ -2119,7 +2121,7 @@ function run_test($php, $file, $env)
21192121
settings2array(preg_split("/[\n\r]+/", $section_text['INI']), $ini_settings);
21202122
}
21212123

2122-
settings2params($ini_settings);
2124+
$ini_settings = settings2params($ini_settings);
21232125

21242126
$env['TEST_PHP_EXTRA_ARGS'] = $pass_options . ' ' . $ini_settings;
21252127

@@ -2142,7 +2144,7 @@ function run_test($php, $file, $env)
21422144

21432145
junit_start_timer($shortname);
21442146

2145-
$output = system_with_timeout("$extra $php $pass_options $extra_options -q $ini_settings $no_file_cache -d display_errors=0 \"$test_skipif\"", $env);
2147+
$output = system_with_timeout("$extra $php $pass_options $extra_options -q $orig_ini_settings $no_file_cache -d display_errors=0 \"$test_skipif\"", $env);
21462148

21472149
junit_finish_timer($shortname);
21482150

@@ -2481,7 +2483,7 @@ function run_test($php, $file, $env)
24812483
if (!$no_clean) {
24822484
$clean_params = array();
24832485
settings2array($ini_overwrites, $clean_params);
2484-
settings2params($clean_params);
2486+
$clean_params = settings2params($clean_params);
24852487
$extra = substr(PHP_OS, 0, 3) !== "WIN" ?
24862488
"unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;" : "";
24872489
system_with_timeout("$extra $php $pass_options $extra_options -q $clean_params $no_file_cache \"$test_clean\"", $env);
@@ -2939,7 +2941,7 @@ function settings2array($settings, &$ini_settings)
29392941
}
29402942
}
29412943

2942-
function settings2params(&$ini_settings)
2944+
function settings2params($ini_settings)
29432945
{
29442946
$settings = '';
29452947

@@ -2966,7 +2968,7 @@ function settings2params(&$ini_settings)
29662968
}
29672969
}
29682970

2969-
$ini_settings = $settings;
2971+
return $settings;
29702972
}
29712973

29722974
function compute_summary()

0 commit comments

Comments
 (0)