summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMelvyn Sopacua <msopacua@php.net>2002-11-10 08:56:28 +0000
committerMelvyn Sopacua <msopacua@php.net>2002-11-10 08:56:28 +0000
commit138a1695f5dcffb80f7bec1a45836b68abd5f6f0 (patch)
tree8994c7526e96d551ac9074c9c859911cadf3ebe7 /run-tests.php
parent8b36fd2afaaefe5102d73b9f2d214a1196a360ac (diff)
downloadphp-git-138a1695f5dcffb80f7bec1a45836b68abd5f6f0.tar.gz
- Make it possible for people to save results and/or remove unwanted ENV
data. - Use more options for the CC 'version' flag
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/run-tests.php b/run-tests.php
index bbef6ba55a..bbcd6d4254 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -309,10 +309,12 @@ define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
/* We got failed Tests, offer the user to send and e-mail to QA team, unless NO_INTERACTION is set */
if ($sum_results['FAILED'] && !getenv('NO_INTERACTION')) {
$fp = fopen("php://stdin", "r+");
- echo "Some tests have failed, would you like to send the\nreport to PHP's QA team? [Yn]: ";
+ echo "Some tests have failed, would you like to send the\nreport to PHP's QA team\n";
+ echo "(choose \"s\" to just save the results to a file)? [Yns]: ";
$user_input = fgets($fp, 10);
+ $just_save_results = (strtolower($user_input[0]) == 's');
- if (strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
+ if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
/*
* Collect information about the host system for our report
* Fetch phpinfo() output so that we can see the PHP enviroment
@@ -329,7 +331,16 @@ if ($sum_results['FAILED'] && !getenv('NO_INTERACTION')) {
$automake = shell_exec('automake --version');
$autoconf = shell_exec('autoconf --version');
$libtool = shell_exec('libtool --version');
- $compiler = shell_exec(getenv('CC').' -v 2>&1');
+ /* Try the most common flags for 'version' */
+ $flags = array('-v', '-V', '--version');
+ $cc_status=0;
+ foreach($flags AS $flag) {
+ system(getenv('CC')." $flag >/dev/null 2>&1", $cc_status);
+ if($cc_status == 0) {
+ $compiler = shell_exec(getenv('CC')." $flag 2>&1");
+ break;
+ }
+ }
}
$failed_tests_data .= "Automake:\n$automake\n";
$failed_tests_data .= "Autoconf:\n$autoconf\n";
@@ -352,13 +363,15 @@ if ($sum_results['FAILED'] && !getenv('NO_INTERACTION')) {
$compression = 0;
- if (!mail_qa_team($failed_tests_data, $compression)) {
+ if ($just_save_results || !mail_qa_team($failed_tests_data, $compression)) {
$output_file = 'php_test_results_' . date('Ymd') . ( $compression ? '.txt.gz' : '.txt' );
$fp = fopen($output_file, "w");
fwrite($fp, $failed_tests_data);
fclose($fp);
- echo "\nThe test script was unable to automatically send the report to PHP's QA Team\nPlease send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n";
+ if (!$just_save_results)
+ echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n";
+ echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n";
} else {
fwrite($fp, "\nThank you for helping to make PHP better.\n");
fclose($fp);