diff options
| author | Steph Fox <sfox@php.net> | 2008-06-19 21:08:13 +0000 |
|---|---|---|
| committer | Steph Fox <sfox@php.net> | 2008-06-19 21:08:13 +0000 |
| commit | 0af1218770e74f74c786f5edbd89cd00a7a32d4e (patch) | |
| tree | 53e897221a24b7a8b1cbebb951b05785afde93d9 | |
| parent | 9f445427417d1e0881097739d46ef7d84a875f5b (diff) | |
| download | php-git-0af1218770e74f74c786f5edbd89cd00a7a32d4e.tar.gz | |
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.
| -rwxr-xr-x | run-tests.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/run-tests.php b/run-tests.php index 8962c1f566..0697a57b59 100755 --- a/run-tests.php +++ b/run-tests.php @@ -408,6 +408,9 @@ if (isset($argc) && $argc > 1) { $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 @@ if (isset($argc) && $argc > 1) { $DETAILED = true; break; //case 'w' + case 'x': + $environment['SKIP_SLOW_TESTS'] = 1; + break; case '-': // repeat check with full switch $switch = $argv[$i]; @@ -924,18 +930,20 @@ function system_with_timeout($commandline, $env = null, $stdin = null) 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 @@ function system_with_timeout($commandline, $env = null, $stdin = null) if ($stat['signaled']) { $data .= "\nTermsig=".$stat['stopsig']; } + fclose($pipes[0]); $code = proc_close($proc); return $data; } |
