nlopess Thu Sep 14 16:58:52 2006 UTC Added files: (Branch: PHP_5_2) /php-src/tests/run-test test010.phpt
Modified files: /php-src run-tests.php Log: add --STDIN-- support http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.14&r2=1.226.2.37.2.15&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.14 php-src/run-tests.php:1.226.2.37.2.15 --- php-src/run-tests.php:1.226.2.37.2.14 Wed Aug 23 07:02:59 2006 +++ php-src/run-tests.php Thu Sep 14 16:58:52 2006 @@ -23,7 +23,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.14 2006/08/23 07:02:59 tony2001 Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.15 2006/09/14 16:58:52 nlopess Exp $ */ /* Sanity check to ensure that pcre extension needed by this script is available. * In the event it is not, print a nice error message indicating that this script will @@ -397,7 +397,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.14 $'."\n"; + echo '$Revision: 1.226.2.37.2.15 $'."\n"; exit(1); default: echo "Illegal switch '$switch' specified!\n"; @@ -837,7 +837,7 @@ } } -function system_with_timeout($commandline, $env = null) +function system_with_timeout($commandline, $env = null, $stdin = null) { global $leak_check; @@ -852,6 +852,9 @@ if (!$proc) return false; + if (is_string($stdin)) { + fwrite($pipes[0], $stdin); + } fclose($pipes[0]); while (true) { @@ -1347,7 +1350,7 @@ COMMAND $cmd "; - $out = system_with_timeout($cmd, $env); + $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null); if (array_key_exists('CLEAN', $section_text) && (!$no_clean || $cfg['keep']['clean'])) { if (trim($section_text['CLEAN'])) { http://cvs.php.net/viewvc.cgi/php-src/tests/run-test/test010.phpt?view=markup&rev=1.1 Index: php-src/tests/run-test/test010.phpt +++ php-src/tests/run-test/test010.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php