com php-src: fix tests on linux: ext/standard/tests/streams/pro c_open_bug60120.phpt ext/standard/tests/strea ms/proc_open_bug64438.phpt
| From: | Anatol Belski | Date: | Mon, 29 Sep 2014 16:12:25 +0000 |
| Subject: | com php-src: fix tests on linux: ext/standard/tests/streams/pro c_open_bug60120.phpt ext/standard/tests/strea ms/proc_open_bug64438.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82013@lists.php.net to get a copy of this message | ||
Commit: 859913f6d40611ff3987c6ddee7aa9427d94988c
Author: Anatol Belski <ab@php.net> Mon, 29 Sep 2014 18:12:25 +0200
Parents: 91d3cd85593a19ff6ab3c334f74198472788021d
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=859913f6d40611ff3987c6ddee7aa9427d94988c
Log:
fix tests on linux
Changed paths:
M ext/standard/tests/streams/proc_open_bug60120.phpt
M ext/standard/tests/streams/proc_open_bug64438.phpt
Diff:
diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt
b/ext/standard/tests/streams/proc_open_bug60120.phpt
index 978cbe6..8768257 100644
--- a/ext/standard/tests/streams/proc_open_bug60120.phpt
+++ b/ext/standard/tests/streams/proc_open_bug60120.phpt
@@ -4,7 +4,11 @@ Bug #60120 proc_open hangs with stdin/out with 2048+ bytes
<?php
error_reporting(E_ALL);
-$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in =
file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in =
file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+ $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in =
file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
$descriptors = array(array('pipe', 'r'), array('pipe',
'w'), array('pipe', 'w'));
$stdin = str_repeat('*', 1024 * 16) . '!';
$stdin = str_repeat('*', 2049 );
diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt
b/ext/standard/tests/streams/proc_open_bug64438.phpt
index e328851..b3857d0 100644
--- a/ext/standard/tests/streams/proc_open_bug64438.phpt
+++ b/ext/standard/tests/streams/proc_open_bug64438.phpt
@@ -5,7 +5,11 @@ Bug #64438 proc_open hangs with stdin/out with 4097+ bytes
error_reporting(E_ALL);
-$cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in =
file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in =
file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+ $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in =
file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
$descriptors = array(array('pipe', 'r'), array('pipe',
'w'), array('pipe', 'w'));
$stdin = str_repeat('*', 4097);