Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix bugs in output writer, add .phpt to putput file names

  • Loading branch information...
commit b2e14bfd6b93f94e624988db9ed1544332529a1a 1 parent 3fde97a
zoe slattery authored
View
4 QA/compareNewOld.php
@@ -58,10 +58,10 @@ function parseNew($output, $searchFor, $top_level) {
if (preg_match("/$top_level\/((ext|sapi|Zend|tests)\/\S+)\s{1},(.*)\s{1}$searchFor\s{1}/", $line, $matches)) {
if($searchFor == 'FAIL') {
if(!preg_match("/XFAIL/", $line)) {
- $result[] = $matches[1] . ".phpt";
+ $result[] = $matches[1];
}
} else {
- $result[] = $matches[1] . ".phpt";
+ $result[] = $matches[1];
}
}
View
2  src/testcase/output/rtTestOutputWriterCSV.php
@@ -29,7 +29,7 @@ public function createOutput()
foreach ($testGroupResults as $testName=>$status) {
- $outputString = $testName;
+ $outputString = $testName . ".phpt";
foreach($status->getTestStateNames() as $name) {
View
23 src/testcase/rtTestOutputWriter.php
@@ -98,20 +98,19 @@ public function write($filename=null)
* @param integer $processCount
* @return string
*/
- public function getOverview($parallelGroups = 0, $serialGroups= 0, $processCount= 1)
+ public function getOverview($parallelGroups = 0, $serialGroups= 0, $processCount)
{
// if the overview was already created retun it
if (!is_null($this->overview)) {
return $this->overview;
}
-
+
/*
- * Add one to the process count (it should represesnt the number or processes, not the nubmer of
- * proccess in addition to the one that you have to have anyway!
+ * Add one to the process count if it's 0. There must always be one process - right?
*/
-
- $processCount ++;
-
+ if($processCount == 0) {
+ $processCount ++;
+ }
// collect data
$state = array();
@@ -195,9 +194,9 @@ public function getOverview($parallelGroups = 0, $serialGroups= 0, $processCount
}
- public function printOverview($groups=NULL, $processCount=NULL) {
+ public function printOverview($parallelGroups=NULL, $serialGroups = NULL, $processCount=NULL) {
- print $this->getOverview($groups, $processCount);
+ print $this->getOverview($parallelGroups, $serialGroups, $processCount);
flush();
}
@@ -229,7 +228,7 @@ public static function flushResult(array $results, $state=0, $cid=NULL)
case 1: // every test-case incl. status
print "\n";
foreach ($results as $name=>$status) {
- print strtoupper($status->__toString())."\t".$name."\n";
+ print strtoupper($status->__toString())."\t".$name.".phpt\n";
}
break;
@@ -244,7 +243,7 @@ public static function flushResult(array $results, $state=0, $cid=NULL)
print "\n";
}
- print strtoupper($s)."\t".$name."\n";
+ print strtoupper($s)."\t".$name.".phpt\n";
if ($s !== 'pass') {
@@ -267,7 +266,7 @@ public static function flushResult(array $results, $state=0, $cid=NULL)
print "\n";
- print strtoupper($status)."\t".$name."\n";
+ print strtoupper($status)."\t".$name.".phpt\n";
$msg = $s->getMessage($status);
View
11 src/testrun/rtPhpTestRun.php
@@ -24,6 +24,7 @@ class rtPhpTestRun
protected $reportStatus = 0;
protected $numberOfSerialGroups = 0;
protected $numberOfParallelGroups = 0;
+ protected $processorCount;
public function __construct($argv)
{
@@ -66,6 +67,8 @@ public function run()
//Set reporting option
$this->setReportStatus();
+ $this->processorCount = $this->requestedProcessorCount();
+
/*
* Main decision point. Either we start this with a directory (or set of directories, in which case tests are
@@ -113,7 +116,7 @@ public function doGroupRuns() {
} else {
//check to see if this is set to be a parallel run, if not, run the subdirectory groups in sequence.
- if($this->requestedProcessorCount() < 1) {
+ if($this->processorCount <= 1) {
$this->run_serial_groups($subDirectories, $groupConfigurations);
$this->numberOfSerialGroups = count($subDirectories);
} else {
@@ -131,7 +134,7 @@ public function doGroupRuns() {
$this->numberOfParallelGroups = count($parallelGroups);
- $this->run_parallel_groups($parallelGroups, $groupConfigurations, $this->requestedProcessorCount());
+ $this->run_parallel_groups($parallelGroups, $groupConfigurations, $this->processorCount);
if($this->numberOfSerialGroups > 0) {
$this->run_serial_groups($serialGroups, $groupConfigurations);
}
@@ -295,7 +298,7 @@ public function requestedProcessorCount() {
$processCount = 0;
if ($this->runConfiguration->hasCommandLineOption('z')) {
- $processCount = $this->runConfiguration->getCommandLineOption('z');
+ $processCount = intval($this->runConfiguration->getCommandLineOption('z'));
if (!is_numeric($processCount) || $processCount < 0) {
$processCount = 2;
@@ -333,7 +336,7 @@ public function createRunOutput() {
$outputWriter = rtTestOutputWriter::getInstance($type);
$outputWriter->setResultList($this->resultList);
- $outputWriter->printOverview($this->numberOfParallelGroups, $this->numberOfSerialGroups, $this->requestedProcessorCount());
+ $outputWriter->printOverview($this->numberOfParallelGroups, $this->numberOfSerialGroups, $this->processorCount);
$filename = null;
if ($this->runConfiguration->hasCommandLineOption('s')) {
Please sign in to comment.
Something went wrong with that request. Please try again.