cvs: pear-core /PEAR RunTest.php

From: Date: Sat, 17 Feb 2007 19:57:56 +0000
Subject: cvs: pear-core /PEAR RunTest.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-5441@lists.php.net to get a copy of this message
cellog Sat Feb 17 19:57:56 2007 UTC Modified files: /pear-core/PEAR RunTest.php Log: make --RETURNS-- work on windows again make sure we unlink POST data on windows http://cvs.php.net/viewvc.cgi/pear-core/PEAR/RunTest.php?r1=1.33&r2=1.34&diff_format=u Index: pear-core/PEAR/RunTest.php diff -u pear-core/PEAR/RunTest.php:1.33 pear-core/PEAR/RunTest.php:1.34 --- pear-core/PEAR/RunTest.php:1.33 Sat Feb 17 19:19:44 2007 +++ pear-core/PEAR/RunTest.php Sat Feb 17 19:57:56 2007 @@ -16,7 +16,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: RunTest.php,v 1.33 2007/02/17 19:19:44 cellog Exp $ + * @version CVS: $Id: RunTest.php,v 1.34 2007/02/17 19:57:56 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.3 */ @@ -293,7 +293,7 @@ $test_skipif = $test_dir . DIRECTORY_SEPARATOR . $main_file_name.'skip.php'; $temp_clean = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name.'clean.php'; $test_clean = $test_dir . DIRECTORY_SEPARATOR . $main_file_name.'clean.php'; - $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('/phpt.'); + $tmp_post = $temp_dir . DIRECTORY_SEPARATOR . uniqid('phpt.'); // unlink old test results @unlink($diff_filename); @@ -475,18 +475,22 @@ $cmd = "$php$pass_options$ini_settings -f \"$test_file\" $args 2>&1"; } - $out = $this->system_with_timeout($cmd, $env, - isset($section_text['STDIN']) ? $section_text['STDIN'] : null); - $return_value = $out[0]; - $out = $out[1]; - if (isset($tmp_post) && file_exists($tmp_post)) { - unlink($tmp_post); - } - if (isset($section_text['RETURNS'])) { + if (OS_WINDOWS && isset($section_text['RETURNS'])) { + ob_start(); + system($cmd, $return_value); + $out = ob_get_contents(); + ob_end_clean(); $section_text['RETURNS'] = (int) trim($section_text['RETURNS']); $returnfail = ($return_value != $section_text['RETURNS']); } else { $returnfail = false; + $out = $this->system_with_timeout($cmd, $env, + isset($section_text['STDIN']) ? $section_text['STDIN'] : null); + $return_value = $out[0]; + $out = $out[1]; + } + if (isset($tmp_post) && realpath($tmp_post)) { + unlink(realpath($tmp_post)); } chdir($savedir);

« previous php.pear.core (#5441) next »