zoe Sun Apr 26 07:13:36 2009 UTC Modified files: /phpruntests/src/testcase/sections/executablesections rtFileSection.php Log: Add a check to skip a CGI test if the executable has not been set http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.2 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.3 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.2 Fri Apr 24 08:41:26 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Sun Apr 26 07:13:36 2009 @@ -16,22 +16,29 @@ $this->setExecutableFileName($testCase->getName()); $this->writeExecutableFile(); - $phpCommand = $runConfiguration->getSetting('PhpExecutable'); - $phpCommand .= ' '.$testCase->testConfiguration->getPhpCommandLineArguments(); - $phpCommand .= ' -f '.$this->fileName; - $phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); + $phpExecutable = $testCase->testConfiguration->getPhpExecutable(); - $PhpRunner = new rtPhpRunner($phpCommand, - $testCase->testConfiguration->getEnvironmentVariables(), + // The CGI excutable is null if it is not available, check and SKIP if appropriate + if ($phpExecutable != null) { + $phpCommand = $phpExecutable; + $phpCommand .= ' '.$testCase->testConfiguration->getPhpCommandLineArguments(); + $phpCommand .= ' -f '.$this->fileName; + $phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); + + $PhpRunner = new rtPhpRunner($phpCommand, + $testCase->testConfiguration->getEnvironmentVariables(), $runConfiguration->getSetting('WorkingDirectory') - ); - - try { - $this->output = $PhpRunner->runphp(); - } catch (rtPhpRunnerException $e) { - $this->status['fail'] = $e->getMessage(); + ); + + try { + $this->output = $PhpRunner->runphp(); + } catch (rtPhpRunnerException $e) { + $this->status['fail'] = $e->getMessage(); + } + } else { + $this->status['skip'] = 'The CGI executable is unavailable'; } - + return $this->status; } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php