[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] cvs: pear-core /PEAR RunTest.php  /PEAR/Command Package.php
From:       "Greg Beaver" <cellog () php ! net>
Date:       2004-12-31 18:57:29
Message-ID: cvscellog1104519449 () cvsserver
[Download RAW message or body]

cellog		Fri Dec 31 13:57:29 2004 EDT

  Modified files:              
    /pear-core/PEAR/Command	Package.php 
    /pear-core/PEAR	RunTest.php 
  Log:
  implement #2914: Dynamic include path
  also implement flexible ini settings
  
http://cvs.php.net/diff.php/pear-core/PEAR/Command/Package.php?r1=1.85&r2=1.86&ty=u
Index: pear-core/PEAR/Command/Package.php
diff -u pear-core/PEAR/Command/Package.php:1.85 pear-core/PEAR/Command/Package.php:1.86
--- pear-core/PEAR/Command/Package.php:1.85	Mon Dec 27 01:33:52 2004
+++ pear-core/PEAR/Command/Package.php	Fri Dec 31 13:57:29 2004
@@ -18,7 +18,7 @@
 // |          Greg Beaver <cellog@php.net>                                |
 // +----------------------------------------------------------------------+
 //
-// $Id: Package.php,v 1.85 2004/12/27 06:33:52 cellog Exp $
+// $Id: Package.php,v 1.86 2004/12/31 18:57:29 cellog Exp $
 
 require_once 'PEAR/Common.php';
 require_once 'PEAR/Packager.php';
@@ -165,7 +165,12 @@
                 'recur' => array(
                     'shortopt' => 'r',
                     'doc' => 'Run tests in child directories, recursively.  4 dirs deep maximum',
-                )
+                ),
+                'ini' => array(
+                    'shortopt' => 'i',
+                    'doc' => 'actual string of settings to pass to php in format " -d setting=blah"',
+                    'arg' => 'SETTINGS'
+                ),
             ),
             'doc' => '[testfile|dir ...]
 Run regression tests with PHP\'s regression testing script (run-tests.php).',
@@ -535,10 +540,20 @@
                 }
             }
         }
+        $ini_settings = '';
+        if (isset($options['ini'])) {
+            $ini_settings .= $options['ini'];
+        }
+        if (isset($_ENV['TEST_PHP_INCLUDE_PATH'])) {
+            $ini_settings .= " -d include_path={$_ENV['TEST_PHP_INCLUDE_PATH']}";
+        }
+        if ($ini_settings) {
+            $this->ui->outputData('Using INI settings: "' . $ini_settings . '"');
+        }
         $skipped = $passed = $failed = array();
         $this->ui->outputData('Running ' . count($tests) . ' tests');
         foreach ($tests as $t) {
-            $result = $run->run($t);
+            $result = $run->run($t, $ini_settings);
             if ($result == 'FAILED') {
             	$failed[] = $t;
             }
http://cvs.php.net/diff.php/pear-core/PEAR/RunTest.php?r1=1.7&r2=1.8&ty=u
Index: pear-core/PEAR/RunTest.php
diff -u pear-core/PEAR/RunTest.php:1.7 pear-core/PEAR/RunTest.php:1.8
--- pear-core/PEAR/RunTest.php:1.7	Sun Nov 28 19:53:47 2004
+++ pear-core/PEAR/RunTest.php	Fri Dec 31 13:57:29 2004
@@ -18,7 +18,7 @@
 // |                                                                      |
 // +----------------------------------------------------------------------+
 //
-// $Id: RunTest.php,v 1.7 2004/11/29 00:53:47 cellog Exp $
+// $Id: RunTest.php,v 1.8 2004/12/31 18:57:29 cellog Exp $
 //
 
 /**
@@ -59,7 +59,7 @@
     //  Run an individual test case.
     //
 
-    function run($file)
+    function run($file, $ini_settings = '')
     {
         $cwd = getcwd();
         $conf = &PEAR_Config::singleton();
@@ -161,7 +161,6 @@
 
         $args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : '';
 
-        $ini_settings='';
         $cmd = "$php$ini_settings -f $tmp_file$args 2>&1";
         if (isset($this->_logger)) {
             $this->_logger->log(2, 'Running command "' . $cmd . '"');

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic