]> granicus.if.org Git - php/commitdiff
Fixed CGI tests
authorDmitry Stogov <dmitry@php.net>
Fri, 29 Jun 2007 09:49:40 +0000 (09:49 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 29 Jun 2007 09:49:40 +0000 (09:49 +0000)
run-tests.php

index 5e0ed363fee383ed75361e43520f370ed7a324b9..37301870b1b931397d2ae2bc4b4aa38dbc404032 100755 (executable)
@@ -1076,15 +1076,23 @@ TEST $file
 
        /* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
        if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE'])) {
-               if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) ."/php-cgi.exe")) {
+               if (isset($php_cgi)) {
                        $old_php = $php;
-                       $php = realpath(dirname($php) ."/php-cgi.exe") .' -C ';
-               } elseif (file_exists("./sapi/cgi/php-cgi")) {
+                       $php = $php_cgi .' -C ';
+               } else if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) ."/php-cgi.exe")) {
                        $old_php = $php;
-                       $php = realpath("./sapi/cgi/php-cgi") . ' -C ';
+                       $php = realpath(dirname($php) ."/php-cgi.exe") .' -C ';
                } else {
-                       show_result("SKIP", $tested, $tested_file, $unicode_semantics, "reason: CGI not available");
-                       return 'SKIPPED';
+                       if (file_exists(dirname($php)."/../../sapi/cgi/php-cgi")) {
+                               $old_php = $php;
+                               $php = realpath(dirname($php)."/../../sapi/cgi/php-cgi") . ' -C ';
+                       } else if (file_exists("./sapi/cgi/php-cgi")) {
+                               $old_php = $php;
+                               $php = realpath("./sapi/cgi/php-cgi") . ' -C ';
+                       } else {
+                               show_result("SKIP", $tested, $tested_file, "reason: CGI not available");
+                               return 'SKIPPED';
+                       }
                }
        }