cvs: pear-core / test-modified.php
| From: | Greg Beaver | Date: | Tue, 14 Apr 2009 16:50:42 +0000 |
| Subject: | cvs: pear-core / test-modified.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-8341@lists.php.net to get a copy of this message | ||
cellog Tue Apr 14 16:50:42 2009 UTC
Modified files:
/pear-core test-modified.php
Log:
fix script to include the correct versions of PEAR junk
http://cvs.php.net/viewvc.cgi/pear-core/test-modified.php?r1=1.6&r2=1.7&diff_format=u
Index: pear-core/test-modified.php
diff -u pear-core/test-modified.php:1.6 pear-core/test-modified.php:1.7
--- pear-core/test-modified.php:1.6 Tue Apr 14 01:49:10 2009
+++ pear-core/test-modified.php Tue Apr 14 16:50:42 2009
@@ -64,6 +64,23 @@
}
$e = error_reporting();
error_reporting(0);
+$olddir = getcwd();
+$testpath = realpath(__DIR__ . '/tests');
+chdir($testpath);
+$pear = @fopen('PEAR.php', 'r', 1);
+if (!$pear) {
+ die("Install PEAR before attempting to run the tests\n");
+}
+fclose($pear);
+foreach (explode(PATH_SEPARATOR, get_include_path()) as $includepath) {
+ if (file_exists($includepath . DIRECTORY_SEPARATOR . 'PEAR.php')) {
+ $codepath = $includepath;
+ break;
+ }
+}
+if (!isset($codepath)) {
+ die("Something is wrong - PEAR.php exists, but was not within include_path\n");
+}
require_once 'PEAR/Command/Test.php';
require_once 'PEAR/Frontend/CLI.php';
require_once 'PEAR/Config.php';
@@ -71,29 +88,9 @@
$config = @PEAR_Config::singleton();
$test = new PEAR_Command_Test($cli, $config);
error_reporting($e);
+chdir($olddir);
}
namespace PEAR2\Pyrus\Developer\CoverageAnalyzer {
- $pear = @fopen('PEAR.php', 'r', 1);
- if (!$pear) {
- die("Install PEAR before attempting to run the tests\n");
- }
- fclose($pear);
- $olddir = getcwd();
-try_again:
- foreach (explode(PATH_SEPARATOR, get_include_path()) as $includepath) {
- if (file_exists($includepath . DIRECTORY_SEPARATOR . 'PEAR.php')) {
- if ($includepath === '.') {
- chdir('tests');
- goto try_again;
- }
- $codepath = $includepath;
- break;
- }
- }
- if (!isset($codepath)) {
- die("Something is wrong - PEAR.php exists, but was not within include_path\n");
- }
- $testpath = realpath(__DIR__ . '/tests');
$sqlite = new Sqlite($testpath . '/pear2coverage.db', $codepath, $testpath);
$modified = $sqlite->getModifiedTests();
if (!$force && !count($modified)) {
@@ -103,13 +100,12 @@
if (!count($modified) && $force) {
goto norunnie;
}
- $dir = getcwd();
chdir($testpath);
+ $e = error_reporting();
error_reporting(0);
$test->doRunTests('run-tests', array('coverage' => true), $modified);
- chdir($olddir);
error_reporting($e);
- chdir($dir);
+ chdir($olddir);
if (!$force && file_exists($testpath . '/run-tests.log')) {
// tests failed
echo "Tests failed - not regenerating coverage data\n";