diff options
author | Greg Beaver <cellog@php.net> | 2004-01-31 22:39:25 +0000 |
---|---|---|
committer | Greg Beaver <cellog@php.net> | 2004-01-31 22:39:25 +0000 |
commit | 20c8e629a4c03a622212b2950bb20339473acf6f (patch) | |
tree | a7d3ac92288ecd92e32f5d5dc4aefe8d50a9ab09 | |
parent | 0330fb2cbf5b8d2f96aaa6f1de114e86d3dbbcfc (diff) | |
download | php-git-20c8e629a4c03a622212b2950bb20339473acf6f.tar.gz |
make pear run-tests work with PEAR core tests, allow it to work for Windows users as well
-rw-r--r-- | pear/PEAR/Command/Package.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pear/PEAR/Command/Package.php b/pear/PEAR/Command/Package.php index 2adac0c6a7..1186cbc5b8 100644 --- a/pear/PEAR/Command/Package.php +++ b/pear/PEAR/Command/Package.php @@ -435,8 +435,10 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm function doRunTests($command, $options, $params) { $cwd = getcwd(); - $php = PHP_BINDIR . '/php' . (OS_WINDOWS ? '.exe' : ''); + $php = $this->config->get('php_bin'); putenv("TEST_PHP_EXECUTABLE=$php"); + // all core PEAR tests use this constant to determine whether they should be run or not + putenv("PHP_PEAR_RUNTESTS=1"); $ip = ini_get("include_path"); $ps = OS_WINDOWS ? ';' : ':'; $run_tests = $rtsts = $this->config->get('php_dir') . DIRECTORY_SEPARATOR . 'run-tests.php'; @@ -447,9 +449,19 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm "file from the sources of your PHP distribution to $rtsts"); } } - $plist = implode(" ", $params); - $cmd = "$php -C -d include_path=$cwd$ps$ip -f $run_tests -- $plist"; - system($cmd); + if (OS_WINDOWS) { + // note, this requires a slightly modified version of run-tests.php + // for some setups + // unofficial download location is in the pear-dev archives + $argv = $params; + array_unshift($argv, $run_tests); + $argc = count($argv); + include $run_tests; + } else { + $plist = implode(' ', $params); + $cmd = "$php -d include_path=$cwd$ps$ip -f $run_tests -- $plist"; + system($cmd); + } return true; } |