com phpruntests: add option for different types of output: src/configuration/rtCommandLineOptions.php src/taskScheduler/rtTaskTestGroup.php
src/testgroup/rtPhpTestGroup.php src/testrun/rtPhpTestRun.php

From: Date: Sun, 28 Jun 2009 12:25:00 +0000
Subject: com phpruntests: add option for different types of output: src/configuration/rtCommandLineOptions.php src/taskScheduler/rtTaskTestGroup.php
src/testgroup/rtPhpTestGroup.php src/testrun/rtPhpTestRun.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66391@lists.php.net to get a copy of this message
Commit: 6c6b59692caa2835daae8a8871a0ed86c6847bc0 Author: Zoe Slattery <zoe@php.net> Sun, 28 Jun 2009 12:25:00 +0000 Parents: e1fd025e9369cd89602c5567a47231ed0ef2cfc6 Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=6c6b59692caa2835daae8a8871a0ed86c6847bc0 Log: add option for different types of output Changed paths: M src/configuration/rtCommandLineOptions.php M src/taskScheduler/rtTaskTestGroup.php M src/testgroup/rtPhpTestGroup.php M src/testrun/rtPhpTestRun.php Diff: diff --git a/src/configuration/rtCommandLineOptions.php b/src/configuration/rtCommandLineOptions.php index 1be3f61..411bf0d 100644 --- a/src/configuration/rtCommandLineOptions.php +++ b/src/configuration/rtCommandLineOptions.php @@ -39,6 +39,7 @@ class rtCommandLineOptions 'd', 'p', 's', + 'o', //new for output type (list, xml, csv...) 'z', //parallel - run out of obvious letters ); diff --git a/src/taskScheduler/rtTaskTestGroup.php b/src/taskScheduler/rtTaskTestGroup.php index 18e2d9a..d073880 100644 --- a/src/taskScheduler/rtTaskTestGroup.php +++ b/src/taskScheduler/rtTaskTestGroup.php @@ -27,7 +27,12 @@ class rtTaskTestGroup extends rtTask implements rtTaskInterface { $testGroup = new rtPhpTestGroup($this->runConfiguration, $this->subDirectory); $testGroup->runGroup($this->runConfiguration); - $testGroup->writeGroup(); + + $outType = 'list'; + if ($this->runConfiguration->hasCommandLineOption('o')) { + $outType = $this->runConfiguration->getCommandLineOption('o'); + } + $testGroup->writeGroup($outType); return true; } diff --git a/src/testgroup/rtPhpTestGroup.php b/src/testgroup/rtPhpTestGroup.php index cdb4e78..982d61c 100644 --- a/src/testgroup/rtPhpTestGroup.php +++ b/src/testgroup/rtPhpTestGroup.php @@ -70,9 +70,9 @@ class rtPhpTestGroup } } - public function writeGroup() + public function writeGroup($outType) { - $testOutputWriter = rtTestOutputWriter::getInstance($this->results, 'list'); + $testOutputWriter = rtTestOutputWriter::getInstance($this->results, $outType); $testOutputWriter->write($this->testDirectory); } } diff --git a/src/testrun/rtPhpTestRun.php b/src/testrun/rtPhpTestRun.php index 242453f..6af5a38 100644 --- a/src/testrun/rtPhpTestRun.php +++ b/src/testrun/rtPhpTestRun..php @@ -36,6 +36,12 @@ class rtPhpTestRun // $preConditionList->check($this->commandLine, $this->environmentVariables); $preConditionList->check($runConfiguration); + + //Set the type of output. Defaults to 'list' - comatible with old version + $this->outType = 'list'; + if ($runConfiguration->hasCommandLineOption('o')) { + $this->outType = $runConfiguration->getCommandLineOption('o'); + } if ($runConfiguration->getSetting('TestDirectories') != null) { @@ -73,7 +79,7 @@ class rtPhpTestRun foreach ($subDirectories as $subDirectory) { $testGroup = new rtPhpTestGroup($runConfiguration, $subDirectory); $testGroup->runGroup($runConfiguration); - $testGroup->writeGroup(); + $testGroup->writeGroup($this->outType); } }

« previous php.qa (#66391) next »