summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-03-02 02:37:13 +0000
committerStig Bakken <ssb@php.net>2002-03-02 02:37:13 +0000
commit8802148fcd8a59f0a1959b01df91ab9ae50d3c53 (patch)
tree20d81cde680e0306d415554add8b622d0e193b6e /run-tests.php
parent922ec7c75d09a21c6cc01f0e322b5a90214214f5 (diff)
downloadphp-git-8802148fcd8a59f0a1959b01df91ab9ae50d3c53.tar.gz
* work with sapi/cli
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/run-tests.php b/run-tests.php
index e8e5798805..9f76c388bf 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -161,8 +161,10 @@ function initialize()
}
}
- if (isset($GLOBALS["TOP_BUILDDIR"]) && @is_executable($GLOBALS["TOP_BUILDDIR"]."/php{$ext}")) {
- $php = $GLOBALS["TOP_BUILDDIR"]."/php{$ext}";
+ if (isset($_ENV["TOP_BUILDDIR"]) && @is_executable($_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}")) {
+ $php = $_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}";
+ } elseif (isset($_ENV["TOP_BUILDDIR"]) && @is_executable($_ENV["TOP_BUILDDIR"]."/php{$ext}")) {
+ $php = $_ENV["TOP_BUILDDIR"]."/php{$ext}";
} elseif (@is_executable("./php{$ext}")) {
$php = getcwd() . "/php{$ext}";
}
@@ -241,7 +243,7 @@ function do_testing($argc, &$argv)
}
}
} else {
- // $dir = $GLOBALS["TOP_SRCDIR"]; // XXX ??? where should this variable be set?
+ // $dir = $_ENV["TOP_SRCDIR"]; // XXX ??? where should this variable be set?
$dir=str_replace('\\','/',trim(($windows_p ? getenv("TEST_DIR"):`pwd`)));
}
if (isset($dir) && $dir) {
@@ -376,6 +378,10 @@ function run_tests_in_dir($dir = '.')
function skip_headers($fp)
{
+ // "cli" version of PHP does not output headers
+ if (php_sapi_name() == "cli") {
+ return;
+ }
while (!feof($fp)) {
if (trim(fgets($fp, 1024)) == "") {
break;
@@ -538,7 +544,6 @@ function run_test($file)
delete_tmpfiles();
return TEST_INTERNAL_ERROR;
}
- //echo $cmd;
$cp = popen($cmd, "r");
if (!$cp) {
dowriteln("Error: could not execute: $cmd");