diff options
author | Marcus Boerger <helly@php.net> | 2005-07-29 17:25:38 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-07-29 17:25:38 +0000 |
commit | ea71e02c7a1a9fa77dba8b0b2972d997a9cf5000 (patch) | |
tree | 277d331c1b0b6ed2e37453afcc826f06dc383364 | |
parent | 70f72d39e46ade5eb1f83bc90805e64a26b89188 (diff) | |
download | php-git-ea71e02c7a1a9fa77dba8b0b2972d997a9cf5000.tar.gz |
- Add ENV support (mike)
-rwxr-xr-x | run-tests.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/run-tests.php b/run-tests.php index d4ab060f32..8cd3c70089 100755 --- a/run-tests.php +++ b/run-tests.php @@ -926,6 +926,12 @@ TEST $file $query_string = ''; } + if (!empty($section_text['ENV'])) { + foreach (explode("\n", $section_text['ENV']) as $env) { + ($env = trim($env)) and putenv($env); + } + } + putenv("REDIRECT_STATUS=1"); putenv("QUERY_STRING=$query_string"); putenv("PATH_TRANSLATED=$tmp_file"); @@ -951,7 +957,11 @@ TEST $file putenv("CONTENT_TYPE="); putenv("CONTENT_LENGTH="); - $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args 2>&1"; + if (empty($section_text['ENV'])) { + $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args 2>&1"; + } else { + $cmd = "$php$pass_options$ini_settings < \"$tmp_file\" $args 2>&1"; + } } if ($DETAILED) echo " @@ -968,6 +978,13 @@ COMMAND $cmd // $out = `$cmd`; $out = system_with_timeout($cmd); + if (!empty($section_text['ENV'])) { + foreach (explode("\n", $section_text['ENV']) as $env) { + $env = explode('=', $env); + putenv($env[0] .'='); + } + } + @unlink($tmp_post); // Does the output match what is expected? |