cvs: pear-core /PEAR/Command Test.php

From: Date: Thu, 10 Jul 2008 20:35:11 +0000
Subject: cvs: pear-core /PEAR/Command Test.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7621@lists.php.net to get a copy of this message
dufuz Thu Jul 10 20:35:11 2008 UTC Modified files: /pear-core/PEAR/Command Test.php Log: Clear out some silly tabs and small cosmetics http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Command/Test.php?r1=1.27&r2=1.28&diff_format=u Index: pear-core/PEAR/Command/Test.php diff -u pear-core/PEAR/Command/Test.php:1.27 pear-core/PEAR/Command/Test.php:1.28 --- pear-core/PEAR/Command/Test.php:1.27 Thu Jan 3 20:26:36 2008 +++ pear-core/PEAR/Command/Test.php Thu Jul 10 20:35:11 2008 @@ -17,7 +17,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Test.php,v 1.27 2008/01/03 20:26:36 cellog Exp $ + * @version CVS: $Id: Test.php,v 1.28 2008/07/10 20:35:11 dufuz Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -124,6 +124,7 @@ if (isset($options['phpunit']) && isset($options['tapoutput'])) { return $this->raiseError('ERROR: cannot use both --phpunit and --tapoutput at the same time'); } + require_once 'PEAR/Common.php'; require_once 'System.php'; $log = new PEAR_Common; @@ -134,6 +135,7 @@ if (!count($params)) { $params[] = '.'; } + if (isset($options['package'])) { $oldparams = $params; $params = array(); @@ -185,6 +187,7 @@ } continue; } + $dir = System::find(array($p, '-type', 'f', '-maxdepth', $depth, '-name', '*.phpt')); @@ -229,6 +232,7 @@ if ($ini_settings) { $this->ui->outputData('Using INI settings: "' . $ini_settings . '"'); } + $skipped = $passed = $failed = array(); $tests_count = count($tests); $this->ui->outputData('Running ' . $tests_count . ' tests', $command); @@ -284,17 +288,17 @@ fclose($fp); } } - + if ($result == 'FAILED') { - $failed[] = $t; + $failed[] = $t; } if ($result == 'PASSED') { - $passed[] = $t; + $passed[] = $t; } if ($result == 'SKIPPED') { - $skipped[] = $t; + $skipped[] = $t; } - + $j++; } @@ -312,11 +316,11 @@ $output = "TOTAL TIME: $total\n"; $output .= count($passed) . " PASSED TESTS\n"; $output .= count($skipped) . " SKIPPED TESTS\n"; - $output .= count($failed) . " FAILED TESTS:\n"; - foreach ($failed as $failure) { - $output .= $failure . "\n"; - } - + $output .= count($failed) . " FAILED TESTS:\n"; + foreach ($failed as $failure) { + $output .= $failure . "\n"; + } + $mode = isset($options['realtimelog']) ? 'a' : 'w'; $fp = @fopen('run-tests.log', $mode); @@ -333,10 +337,10 @@ $this->ui->outputData(count($passed) . ' PASSED TESTS', $command); $this->ui->outputData(count($skipped) . ' SKIPPED TESTS', $command); if (count($failed)) { - $this->ui->outputData(count($failed) . ' FAILED TESTS:', $command); - foreach ($failed as $failure) { - $this->ui->outputData($failure, $command); - } + $this->ui->outputData(count($failed) . ' FAILED TESTS:', $command); + foreach ($failed as $failure) { + $this->ui->outputData($failure, $command); + } } return true;

« previous php.pear.core (#7621) next »