summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-19 10:22:38 +0200
commitf452a2b3e4e4279b27594a8ddb66525442d59227 (patch)
treed05cb62c5515ada33076d3cc3e49b664733a478c /run-tests.php
parent038ba12e8724d537040e88ec794354b0c063f0a6 (diff)
downloadphp-upstream/5.3.7.tar.gz
Imported Upstream version 5.3.7upstream/5.3.7
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php41
1 files changed, 27 insertions, 14 deletions
diff --git a/run-tests.php b/run-tests.php
index 989871395..8638cc5e6 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -24,7 +24,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php 308726 2011-02-27 17:55:39Z felipe $ */
+/* $Id: run-tests.php 314690 2011-08-09 21:53:44Z nlopess $ */
/* 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
@@ -312,6 +312,7 @@ VALGRIND : " . ($leak_check ? $valgrind_header : 'Not used') . "
define('PHP_QA_EMAIL', 'qa-reports@lists.php.net');
define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
+define('QA_REPORTS_PAGE', 'http://qa.php.net/reports');
function save_or_mail_results()
{
@@ -324,9 +325,11 @@ function save_or_mail_results()
if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) {
echo "\nYou may have found a problem in PHP.";
}
- echo "\nWe would like to send this report automatically to the\n";
- echo "PHP QA team, to give us a better understanding of how\nthe test cases are doing. If you don't want to send it\n";
- echo "immediately, you can choose \"s\" to save the report to\na file that you can send us later.\n";
+ echo "\nThis report can be automatically sent to the PHP QA team at\n";
+ echo QA_REPORTS_PAGE . " and http://news.php.net/php.qa.reports\n";
+ echo "This gives us a better understanding of PHP's behavior.\n";
+ echo "If you don't want to send the report immediately you can choose\n";
+ echo "option \"s\" to save it. You can then email it to ". PHP_QA_EMAIL . " later.\n";
echo "Do you want to send this report now? [Yns]: ";
flush();
@@ -486,7 +489,7 @@ if (getenv('TEST_PHP_ARGS')) {
$argv = array(__FILE__);
}
- $argv = array_merge($argv, split(' ', getenv('TEST_PHP_ARGS')));
+ $argv = array_merge($argv, explode(' ', getenv('TEST_PHP_ARGS')));
$argc = count($argv);
}
@@ -641,7 +644,7 @@ if (isset($argc) && $argc > 1) {
$html_output = is_resource($html_file);
break;
case '--version':
- echo '$Revision: 308726 $' . "\n";
+ echo '$Revision: 314690 $' . "\n";
exit(1);
default:
@@ -951,14 +954,24 @@ function mail_qa_team($data, $compression, $status = false)
{
$url_bits = parse_url(QA_SUBMISSION_PAGE);
- if (empty($url_bits['port'])) {
- $url_bits['port'] = 80;
- }
+ if (($proxy = getenv('http_proxy'))) {
+ $proxy = parse_url($proxy);
+ $path = $url_bits['host'].$url_bits['path'];
+ $host = $proxy['host'];
+ if (empty($proxy['port'])) {
+ $proxy['port'] = 80;
+ }
+ $port = $proxy['port'];
+ } else {
+ $path = $url_bits['path'];
+ $host = $url_bits['host'];
+ $port = empty($url_bits['port']) ? 80 : $port = $url_bits['port'];
+ }
$data = "php_test_data=" . urlencode(base64_encode(str_replace("\00", '[0x0]', $data)));
$data_length = strlen($data);
- $fs = fsockopen($url_bits['host'], $url_bits['port'], $errno, $errstr, 10);
+ $fs = fsockopen($host, $port, $errno, $errstr, 10);
if (!$fs) {
return false;
@@ -966,9 +979,9 @@ function mail_qa_team($data, $compression, $status = false)
$php_version = urlencode(TESTED_PHP_VERSION);
- echo "\nPosting to {$url_bits['host']} {$url_bits['path']}\n";
- fwrite($fs, "POST " . $url_bits['path'] . "?status=$status&version=$php_version HTTP/1.1\r\n");
- fwrite($fs, "Host: " . $url_bits['host'] . "\r\n");
+ echo "\nPosting to ". QA_SUBMISSION_PAGE . "\n";
+ fwrite($fs, "POST " . $path . "?status=$status&version=$php_version HTTP/1.1\r\n");
+ fwrite($fs, "Host: " . $host . "\r\n");
fwrite($fs, "User-Agent: QA Browser 0.1\r\n");
fwrite($fs, "Content-Type: application/x-www-form-urlencoded\r\n");
fwrite($fs, "Content-Length: " . $data_length . "\r\n\r\n");
@@ -1067,7 +1080,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null)
} else if ($n === 0) {
/* timed out */
$data .= b"\n ** ERROR: process timed out **\n";
- proc_terminate($proc);
+ proc_terminate($proc, 9);
return $data;
} else if ($n > 0) {
$line = (binary) fread($pipes[1], 8192);