* MTH (merge _to_ head)

This commit is contained in:
Stig Bakken 2001-08-27 16:39:49 +00:00
parent d7149ba8fc
commit 2186ced3a6

View file

@ -102,6 +102,28 @@ function create_modules_2_test_list() {
function in_path($program)
{
global $HTTP_ENV_VARS;
if (substr(PHP_OS, 0, 3) == "WIN") {
$delim = ";";
$ext = ".exe";
} else {
$delim = ":";
$ext = "";
}
$slash = DIRECTORY_SEPARATOR;
$path_components = explode($delim, $HTTP_ENV_VARS['PATH']);
foreach ($path_components as $path) {
$test = "{$path}{$slash}php{$ext}";
if (@is_executable($test)) {
return $test;
}
}
return false;
}
function initialize() function initialize()
{ {
global $term, $windows_p, $php, $skip, $testdirs, $tmpfile, global $term, $windows_p, $php, $skip, $testdirs, $tmpfile,
@ -109,39 +131,42 @@ function initialize()
$tests_in_dir; $tests_in_dir;
// XXX Should support HTML output as well. // XXX Should support HTML output as well.
$term = getenv("TERM"); $php = "";
if (ereg('^(xterm|vt220)', $term)) { if((substr(PHP_OS, 0, 3) == "WIN")) {
$term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109); $ext = ".exe";
$term_norm = sprintf("%c%c%c", 27, 91, 109); $windows_p = true;
} elseif (ereg('^vt100', $term)) { $term = getenv("COMSPEC");
$term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109);
$term_norm = sprintf("%c%c%c", 27, 91, 109);
} else { } else {
$term_bold = $term_norm = ""; $ext = "";
} $term = getenv("TERM");
if (ereg('^(xterm|vt220)', $term)) {
if((substr(PHP_OS, 0, 3) == "WIN")) { $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109);
$windows_p = true; $term_norm = sprintf("%c%c%c", 27, 91, 109);
$term = getenv("COMSPEC"); } elseif (ereg('^vt100', $term)) {
$null = getenv("TOP_BUILDDIR"); $term_bold = sprintf("%c%c%c%c", 27, 91, 49, 109);
$php = ($null ? $null : getcwd()) . "/php.exe"; $term_norm = sprintf("%c%c%c", 27, 91, 109);
unset($null);
} else {
if (isset($GLOBALS["TOP_BUILDDIR"])) {
$php = $GLOBALS["TOP_BUILDDIR"]."/php";
} else { } else {
$php = getcwd() . '/php'; $term_bold = $term_norm = "";
} }
} }
create_compiled_in_modules_list(); if (isset($GLOBALS["TOP_BUILDDIR"]) && @is_executable($GLOBALS["TOP_BUILDDIR"]."/php{$ext}")) {
$php = $GLOBALS["TOP_BUILDDIR"]."/php{$ext}";
if (!is_executable($php) && !$windows_p) { } elseif (@is_executable("./php{$ext}")) {
dowriteln("PHP CGI binary ($php) is not executable."); $php = getcwd() . "/php{$ext}";
dowriteln("Please compile PHP as a CGI executable and try again."); }
if (empty($php)) {
$php = in_path("php");
}
if (empty($php)) {
dowriteln("Unable to find PHP executable (php{$ext}).");
dowriteln("Please build PHP as a CGI executable or make sure it is");
dowriteln("available in the PATH environment variable.");
exit; exit;
} }
create_compiled_in_modules_list();
$skip = array( $skip = array(
"CVS" => 1 "CVS" => 1
); );