- run-tests diff supporting env vars
[m6w6/ext-http] / tests / run-tests.diff
1 Index: run-tests.php
2 ===================================================================
3 RCS file: /repository/php-src/run-tests.php,v
4 retrieving revision 1.209
5 diff -u -r1.209 run-tests.php
6 --- run-tests.php 20 Mar 2005 19:47:13 -0000 1.209
7 +++ run-tests.php 3 May 2005 06:13:20 -0000
8 @@ -836,6 +836,12 @@
9 $query_string = '';
10 }
11
12 + if (!empty($section_text['ENV'])) {
13 + foreach (explode("\n", $section_text['ENV']) as $env) {
14 + ($env = trim($env)) and putenv($env);
15 + }
16 + }
17 +
18 putenv("REDIRECT_STATUS=1");
19 putenv("QUERY_STRING=$query_string");
20 putenv("PATH_TRANSLATED=$tmp_file");
21 @@ -861,7 +867,7 @@
22 putenv("CONTENT_TYPE=");
23 putenv("CONTENT_LENGTH=");
24
25 - $cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args 2>&1";
26 + $cmd = "$php$pass_options$ini_settings < \"$tmp_file\" $args 2>&1";
27 }
28
29 if ($DETAILED) echo "
30 @@ -878,6 +884,12 @@
31 // $out = `$cmd`;
32 $out = system_with_timeout($cmd);
33
34 + if (!empty($section_text['ENV'])) {
35 + foreach (explode("\n", $section_text['ENV']) as $env) {
36 + ($env = trim($env)) and putenv(array_shift(explode('=', $env)).'=');
37 + }
38 + }
39 +
40 @unlink($tmp_post);
41
42 // Does the output match what is expected?