summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/run-tests.php b/run-tests.php
index 3eeba95c1..f98190ff0 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -24,7 +24,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php 293036 2010-01-03 09:23:27Z sebastian $ */
+/* $Id: run-tests.php 305310 2010-11-13 10:18:35Z jani $ */
/* 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
@@ -197,7 +197,7 @@ function verify_config()
if (getenv('TEST_PHP_LOG_FORMAT')) {
$log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
} else {
- $log_format = 'LEOD';
+ $log_format = 'LEODS';
}
// Check whether a detailed log is wanted.
@@ -572,7 +572,7 @@ if (isset($argc) && $argc > 1) {
if (!$valgrind_header) {
error("Valgrind returned no version info, cannot proceed.\nPlease check if Valgrind is installed.");
} else {
- $valgrind_version = preg_replace("/valgrind-([0-9])\.([0-9])\.([0-9]+)([.-]\w+)?(\s+)/", '$1$2$3', $valgrind_header, 1, $replace_count);
+ $valgrind_version = preg_replace("/valgrind-([0-9])\.([0-9])\.([0-9]+)([.-\w]+)?(\s+)/", '$1$2$3', $valgrind_header, 1, $replace_count);
if ($replace_count != 1 || !is_numeric($valgrind_version)) {
error("Valgrind returned invalid version info (\"$valgrind_header\"), cannot proceed.");
}
@@ -641,7 +641,7 @@ if (isset($argc) && $argc > 1) {
$html_output = is_resource($html_file);
break;
case '--version':
- echo '$Revision: 293036 $' . "\n";
+ echo '$Revision: 305310 $' . "\n";
exit(1);
default:
@@ -1352,6 +1352,7 @@ TEST $file
$exp_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
$output_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
$memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
+ $sh_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'sh';
$temp_file = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$test_file = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
$temp_skipif = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
@@ -1382,6 +1383,7 @@ TEST $file
'exp' => $exp_filename,
'out' => $output_filename,
'mem' => $memcheck_filename,
+ 'sh' => $sh_filename,
'php' => $temp_file,
'skip' => $temp_skipif,
'clean'=> $temp_clean);
@@ -1398,6 +1400,7 @@ TEST $file
@unlink($exp_filename);
@unlink($output_filename);
@unlink($memcheck_filename);
+ @unlink($sh_filename);
@unlink($temp_file);
@unlink($test_file);
@unlink($temp_skipif);
@@ -1959,6 +1962,15 @@ COMMAND $cmd
error("Cannot create test diff - $diff_filename");
}
+ // write .sh
+ if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, b"#!/bin/sh
+
+{$cmd}
+", FILE_BINARY) === false) {
+ error("Cannot create test shell script - $sh_filename");
+ }
+ chmod($sh_filename, 0755);
+
// write .log
if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, b"
---- EXPECTED OUTPUT
@@ -2161,7 +2173,17 @@ function settings2params(&$ini_settings)
$settings .= " -d \"$name=$val\"";
}
} else {
- $value = addslashes($value);
+ if (substr(PHP_OS, 0, 3) == "WIN" && !empty($value) && $value{0} == '"') {
+ $len = strlen($value);
+
+ if ($value{$len - 1} == '"') {
+ $value{0} = "'";
+ $value{$len - 1} = "'";
+ }
+ } else {
+ $value = addslashes($value);
+ }
+
$settings .= " -d \"$name=$value\"";
}
}