sfox Thu Jun 19 21:08:14 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src run-tests.php
Log:
Two new options for Travis to come to terms with:
- --set-timeout <n> sets the timeout in seconds for the call to
stream_select() during system_with_timeout()
- -x sets an environmental variable, SKIP_SLOW_TESTS, which can be checked
for during a SKIPIF clause
and just for a special treat, you can have it from my working branch this
time.
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.22&r2=1.226.2.37.2.35.2.23&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.22
php-src/run-tests.php:1.226.2.37.2.35.2.23
--- php-src/run-tests.php:1.226.2.37.2.35.2.22 Thu Jun 19 21:03:36 2008
+++ php-src/run-tests.php Thu Jun 19 21:08:13 2008
@@ -25,7 +25,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.22 2008/06/19 21:03:36 sfox Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.23 2008/06/19 21:08:13 sfox 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
@@ -408,6 +408,9 @@
$output_file = $argv[++$i];
$just_save_results = true;
break;
+ case '--set-timeout':
+ $environment['TEST_TIMEOUT'] =
$argv[++$i];
+ break;
case '--show-all':
foreach($cfgfiles as $file) {
$cfg['show'][$file] = true;
@@ -430,6 +433,9 @@
$DETAILED = true;
break;
//case 'w'
+ case 'x':
+ $environment['SKIP_SLOW_TESTS'] = 1;
+ break;
case '-':
// repeat check with full switch
$switch = $argv[$i];
@@ -442,7 +448,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
- echo '$Revision: 1.226.2.37.2.35.2.22
$'."\n";
+ echo '$Revision: 1.226.2.37.2.35.2.23
$'."\n";
exit(1);
case 'u':
@@ -924,18 +930,20 @@
if (is_string($stdin)) {
fwrite($pipes[0], $stdin);
}
- fclose($pipes[0]);
+
+ $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ?
$env['TEST_TIMEOUT'] : 60);
while (true) {
/* hide errors from interrupted syscalls */
$r = $pipes;
$w = null;
$e = null;
- $n = @stream_select($r, $w, $e, $leak_check ? 300 : 60);
+ $n = @stream_select($r, $w, $e, $timeout);
if ($n === 0) {
/* timed out */
$data .= "\n ** ERROR: process timed out **\n";
+ fclose($pipes[0]);
proc_terminate($proc);
return $data;
} else if ($n > 0) {
@@ -951,6 +959,7 @@
if ($stat['signaled']) {
$data .= "\nTermsig=".$stat['stopsig'];
}
+ fclose($pipes[0]);
$code = proc_close($proc);
return $data;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php