]> granicus.if.org Git - php/commitdiff
Fix PHP version and sapi printed so that it does not print bogus
authorYasuo Ohgaki <yohgaki@php.net>
Tue, 12 Mar 2002 06:43:15 +0000 (06:43 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Tue, 12 Mar 2002 06:43:15 +0000 (06:43 +0000)
version and sapi name.

run-tests.php
tests/bin-info.inc [new file with mode: 0644]

index 79e0f5b249ef2509a3b83f61624d4a676c632e3e..0fd24ba2a746e5b1a1f78884a952e4fde95dfc14 100755 (executable)
@@ -284,8 +284,8 @@ function do_testing($argc, &$argv)
     dowriteln(sprintf("Tests passed:     %4d (%s%%)", $passed, $passed_pstr));
     dowriteln("=============================");
     dowriteln("Skipped ".sizeof($skipped_extensions)." extensions.");
-       dowriteln("PHP SAPI: ".PHP_SAPI);
-    dowriteln("PHP Version: ".PHP_VERSION);
+       $php_bin_info_cmd = "$php -q -f tests/bin-info.inc";
+       system($php_bin_info_cmd, $ret);
 }
 
 function find_testdirs($dir = '.', $first_pass = true)
diff --git a/tests/bin-info.inc b/tests/bin-info.inc
new file mode 100644 (file)
index 0000000..ad42ea8
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+// Used to print php binary info used to run
+// test scripts.
+// Called from run-tests.php
+
+function dowrite($str)
+{
+    global $term_bold, $term_norm;
+    $str = str_replace("%b", $term_bold, $str);
+    $str = str_replace("%B", $term_norm, $str);
+    print $str;
+}
+
+function dowriteln($str)
+{
+    dowrite("$str\n");
+}
+
+dowriteln("PHP SAPI: ".PHP_SAPI);
+dowriteln("PHP Version: ".PHP_VERSION);
+?>
\ No newline at end of file