helly Sun Jan 6 16:48:11 2008 UTC Modified files: (Branch: PHP_5_3) /php-src run-tests.php Log: - MFH Show info for CL and CGI if both are going to be used http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.12&r2=1.226.2.37.2.35.2.13&diff_format=u Index: php-src/run-tests.php diff -u php-src/run-tests.php:1.226.2.37.2.35.2.12 php-src/run-tests.php:1.226.2.37.2.35.2.13 --- php-src/run-tests.php:1.226.2.37.2.35.2.12 Sat Jan 5 21:39:53 2008 +++ php-src/run-tests.php Sun Jan 6 16:48:11 2008 @@ -24,7 +24,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: run-tests.php,v 1.226.2.37.2.35.2.12 2008/01/05 21:39:53 cellog Exp $ */ +/* $Id: run-tests.php,v 1.226.2.37.2.35.2.13 2008/01/06 16:48:11 helly 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 @@ -106,11 +106,22 @@ // Require the explicit specification. // Otherwise we could end up testing the wrong file! +$php = NULL; +$php_cgi = NULL; + if (getenv('TEST_PHP_EXECUTABLE')) { $php = getenv('TEST_PHP_EXECUTABLE'); if ($php=='auto') { $php = $cwd.'/sapi/cli/php'; putenv("TEST_PHP_EXECUTABLE=$php"); + if (!getenv('TEST_PHP_CGI_EXECUTABLE')) { + $php_cgi = $cwd.'/sapi/cgi/php-cgi'; + if (file_exists($php_cgi)) { + putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi"); + } else { + $php_cgi = NULL; + } + } } $environment['TEST_PHP_EXECUTABLE'] = $php; } @@ -183,7 +194,7 @@ function write_information($show_html) { - global $cwd, $php, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test; + global $cwd, $php, $php_cgi, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test; // Get info from php $info_file = realpath(dirname(__FILE__)) . '/run-test-info.php'; @@ -200,8 +211,15 @@ settings2array($ini_overwrites,$info_params); settings2params($info_params); $php_info = `$php $pass_options $info_params "$info_file"`; - @unlink($info_file); define('TESTED_PHP_VERSION', `$php -r "echo PHP_VERSION;"`); + if ($php_cgi && $php != $php_cgi) { + $php_info_cgi = `$php_cgi $pass_options $info_params -q "$info_file"`; + $php_info_sep = "\n---------------------------------------------------------------------"; + $php_cgi_info = "$php_info_sep\nPHP : $php_cgi $php_info_cgi$php_info_sep"; + } else { + $php_cgi_info = ''; + } + @unlink($info_file); // load list of enabled extensions save_text($info_file, '<?php echo join(",",get_loaded_extensions()); ?>'); @@ -223,8 +241,8 @@ // Write test context information. echo " ===================================================================== +PHP : $php $php_info $php_cgi_info CWD : $cwd -PHP : $php $php_info Extra dirs : "; foreach ($user_tests as $test_dir) { echo "{$test_dir}\n "; @@ -408,7 +426,7 @@ $html_output = is_resource($html_file); break; case '--version': - echo '$Revision: 1.226.2.37.2.35.2.12 $'."\n"; + echo '$Revision: 1.226.2.37.2.35.2.13 $'."\n"; exit(1); case 'u':
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php