]> granicus.if.org Git - php/commitdiff
Enable CGI binary for testing. CGI binary should be used when it's
authorYasuo Ohgaki <yohgaki@php.net>
Fri, 12 Apr 2002 01:34:06 +0000 (01:34 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Fri, 12 Apr 2002 01:34:06 +0000 (01:34 +0000)
available, since some tests cannot be performed by CLI. (And
many of them are just failing now)
Fixed SAPI and VERSION output.

run-tests.php

index 1f8600212eaabf58188c86e38b216bea2819d1a9..f19b9ea290cb9d9d471420e706f45bbc5fcd66ed 100755 (executable)
@@ -161,29 +161,25 @@ function initialize()
         }
     }
 
-/* Lets check for cli first, since the new build system runs the cli sapi,
-   and this script makes assumptions about the executeable based on things
-   it determines from *this* instance.  If the sapis are not the same, tests
-   will fail due to silly things like headers not being ignored in the right
-   places */
+/*  We need to check CGI SAPI first since some tests must be skipped when
+    CLI SAPI is used. CLI SAPI is built always while CGI SAPI is not.
+    - yohgaki@php.net */
 
-    if (isset($_ENV["TOP_BUILDDIR"]) && @is_executable($_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}")) {
-        $php = $_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}";
-    } elseif (@is_executable("./sapi/cli/php{$ext}")) {
-        $php = getcwd() . "/sapi/cli/php{$ext}";
-    } elseif (isset($_ENV["TOP_BUILDDIR"]) && @is_executable($_ENV["TOP_BUILDDIR"]."/php{$ext}")) {
+       if (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}";
-       }
+       } elseif (isset($_ENV["TOP_BUILDDIR"]) && @is_executable($_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}")) {
+        $php = $_ENV["TOP_BUILDDIR"]."/sapi/cli/php{$ext}";
+    } elseif (@is_executable("./sapi/cli/php{$ext}")) {
+        $php = getcwd() . "/sapi/cli/php{$ext}";
+    }
 // Test result can be bogus, if we use php binary in path. - yohgaki@php.net
 //     if (empty($php)) {
 //         $php = in_path("php", $windows_p);
 //     }
     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;
     }
     if ($windows_p) {
@@ -290,8 +286,8 @@ function do_testing($argc, &$argv)
     dowriteln(sprintf("Tests passed:     %4d (%s%%)", $passed, $passed_pstr));
     dowriteln("=============================");
     dowriteln("Skipped ".sizeof($skipped_extensions)." extensions.");
-       $php_bin_info_cmd = "$php -q -f tests/bin-info.inc";
-       system($php_bin_info_cmd, $ret);
+       $php_bin_info_cmd = "$php -q -f ".$_ENV["TOP_BUILDDIR"]."/tests/bin-info.inc";
+       system($php_bin_info_cmd);
 }
 
 function find_testdirs($dir = '.', $first_pass = true)