com phpruntests: update phpruntests - added php-command to verbose-output: src/testcase/rtPhpTest.php src/testcase/rtTestOutputWriter.php
src/testcase/rtTestStatus.php src/testcase/sections/executablesections/rtFileSection.php src/testcase/sections/executablesections/rtSkipIfSection.php
src/testcase/sections/rtExecutableSection.php
| From: | David Soria Parra | Date: | Thu, 20 Aug 2009 21:08:45 +0000 |
| Subject: | com phpruntests: update phpruntests - added php-command to verbose-output: src/testcase/rtPhpTest.php src/testcase/rtTestOutputWriter.php src/testcase/rtTestStatus.php src/testcase/sections/executablesections/rtFileSection.php src/testcase/sections/executablesections/rtSkipIfSection.php src/testcase/sections/rtExecutableSection.php |
||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66298@lists.php.net to get a copy of this message | ||
Commit: fb22a57a596ccb70fd9ebe128b45f232f5786ecd
Author: Georg Gradwohl <g2@php.net> Thu, 20 Aug 2009 21:08:45 +0000
Parents: c09ce984e9de7bfe74c436e1416a4f71b9858d24
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=fb22a57a596ccb70fd9ebe128b45f232f5786ecd
Log:
update phpruntests - added php-command to verbose-output
Changed paths:
M src/testcase/rtPhpTest.php
M src/testcase/rtTestOutputWriter.php
M src/testcase/rtTestStatus.php
M src/testcase/sections/executablesections/rtFileSection.php
M src/testcase/sections/executablesections/rtSkipIfSection.php
M src/testcase/sections/rtExecutableSection.php
Diff:
diff --git a/src/testcase/rtPhpTest.php b/src/testcase/rtPhpTest.php
index 0cce4ee..f5dacc6 100644
--- a/src/testcase/rtPhpTest.php
+++ b/src/testcase/rtPhpTest.php
@@ -104,10 +104,13 @@ class rtPhpTest
if (array_key_exists('SKIPIF', $this->sections)) {
$this->testStatus = $this->sections['SKIPIF']->run($this,
$runConfiguration);
+
$this->testStatus->setExecutedPhpCommand($this->sections['SKIPIF']->getPhpCommand());
}
if (!$this->testStatus->getValue('skip') &&
!$this->testStatus->getValue('skip')) {
$this->testStatus = $this->fileSection->run($this, $runConfiguration);
+
$this->testStatus->setExecutedPhpCommand($this->fileSection->getPhpCommand());
+
//The test can be skipped by file sections if the CGI executable is not available
if(!$this->testStatus->getValue('skip')) {
$this->output = $this->fileSection->getOutput();
diff --git a/src/testcase/rtTestOutputWriter.php b/src/testcase/rtTestOutputWriter.php
index 699b450..b582fe6 100644
--- a/src/testcase/rtTestOutputWriter.php
+++ b/src/testcase/rtTestOutputWriter.php
@@ -277,6 +277,11 @@ abstract class rtTestOutputWriter
print "$t:\t$file\n";
}
}
+
+ $cmd = $s->getExecutedPhpCommand();
+ if (!is_null($cmd)) {
+ print "PHP-COMMAND: $cmd\n";
+ }
}
break;
}
diff --git a/src/testcase/rtTestStatus.php b/src/testcase/rtTestStatus.php
index 084c326..466012e 100644
--- a/src/testcase/rtTestStatus.php
+++ b/src/testcase/rtTestStatus.php
@@ -17,6 +17,7 @@ class rtTestStatus {
protected $testName;
protected $states = array();
protected $messages = array();
+ protected $executedPhpCommand;
protected $testStateNames = array ('skip',
'bork',
'warn',
@@ -73,6 +74,16 @@ class rtTestStatus {
{
return $this->testName;
}
+
+ public function setExecutedPhpCommand($cmd)
+ {
+ $this->executedPhpCommand = $cmd;
+ }
+
+ public function getExecutedPhpCommand()
+ {
+ return $this->executedPhpCommand;
+ }
public function __toString()
{
diff --git a/src/testcase/sections/executablesections/rtFileSection.php
b/src/testcase/sections/executablesections/rtFileSection.php
index 6b7e729..0639633 100644
--- a/src/testcase/sections/executablesections/rtFileSection.php
+++ b/src/testcase/sections/executablesections/rtFileSection.php
@@ -52,6 +52,7 @@ class rtFileSection extends rtExecutableSection
$phpCommand .= '
'.$testCase->testConfiguration->getTestCommandLineArguments();
$phpCommand .= ' 2>&1
'.$testCase->testConfiguration->getInputFileString();
+ $this->phpCommand = $phpCommand;
$PhpRunner = new rtPhpRunner($phpCommand,
$testCase->testConfiguration->getEnvironmentVariables(),
@@ -100,14 +101,17 @@ class rtFileSection extends rtExecutableSection
}
- public function deleteMemFile() {
+ public function deleteMemFile()
+ {
@unlink($this->memFileName);
}
- public function getMemFileName() {
+ public function getMemFileName()
+ {
return $this->memFileName;
}
+
}
?>
diff --git a/src/testcase/sections/executablesections/rtSkipIfSection.php
b/src/testcase/sections/executablesections/rtSkipIfSection.php
index 0b68bbb..e90325d 100644
--- a/src/testcase/sections/executablesections/rtSkipIfSection.php
+++ b/src/testcase/sections/executablesections/rtSkipIfSection.php
@@ -39,6 +39,8 @@ class rtSkipIfSection extends rtExecutableSection
$phpCommand .= '
'.$testCase->testConfiguration->getPhpCommandLineArguments();
$phpCommand .= ' -f '.$this->fileName;
+ $this->phpCommand = $phpCommand;
+
$PhpRunner = new rtPhpRunner($phpCommand,
$runConfiguration->getEnvironmentVariables(),
$runConfiguration->getSetting('WorkingDirectory')
diff --git a/src/testcase/sections/rtExecutableSection.php
b/src/testcase/sections/rtExecutableSection.php
index f79ecc0..a6211ed 100644
--- a/src/testcase/sections/rtExecutableSection.php
+++ b/src/testcase/sections/rtExecutableSection.php
@@ -18,6 +18,7 @@ abstract class rtExecutableSection extends rtSection
protected $fileName;
protected $output;
protected $status;
+ protected $phpCommand = null;
protected function init()
{
@@ -46,6 +47,11 @@ abstract class rtExecutableSection extends rtSection
return $this->output;
}
+ public function getPhpCommand()
+ {
+ return $this->phpCommand;
+ }
+
abstract function run(rtPhpTest $testcase, rtRuntestsConfiguration $runConfiguration);
}
?>