summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-18 22:43:40 (GMT)
committerMarcus Boerger <helly@php.net>2005-03-18 22:43:40 (GMT)
commit23b3d1ca24792f0d0c2719d789e4016691e29346 (patch)
treef83e6b70c1fa80c0a263102f8a2947468cf601cc /run-tests.php
parenta98460beaca5202ab0928356b5622a8a70e5dd4a (diff)
downloadphp-23b3d1ca24792f0d0c2719d789e4016691e29346.tar.gz
- Readd revised version of Jani's fix:
'errors with -d having a check for invalid ini entries' - Add -v for verbose mode
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php38
1 files changed, 29 insertions, 9 deletions
diff --git a/run-tests.php b/run-tests.php
index 80b7271..f92d267 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -138,9 +138,9 @@ if (function_exists('is_executable') && !@is_executable($php)) {
// Check whether a detailed log is wanted.
if (getenv('TEST_PHP_DETAILED')) {
- define('DETAILED', getenv('TEST_PHP_DETAILED'));
+ $DETAILED = getenv('TEST_PHP_DETAILED');
} else {
- define('DETAILED', 0);
+ $DETAILED = 0;
}
// Check whether user test dirs are requested.
@@ -163,7 +163,6 @@ More .INIs : " . (function_exists(\'php_ini_scanned_files\') ? str_replace("\n"
save_text($info_file, $php_info);
$ini_overwrites = array(
'output_handler=',
- 'zlib.output_compression=Off',
'open_basedir=',
'safe_mode=0',
'disable_functions=',
@@ -182,8 +181,6 @@ $ini_overwrites = array(
'auto_prepend_file=',
'auto_append_file=',
'magic_quotes_runtime=0',
- 'xdebug.default_enable=0',
- 'session.auto_start=0'
);
$info_params = array();
settings2array($ini_overwrites,$info_params);
@@ -192,6 +189,22 @@ $php_info = `$php $info_params $info_file`;
@unlink($info_file);
define('TESTED_PHP_VERSION', `$php -r 'echo PHP_VERSION;'`);
+// check for extensions that need special handling and regenerate
+$php_extenions = '<?php echo join(",",get_loaded_extensions()); ?>';
+save_text($info_file, $php_extenions);
+$php_extenions = explode(',',`$php $info_params $info_file`);
+$info_params_ex = array(
+ 'session' => array('session.auto_start=0'),
+ 'zlib' => array('zlib.output_compression=Off'),
+ 'xdebug' => array('xdebug.default_enable=0'),
+ );
+foreach($info_params_ex as $ext => $ini_overwrites_ex) {
+ if (in_array($ext, $php_extenions)) {
+ $ini_overwrites = array_merge($ini_overwrites, $ini_overwrites_ex);
+ }
+}
+@unlink($info_file);
+
// Write test context information.
function write_information()
{
@@ -235,6 +248,9 @@ if (isset($argc) && $argc > 1) {
break;
}
$i--;
+ case 'v':
+ $DETAILED = true;
+ break;
case 'w':
$failed_tests_file = fopen($argv[++$i], 'w+t');
break;
@@ -276,6 +292,8 @@ Options:
-d foo=bar Pass -d option to the php binary (Define INI entry foo
with value 'bar')
+ -v Verbose mode.
+
-h <file> This Help.
HELP;
@@ -587,10 +605,12 @@ function mail_qa_team($data, $compression, $status = FALSE)
function save_text($filename,$text)
{
+ global $DETAILED;
+
$fp = @fopen($filename,'w') or error("Cannot open file '" . $filename . "' (save_text)");
fwrite($fp,$text);
fclose($fp);
- if (1 < DETAILED) echo "
+ if (1 < $DETAILED) echo "
FILE $filename {{{
$text
}}}
@@ -667,9 +687,9 @@ function system_with_timeout($commandline)
function run_test($php, $file, $test_cnt, $test_idx)
{
- global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS, $pass_options;
+ global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS, $pass_options, $DETAILED;
- if (DETAILED) echo "
+ if ($DETAILED) echo "
=================
TEST $file
";
@@ -844,7 +864,7 @@ TEST $file
$cmd = "$php$pass_options$ini_settings -f \"$tmp_file\" $args 2>&1";
}
- if (DETAILED) echo "
+ if ($DETAILED) echo "
CONTENT_LENGTH = " . getenv("CONTENT_LENGTH") . "
CONTENT_TYPE = " . getenv("CONTENT_TYPE") . "
PATH_TRANSLATED = " . getenv("PATH_TRANSLATED") . "