[limb-svn] r6916 - 3.x/trunk/limb
svn at limb-project.com
svn at limb-project.com
Thu Apr 10 22:50:50 MSD 2008
Author: pachanga
Date: 2008-04-10 22:50:50 +0400 (Thu, 10 Apr 2008)
New Revision: 6916
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6916
Modified:
3.x/trunk/limb/runtests.php
Log:
-- experimental PHP settings guessing for fork mode
Modified: 3.x/trunk/limb/runtests.php
===================================================================
--- 3.x/trunk/limb/runtests.php 2008-04-10 18:35:05 UTC (rev 6915)
+++ 3.x/trunk/limb/runtests.php 2008-04-10 18:50:50 UTC (rev 6916)
@@ -37,6 +37,25 @@
$argv = $new_argv;
}
+function get_php_bin()
+{
+ ob_start();
+ phpinfo(INFO_GENERAL);
+ $info = ob_get_contents();
+ ob_end_clean();
+
+ $php_bin = $_ENV["_"];
+ $php_ini = "";
+
+ $lines = explode("\n", $info);
+ foreach($lines as $line)
+ {
+ if(preg_match('~^Loaded Configuration File\s*=>\s*(.*)$~', $line, $m))
+ $php_ini = "-c " . $m[1];
+ }
+ return $php_bin . " " . $php_ini;
+}
+
process_argv($argv);
if(sizeof($argv) > 1)
@@ -46,7 +65,10 @@
$tests = glob("*/tests/cases");
if($fork)
- out("=========== Forking procees for each test ===========\n");
+{
+ $php_bin = get_php_bin();
+ out("=========== Forking procees for each test(PHP cmdline '$php_bin') ===========\n");
+}
$res = true;
foreach($tests as $test)
@@ -57,8 +79,7 @@
if($fork)
{
- //TODO: get rid of hardocoded php call here
- system("php " . __FILE__ . " -q $test", $ret);
+ system($php_bin . " " . __FILE__ . " -q $test", $ret);
if($ret != 0)
{
$res = false;
More information about the limb-svn
mailing list