[PHP-CVS] cvs: phpruntests /src/configuration/settings rtPhpCgiExecutableSetting.php /tests/configuration/settings rtPhpCgiExecutableSettingTest.php
zoe Fri May 15 06:48:07 2009 UTC Modified files: /phpruntests/src/configuration/settings rtPhpCgiExecutableSetting.php /phpruntests/tests/configuration/settings rtPhpCgiExecutableSettingTest.php Log: Fixing Georg's problem? http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php?r1=1.8r2=1.9diff_format=u Index: phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php diff -u phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.8 phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.9 --- phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.8 Thu May 14 11:34:59 2009 +++ phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php Fri May 15 06:48:07 2009 @@ -9,9 +9,9 @@ const SAPI_CGI = /sapi/cgi/php-cgi; private $phpCgiExecutable; - + private $configuration; - + /** * Sets the PHP CGI executable. Note the dependency on having a working directory setting * @@ -19,28 +19,30 @@ public function init(rtRuntestsConfiguration $configuration) { $this-configuration = $configuration; - + if ($configuration-hasEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE')) { -if ($configuration-getEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE') == 'auto') { + if($configuration-getEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE') != null) { +if ($configuration-getEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE') == 'auto') { -$rtWorkingDirectorySetting = new rtWorkingDirectorySetting($configuration); -$this-phpCgiExecutable = $rtWorkingDirectorySetting-get() . self::SAPI_CGI; -} else { -$this-phpCgiExecutable = $configuration-getEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE'); +$rtWorkingDirectorySetting = new rtWorkingDirectorySetting($configuration); +$this-phpCgiExecutable = $rtWorkingDirectorySetting-get() . self::SAPI_CGI; +} else { +$this-phpCgiExecutable = $configuration-getEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE'); +} } -} +} } - + /** * @todo spriebsch: does this method need to be public, is it only called from get()? - * @todo zoe:This method only works if we are running from a PHP source tree, do we need to + * @todo zoe:This method only works if we are running from a PHP source tree, do we need to * cope with /usr/local/bin/php for example? */ public function guessFromPhpCli($phpCli) { -if(substr(dirname($phpCli),-3) == 'cli') { +if(substr(dirname($phpCli),-3) == 'cli') { $pathLength = strlen(dirname($phpCli)) - 3; -$sapiDir = substr(dirname($phpCli), 0, $pathLength); +$sapiDir = substr(dirname($phpCli), 0, $pathLength); $this-phpCgiExecutable = $sapiDir.cgi/php-cgi; } } @@ -51,7 +53,7 @@ * * @return string */ -public function get() +public function get() { if (is_null($this-phpCgiExecutable)) { @@ -59,8 +61,8 @@ $rtPhpExecutableSetting = new rtPhpExecutableSetting($this-configuration); $this-guessFromPhpCli($rtPhpExecutableSetting-get()); } - + return $this-phpCgiExecutable; -} +} } ? http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php?r1=1.5r2=1.6diff_format=u Index: phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php diff -u phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php:1.5 phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php:1.6 --- phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php:1.5 Tue May 12 09:15:18 2009 +++ phpruntests/tests/configuration/settings/rtPhpCgiExecutableSettingTest.php Fri May 15 06:48:07 2009 @@ -23,13 +23,15 @@ public function testSetPhpCgiExecutableNotSet() { $configuration = rtRuntestsConfiguration::getInstance(array('run-tests.php', 'test.phpt')); +$configuration-setEnvironmentVariable('TEST_PHP_CGI_EXECUTABLE', ''); $setting = new rtPhpCgiExecutableSetting($configuration); $this-assertEquals(null, $setting-get()); } public function testSetFromCliExecutableName() { -$configuration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', '/a/sapi/cli/a-php-exe', 'test.phpt')); +$configuration = rtRuntestsConfiguration::getInstance(array('run-tests.php', '-p', '/a/sapi/cli/php', 'test.phpt')); +
[PHP-CVS] cvs: phpruntests /src/configuration/settings rtPhpCgiExecutableSetting.php /src/testcase rtPhpTest.php rtTestConfiguration.php /src/testcase/sections/executablesections rtFileSection.php
zoe Thu May 14 11:34:59 2009 UTC Modified files: /phpruntests/src/testcase rtPhpTest.php rtTestConfiguration.php /phpruntests/src/testcase/sections/executablesections rtFileSection.php /phpruntests/src/configuration/settings rtPhpCgiExecutableSetting.php Log: fixing cgi check http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtPhpTest.php?r1=1.4r2=1.5diff_format=u Index: phpruntests/src/testcase/rtPhpTest.php diff -u phpruntests/src/testcase/rtPhpTest.php:1.4 phpruntests/src/testcase/rtPhpTest.php:1.5 --- phpruntests/src/testcase/rtPhpTest.php:1.4 Sun Apr 26 22:43:36 2009 +++ phpruntests/src/testcase/rtPhpTest.php Thu May 14 11:34:59 2009 @@ -60,7 +60,7 @@ //Identify the file and expect section types $this-fileSection = $this-setFileSection(); $this-expectSection = $this-setExpectSection(); - + $this-fileSection-setExecutableFileName($this-getName()); } @@ -80,8 +80,11 @@ if (!array_key_exists('skip', $this-status) !array_key_exists('bork', $this-status)) { $this-status = array_merge($this-status, $this-fileSection-run($this, $runConfiguration)); -$this-output = $this-fileSection-getOutput(); -$this-compareOutput(); +//The test can be skipped by file sections if the CGI executable is not available +if(!array_key_exists('skip', $this-status)) { +$this-output = $this-fileSection-getOutput(); +$this-compareOutput(); +} if (array_key_exists('CLEAN', $this-sections)) { http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestConfiguration.php?r1=1.13r2=1.14diff_format=u Index: phpruntests/src/testcase/rtTestConfiguration.php diff -u phpruntests/src/testcase/rtTestConfiguration.php:1.13 phpruntests/src/testcase/rtTestConfiguration.php:1.14 --- phpruntests/src/testcase/rtTestConfiguration.php:1.13 Mon May 4 17:02:37 2009 +++ phpruntests/src/testcase/rtTestConfiguration.phpThu May 14 11:34:59 2009 @@ -40,7 +40,7 @@ private function init(rtRuntestsConfiguration $runConfiguration, $sections, $sectionHeadings, $fileSection) { -$this-isCgiTest($sectionHeadings); +$this-setCgiTest($sectionHeadings); $this-setEnvironmentVariables($runConfiguration, $sections, $fileSection); $this-setPhpCommandLineArguments($runConfiguration, $sections); @@ -110,7 +110,11 @@ private function setPhpExecutable($runConfiguration, $sectionHeadings) { if ($this-cgiTest) { -$this-phpExecutable = $runConfiguration-getSetting('PhpCgiExecutable'). -C; +if($runConfiguration-getSetting('PhpCgiExecutable') != null) { +$this-phpExecutable = $runConfiguration-getSetting('PhpCgiExecutable'). -C; +} else { +$this-phpExecutable = null; +} } else { $this-phpExecutable = $runConfiguration-getSetting('PhpExecutable'); } @@ -133,7 +137,7 @@ } } -private function isCgiTest($sectionHeadings) +private function setCgiTest($sectionHeadings) { $tempArray = array_diff($this-cgiSections, $sectionHeadings); if (count($tempArray) count($this-cgiSections)) { @@ -166,5 +170,10 @@ { return $this-inputFileString; } + +public function isCgiTest() +{ +return $this-cgiTest;; +} } ? http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.8r2=1.9diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.8 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.9 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.8 Tue Apr 28 20:58:39 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Thu May 14 11:34:59 2009 @@ -15,7 +15,8 @@ class rtFileSection extends rtExecutableSection { private $twoBlankLines = '\r?\n\r?\n'; - +private $headers; + public function setExecutableFileName($testName) { $this-fileName = $testName..php; @@ -44,15 +45,16 @@ try { $this-output = $PhpRunner-runphp(); - -//If it's a CGI test sort the headers out here -if(substr($phpExecutable, -2) == '-C') { - + +//If it's a CGI test and separate the headers from the output +if($testCase-testConfiguration-isCgiTest()) { +// Would this be better done with substr/strpos, not sure how to cope with \n +
[PHP-CVS] cvs: phpruntests /src/configuration/settings rtPhpCgiExecutableSetting.php
zoe Mon May 4 17:19:20 2009 UTC Modified files: /phpruntests/src/configuration/settings rtPhpCgiExecutableSetting.php Log: ooops http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php?r1=1.5r2=1.6diff_format=u Index: phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php diff -u phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.5 phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.6 --- phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.5 Sun Apr 26 06:54:12 2009 +++ phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php Mon May 4 17:19:20 2009 @@ -6,7 +6,7 @@ */ class rtPhpCgiExecutableSetting extends rtSetting { -const SAPI_CGI = /sapi/cgi/php; +const SAPI_CGI = /sapi/cgi/php-cgi; private $phpCgiExecutable; @@ -37,7 +37,7 @@ if(substr(dirname($phpCli),-3) == 'cli') { $pathLength = strlen(dirname($phpCli)) - 3; $sapiDir = substr(dirname($phpCli), 0, $pathLength); -$this-phpCgiExecutable = $sapiDir.cgi/php; +$this-phpCgiExecutable = $sapiDir.cgi/php-cgi; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/configuration/settings rtPhpCgiExecutableSetting.php
zoe Sat Apr 25 17:18:23 2009 UTC Modified files: /phpruntests/src/configuration/settings rtPhpCgiExecutableSetting.php Log: Adding a way of deriving the cgi executable from the cli. Matches current impl but will need win specific test http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php?r1=1.3r2=1.4diff_format=u Index: phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php diff -u phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.3 phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.4 --- phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php:1.3 Fri Apr 24 08:41:25 2009 +++ phpruntests/src/configuration/settings/rtPhpCgiExecutableSetting.php Sat Apr 25 17:18:23 2009 @@ -33,6 +33,18 @@ } } +/** + * + */ +public function setFromPhpCli($phpCli) +{ +if(substr(dirname($phpCli),-3) == 'cli') { +$pathLength = strlen(dirname($phpCli)) - 3; +$sapiDir = substr(dirname($phpCli), 0, $pathLength); +$this-phpCgiExecutable = $sapiDir.cgi/php; +} +} + /** * Supply the setting to the configuration on request -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php