[PHP-CVS] cvs: phpruntests /src run-tests.php /src/configuration/preconditions rtIsPhpVersionCorrect.php
g2 Thu May 7 20:58:45 2009 UTC Modified files: /phpruntests/src/configuration/preconditions rtIsPhpVersionCorrect.php /phpruntests/srcrun-tests.php Log: phpruntests: added php-version-check to run-tests.php http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php diff -u phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php:1.1 phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php:1.2 --- phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php:1.1 Wed May 6 20:45:42 2009 +++ phpruntests/src/configuration/preconditions/rtIsPhpVersionCorrect.php Thu May 7 20:58:45 2009 @@ -51,19 +51,6 @@ */ public function check(rtRuntestsConfiguration $config) { -return ($this->checkRunVersion() && $this->checkExecVersion($config)); -} - -/** - * check that executing php-version matches the precondition - * - * @param rtRuntestsConfiguration $config - * - * @return boolean - * @access private - */ -private function checkExecVersion(rtRuntestsConfiguration $config) -{ $exec = escapeshellcmd($config->getSetting('PhpExecutable').' -v'); $pipe = popen($exec, "r"); @@ -74,17 +61,6 @@ } /** - * check that running php-version matches the precondition - * - * @return boolean - * @access private - */ -private function checkRunVersion() -{ - return $this->parseVersionString('PHP '.phpversion()); -} - -/** * parses the version-string and checks the required minimun-version * * @param string $versionStr output of "php -v" @@ -94,8 +70,8 @@ */ public function parseVersionString($versionStr) { -$major = substr($versionStr, 4,1); -$minor = substr($versionStr, 6,1); +$major = substr($versionStr, 4, 1); +$minor = substr($versionStr, 6, 1); if ($major > $this->requiredMajorVersion) { return true; http://cvs.php.net/viewvc.cgi/phpruntests/src/run-tests.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/run-tests.php diff -u phpruntests/src/run-tests.php:1.1.1.1 phpruntests/src/run-tests.php:1.2 --- phpruntests/src/run-tests.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/run-tests.php Thu May 7 20:58:45 2009 @@ -2,12 +2,40 @@ /* * Main php file for run-tests.php */ -require_once dirname(__FILE__) . '/rtAutoload.php'; +/* + * check the version of the running php-executable and + * ensure that is 5.3 or higher + */ +$v = phpversion(); -$phpTestRun = new rtPhpTestRun($argv); -$phpTestRun->run(); +$major = substr($v, 0, 1); +$minor = substr($v, 2, 1); +$isVersionOk = false; + +if ($major > 5) { +$isVersionOk = true; + +} elseif ($major == 5) { + +if ($minor >= 3) { +$isVersionOk = true; +} +} + + +if ($isVersionOk) { + +require_once dirname(__FILE__) . '/rtAutoload.php'; + +$phpTestRun = new rtPhpTestRun($argv); +$phpTestRun->run(); + +} else { + +die("This version of run-tests requires PHP 5.3 or higher.\nYou can check your current version by executing 'php -v' from the command line.\n"); +} ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src run-tests.php
g2 Tue May 12 16:05:00 2009 UTC Modified files: /phpruntests/srcrun-tests.php Log: phpruntests: improved version-check in the start-script http://cvs.php.net/viewvc.cgi/phpruntests/src/run-tests.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/run-tests.php diff -u phpruntests/src/run-tests.php:1.2 phpruntests/src/run-tests.php:1.3 --- phpruntests/src/run-tests.php:1.2 Thu May 7 20:58:45 2009 +++ phpruntests/src/run-tests.php Tue May 12 16:05:00 2009 @@ -8,34 +8,13 @@ * check the version of the running php-executable and * ensure that is 5.3 or higher */ -$v = phpversion(); - -$major = substr($v, 0, 1); -$minor = substr($v, 2, 1); - -$isVersionOk = false; - -if ($major > 5) { -$isVersionOk = true; - -} elseif ($major == 5) { - -if ($minor >= 3) { -$isVersionOk = true; -} +if (version_compare(PHP_VERSION, '5.3.0RC1', '<')) { +die('This version of run-tests requires PHP 5.3RC1 or higher, you are running ' . PHP_VERSION . "\n"); } +require_once dirname(__FILE__) . '/rtAutoload.php'; -if ($isVersionOk) { - -require_once dirname(__FILE__) . '/rtAutoload.php'; - -$phpTestRun = new rtPhpTestRun($argv); -$phpTestRun->run(); - -} else { - -die("This version of run-tests requires PHP 5.3 or higher.\nYou can check your current version by executing 'php -v' from the command line.\n"); -} +$phpTestRun = new rtPhpTestRun($argv); +$phpTestRun->run(); ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /tests/configuration/preconditions rtVersionCheckTest.php
g2 Wed May 13 12:20:48 2009 UTC Modified files: /phpruntests/tests/configuration/preconditions rtVersionCheckTest.php Log: phpruntests - removed invalid assertion http://cvs.php.net/viewvc.cgi/phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php diff -u phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php:1.1 phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php:1.2 --- phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php:1.1 Wed May 6 20:45:42 2009 +++ phpruntests/tests/configuration/preconditions/rtVersionCheckTest.php Wed May 13 12:20:47 2009 @@ -41,7 +41,6 @@ { $this->assertFalse($this->versionCheck->parseVersionString("5.3.0")); $this->assertFalse($this->versionCheck->parseVersionString("PHP 5.2 PHP 6.0")); -$this->assertFalse($this->versionCheck->parseVersionString("PHP 6")); } } ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src rtClassMap.php /src/testcase/preconditions rtIsSectionImplemented.php /src/testcase/sections rtSection.php /src/testcase/sections/executablesections _rtFileExternalS
g2 Fri May 15 09:58:22 2009 UTC Added files: /phpruntests/src/testcase/sections/executablesections rtFileExternalSection.php _rtFileExternalSection.php Modified files: /phpruntests/src/testcase/sections rtSection.php /phpruntests/src/testcase/preconditions rtIsSectionImplemented.php /phpruntests/srcrtClassMap.php Log: phpruntests - implemented FILE_EXTERNAL-section (not final) http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/rtSection.php?r1=1.9&r2=1.10&diff_format=u Index: phpruntests/src/testcase/sections/rtSection.php diff -u phpruntests/src/testcase/sections/rtSection.php:1.9 phpruntests/src/testcase/sections/rtSection.php:1.10 --- phpruntests/src/testcase/sections/rtSection.php:1.9 Thu May 14 19:56:30 2009 +++ phpruntests/src/testcase/sections/rtSection.php Fri May 15 09:58:21 2009 @@ -24,6 +24,7 @@ 'DEFLATE_POST' => 'rtDeflatePostSection', 'POST_RAW' => 'rtPostRawSection', 'COOKIE'=> 'rtCookieSection', +'FILE_EXTERNAL' => 'rtFileExternalSection', 'EXPECTHEADERS' => 'rtExpectHeadersSection', ); http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php?r1=1.8&r2=1.9&diff_format=u Index: phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php diff -u phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.8 phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.9 --- phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php:1.8 Thu May 14 19:56:30 2009 +++ phpruntests/src/testcase/preconditions/rtIsSectionImplemented.php Fri May 15 09:58:21 2009 @@ -23,6 +23,7 @@ 'DEFLATE_POST' => 'rtDeflatePostSection', 'POST_RAW'=> 'rtPostRawSection', 'COOKIE'=> 'rtCookieSection', +'FILE_EXTERNAL' => 'rtFileExternalSection', 'EXPECTHEADERS' => 'rtExpectHeadersSection', ); http://cvs.php.net/viewvc.cgi/phpruntests/src/rtClassMap.php?r1=1.8&r2=1.9&diff_format=u Index: phpruntests/src/rtClassMap.php diff -u phpruntests/src/rtClassMap.php:1.8 phpruntests/src/rtClassMap.php:1.9 --- phpruntests/src/rtClassMap.php:1.8 Thu May 14 19:56:30 2009 +++ phpruntests/src/rtClassMap.php Fri May 15 09:58:21 2009 @@ -73,6 +73,7 @@ 'rtPostRawSection' => 'testcase/sections/configurationsections/rtPostRawSection.php', 'rtPostSection'=> 'testcase/sections/configurationsections/rtPostSection.php', 'rtCleanSection' => 'testcase/sections/executablesections/rtCleanSection.php', +'rtFileExternalSection'=> 'testcase/sections/executablesections/rtFileExternalSection.php', 'rtFileSection'=> 'testcase/sections/executablesections/rtFileSection.php', 'rtSkipIfSection' => 'testcase/sections/executablesections/rtSkipIfSection.php', 'rtCreditsSection' => 'testcase/sections/informationsections/rtCreditsSection.php', http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php?view=markup&rev=1.1 Index: phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php +++ phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php * @authorStefan Priebsch * @authorGeorg Gradwohl * @copyright 2009 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ */ class rtFileExternalSection extends rtFileSection { public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if ($this->copyExternalFileContent() === true) { return parent::run($testCase, $runConfiguration); } return $this->status; } private function copyExternalFileContent() { if (sizeof($this->sectionContents) == 1) { $file = $this->sectionContents[0]; // don't allow tests to retrieve files from anywhere but this subdirectory $file = dirname($this->fileName).'/'.trim(str_replace('..', '', $file));
[PHP-CVS] cvs: phpruntests /src testClassMap.php /src/testcase/sections/executablesections _rtFileExternalSection.php rtFileExternalSection.php /tests/testcase/sections/executablesections rtFileExte
g2 Fri May 15 23:11:21 2009 UTC Added files: /phpruntests/tests/testcase/sections/executablesections rtFileExternalSectionTest.php Modified files: /phpruntests/src/testcase/sections/executablesections rtFileExternalSection.php _rtFileExternalSection.php /phpruntests/srctestClassMap.php Log: phpruntests - added test-case for file-external-section http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.1 phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.2 --- phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.1 Fri May 15 09:58:21 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php Fri May 15 23:11:20 2009 @@ -12,45 +12,114 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ */ -class rtFileExternalSection extends rtFileSection +class rtFileExternalSection extends rtExecutableSection { - + +/** + * @var $twoBlankLines string + */ + private $twoBlankLines = '\r?\n\r?\n'; + +/** + * sets the executable filename + * + * @param $testName string the filename + * @return void + */ +public function setExecutableFileName($testName) +{ +$this->fileName = $testName.".php"; +} + +/** + * runs a test-case and returns the status + * + * @param $testCase rtPhpTest + * @param $runConfiguration rtRuntestsConfiguration + * @return $status Array + */ public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { - if ($this->copyExternalFileContent() === true) { +$this->status = array(); +$this->writeExecutableFile(); -return parent::run($testCase, $runConfiguration); +$this->copyExternalFileContent(); + +$phpExecutable = $testCase->testConfiguration->getPhpExecutable(); + +// The CGI excutable is null if it is not available, check and SKIP if necessary +if (is_null($phpExecutable)) { + $this->status['skip'] = 'The CGI executable is unavailable'; + return $this->status; +} + +$phpCommand = $phpExecutable; +$phpCommand .= ' '. $testCase->testConfiguration->getPhpCommandLineArguments(); +$phpCommand .= ' -f '.$this->fileName; +$phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); +$phpCommand .= ' 2>&1 '.$testCase->testConfiguration->getInputFileString(); + + +$PhpRunner = new rtPhpRunner($phpCommand, +$testCase->testConfiguration->getEnvironmentVariables(), +$runConfiguration->getSetting('WorkingDirectory') +); + +try { + + $this->output = $PhpRunner->runphp(); + +// If it's a CGI test sort the headers out here +if (substr($phpExecutable, -2) == '-C') { + +if (preg_match("/^(.*?)$this->twoBlankLines(.*)/s", $this->output, $match)) { +$this->output = $match[2]; +$this->headers = $match[1]; +} +} +} catch (rtPhpRunnerException $e) { + + $this->status['fail'] = $e->getMessage(); } return $this->status; } - -private function copyExternalFileContent() +/** + * @return string + */ +public function getHeaders() { - if (sizeof($this->sectionContents) == 1) { - - $file = $this->sectionContents[0]; - - // don't allow tests to retrieve files from anywhere but this subdirectory - $file = dirname($this->fileName).'/'.trim(str_replace('..', '', $file)); - - if (file_exists($file)) { +return $this->headers; +} + +/** + * checks and copies the content of the external file to the testfile + * + * @return boolean + */ +protected function copyExternalFileContent() +{ +if (sizeof($this->sectionContents) != 1) { + + $this->status['fail'] = 'One file per testcase permitted.'; + return false; +} + +$c = $this->sectionContents[0]; + +// don't allow tests to retrieve files from anywhere but this su
[PHP-CVS] cvs: phpruntests /src/testcase/sections/executablesections rtFileExternalSection.php /tests/testcase/sections/executablesections rtFileExternalSectionTest.php
g2 Mon May 18 22:38:27 2009 UTC Modified files: /phpruntests/tests/testcase/sections/executablesections rtFileExternalSectionTest.php /phpruntests/src/testcase/sections/executablesections rtFileExternalSection.php Log: phpruntests - update external-section testcase http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php diff -u phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.1 phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.2 --- phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php:1.1 Fri May 15 23:11:20 2009 +++ phpruntests/tests/testcase/sections/executablesections/rtFileExternalSectionTest.php Mon May 18 22:38:27 2009 @@ -7,7 +7,7 @@ { public function testCreateInstance() { -$fileSection = new rtFileExternalSection('FILE_EXTERNAL', array('')); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('')); $code = $fileSection->getContents(); $this->assertEquals('assertFalse($wrapper->copyExternalFileContentTest()); - -$status = $wrapper->getStatus(); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('file1','file2')); + $content = $fileSection->getContents(); + $config = rtRuntestsConfiguration::getInstance(array()); + $test = new rtPhpTest($content, 'TEST', array('FILE_EXTERNAL'), $config); + + $status = $fileSection->run($test, $config); $this->assertEquals('One file per testcase permitted.', $status['fail']); } public function testNotExistingFile() { -$wrapper = new rtFileExternalSectionTestWrapper('FILE_EXTERNAL', array('file1')); - -$this->assertFalse($wrapper->copyExternalFileContentTest()); - -$status = $wrapper->getStatus(); +$fileSection = rtFileExternalSection::getInstance('FILE_EXTERNAL', array('file1')); +$content = $fileSection->getContents(); +$config = rtRuntestsConfiguration::getInstance(array()); +$test = new rtPhpTest($content, 'TEST', array('FILE_EXTERNAL'), $config); $this->assertEquals('Can not open external file /file1', $status['fail']); } } -/** - * test-wrapper to acces protected methods and members - */ -class rtFileExternalSectionTestWrapper extends rtFileExternalSection -{ -public function copyExternalFileContentTest() -{ - return parent::copyExternalFileContent(); -} - -public function getStatus() -{ -return $this->status; -} -} - ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.5 phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.6 --- phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php:1.5 Sun May 17 11:47:27 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileExternalSection.php Mon May 18 22:38:27 2009 @@ -14,43 +14,41 @@ */ class rtFileExternalSection extends rtFileSection { - + /** +* @param rtPhpTest$testCase +* @param rtRuntestsConfiguration $runConfiguration +* @return Array$status +*/ public function run(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if ($this->copyExternalFileContent() === true) { - return parent::run($testCase, $runConfiguration); } - return $this->status; } - +/** + * @return boolean + */ private function copyExternalFileContent() { - if (sizeof($this->sectionContents) == 1) { + if (sizeof($this->sectionContents) != 1) { +$this->status['fail'] = 'One file per testcase permitted.'; + return false; + } - $file = $this->sectionContents[0]; - - // don't allow tests to retrieve files from anywhere but this subdirectory - $file = dirname($this->fileName).'/'.trim(str_replace('..', '', $file)); +$file = $this->sectionContents[0]; - if (file_exists($file)) { + // don't allow tests to retrieve files from anywhere but this subdirectory +$file = dirnam
[PHP-CVS] cvs: phpruntests /code-samples/taskScheduler run.php /code-samples/taskScheduler/classes task.php taskInterface.php taskScheduler.php /code-samples/taskScheduler/example1 main.php taskCalc
g2 Sat Jun 13 03:13:31 2009 UTC Added files: /phpruntests/code-samples/taskScheduler/classes task.php taskScheduler.php taskInterface.php /phpruntests/code-samples/taskScheduler/example3/files/src/adv 023.phpt 010.phpt 009.phpt 026.phpt 014.phpt 027.phpt 020.phpt 011.phpt 012.phpt 013.phpt 017.phpt 022.phpt 025.phpt 016.phpt 015.phpt 018.phpt 024.phpt 019.phpt 008.phpt /phpruntests/code-samples/taskScheduler/example3/imgConverter imageCreator.php fileReader.php fileCreator.php imageReader.php /phpruntests/code-samples/taskScheduler/example3/files/src/func 007.phpt 010.phpt 002.phpt 006.phpt 008.phpt 005a.phpt 005.phpt 003.phpt 004.phpt 001.phpt 009.phpt /phpruntests/code-samples/taskScheduler/example3/files/src/basic 007.phpt 006.phpt 001.phpt 004.phpt 003.phpt 005.phpt 002.phpt /phpruntests/code-samples/taskScheduler/example1main.php taskCalculate.php /phpruntests/code-samples/taskScheduler/example3taskConvert.php main.php /phpruntests/code-samples/taskScheduler run.php /phpruntests/code-samples/taskScheduler/example2taskSleep.php main.php Log: phpruntests - added taskScheduler-prototype http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/taskScheduler/classes/task.php?view=markup&rev=1.1 Index: phpruntests/code-samples/taskScheduler/classes/task.php +++ phpruntests/code-samples/taskScheduler/classes/task.php state = $state; } public function getState() { return $this->state; } public function setMessage($msg) {
[PHP-CVS] cvs: phpruntests /code-samples/taskScheduler/example3 main.php
g2 Sat Jun 13 14:25:02 2009 UTC Modified files: /phpruntests/code-samples/taskScheduler/example3main.php Log: phpruntests - minor bugfix taskScheduler http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/taskScheduler/example3/main.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/code-samples/taskScheduler/example3/main.php diff -u phpruntests/code-samples/taskScheduler/example3/main.php:1.1 phpruntests/code-samples/taskScheduler/example3/main.php:1.2 --- phpruntests/code-samples/taskScheduler/example3/main.php:1.1Sat Jun 13 03:13:31 2009 +++ phpruntests/code-samples/taskScheduler/example3/main.phpSat Jun 13 14:25:01 2009 @@ -25,6 +25,8 @@ $name = $file->getFileName(); if (substr($name,0,1) == '.') continue; + + if ($name == 'CVS') continue; if ($file->isDir()) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /code-samples/taskScheduler run.php /code-samples/taskScheduler/classes taskScheduler.php /code-samples/taskScheduler/example4 main.php taskFileWriter.php
g2 Tue Jun 16 22:43:30 2009 UTC Added files: /phpruntests/code-samples/taskScheduler/example4taskFileWriter.php main.php Modified files: /phpruntests/code-samples/taskScheduler/classes taskScheduler.php /phpruntests/code-samples/taskScheduler run.php Log: phpruntests - update taskScheduler-prototype http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/taskScheduler/classes/taskScheduler.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/code-samples/taskScheduler/classes/taskScheduler.php diff -u phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.1 phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.2 --- phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.1 Sat Jun 13 03:13:30 2009 +++ phpruntests/code-samples/taskScheduler/classes/taskScheduler.phpTue Jun 16 22:43:30 2009 @@ -9,14 +9,15 @@ const MSG_QUEUE_SIZE = 1024;// max-size of a single message const KILL_CHILD = 'killBill'; // kill-signal to terminate a child - private $taskList = array(); - private $processCount = NULL; - private $inputQueue = NULL; - private $pidStore = array(); - private $time = 0; - private $countPass = 0; - private $countFail = 0; - private $groupTasks = false; + private $taskList = array();// the list of the tasks to be executed + private $processCount = NULL; // the number of processes + private $inputQueue = NULL; // the input-queue (only used by the sender) + private $pidStore = array();// stores the pids of all child-processes + private $time = 0; // the needed time + private $countPass = 0; // counts the passed tasks + private $countFail = 0; // counts the failed tasks + private $groupTasks = false;// are the tasks stored in groups? + private $memStore = array();// stores the mem-usage after an incomming task /** @@ -252,6 +253,8 @@ } for ($i=0; $i<$limit; $i++) { + + $this->memStore[] = memory_get_usage(true); if (msg_receive($resultQueue, 0, $type, self::MSG_QUEUE_SIZE, $task, true, NULL, $error)) { @@ -273,6 +276,8 @@ $this->taskList[$index] = $task; logg("RECEIVER store task $index"); } + + } else logg("RECEIVER ERROR $error"); } @@ -352,7 +357,7 @@ /** * the child is listening to the input-queue and executes the incomming * tasks. afterwards it setts the task-state and sends it back to the -* receiver by the result-queue. +* receiver via the result-queue. * after receiving the kill-signal from the receiver it terminates itself. * * @param int $cidthe child-id (default=NULL) @@ -426,6 +431,7 @@ print "Tasks:\t\t".$count."\n"; } else { + $count = sizeof($this->taskList); print "Tasks:\t\t".$count."\n"; } @@ -437,8 +443,12 @@ if ($this->processCount > 0) { print "AVG sec/task:\t".round($this->time/$this->processCount,5)."\n"; + print "Memory-MAX:\t".number_format(max($this->memStore))."\n"; + print "Memory-MIN:\t".number_format(min($this->memStore))."\n"; + $avg = array_sum($this->memStore)/sizeof($this->memStore); + print "Memory-AVG:\t".number_format($avg)."\n"; } - + print "\n"; flush(); } @@ -470,6 +480,30 @@ } } + + + public function printMemStatistic($int=10) + { + print "MEMORY-USAGE"; + print "\n\n"; + + $int = ceil(sizeof($this->memStore)/$int); + + $title = "TASK:\t"; + $body = "kB:\t"; + + for ($i=0; $imemStore); $i+=$int) { + + $title .= "$i\t"; + $body .= round($this->memStore[$i]/1000)."\t"; + } + + print $title."\n".$body; + + print "\n\n"; +
[PHP-CVS] cvs: phpruntests /code-samples arrayTest.php
g2 Sun Jun 21 17:30:46 2009 UTC Added files: /phpruntests/code-samples arrayTest.php Log: phpruntests - add arrayTest (spl-performace-test) http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/arrayTest.php?view=markup&rev=1.1 Index: phpruntests/code-samples/arrayTest.php +++ phpruntests/code-samples/arrayTest.php getIterator(); while ($iterator->valid()) { if ($iterator->key()%2 == 0) { $testObject[$iterator->current()] = 'G'; } $iterator->next(); } $e = microtime(true); $ti = round($e-$s, 5); $diff = round($ti/$tl*100, 0); print "spl:\t$ti sec ($diff%)\n"; print "DIFF:\t".($ti-$tl)." sec\n"; flush(); ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /code-samples/taskScheduler results.xls run.php /code-samples/taskScheduler/classes taskScheduler.php taskSchedulerFile.php taskSchedulerMsgQ.php
g2 Mon Jun 22 00:19:12 2009 UTC Added files: /phpruntests/code-samples/taskScheduler/classes taskSchedulerFile.php taskSchedulerMsgQ.php /phpruntests/code-samples/taskScheduler results.xls Modified files: /phpruntests/code-samples/taskScheduler/classes taskScheduler.php /phpruntests/code-samples/taskScheduler run.php Log: phpruntests - update taskScheduler (prototype) - added file-driven ipc http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/taskScheduler/classes/taskScheduler.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/code-samples/taskScheduler/classes/taskScheduler.php diff -u phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.2 phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.3 --- phpruntests/code-samples/taskScheduler/classes/taskScheduler.php:1.2 Tue Jun 16 22:43:30 2009 +++ phpruntests/code-samples/taskScheduler/classes/taskScheduler.phpMon Jun 22 00:19:12 2009 @@ -1,24 +1,17 @@ setProcessCount($processCount); } + + +public static function getInstance(array $taskList=NULL, $processCount=NUL, $useMsgQ=false) +{ + if (extension_loaded('pcntl')) { + + if ($useMsgQ === true) { + + return new taskSchedulerMsgQ($taskList, $processCount); + } + + return new taskSchedulerFile($taskList, $processCount); + } + + return new taskScheduler($taskList, $processCount); +} /** * sets the task-list which has to be an array of task-objects. - * it's also possible to use a multidimensional array. in this case the - * tasks are distributed to the child-processes exactly in the way as they - * are grouped in the list. the first-level index strictly has to be - * numeric and continuous starting with zero. - * +* * @param array $taskList */ public function setTaskList(array $taskList) { - if (is_array($taskList[0])) { - $this->groupTasks = true; - $this->processCount = sizeof($taskList); - } - $this->taskList = $taskList; } @@ -74,64 +74,18 @@ */ public function setProcessCount($processCount) { - if ($this->groupTasks !== true && is_numeric($processCount) && $processCount >= 0) { + if (is_numeric($processCount) && $processCount >= 0) { $this->processCount = $processCount; } } /** -* removes the used message-queues. -*/ -private static function cleanUp() -{ - @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY)); - @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY+1)); - logg("CLEAN UP"); -} - - - /** -* the signal-handler is called by the interrupt- or quit-signal and calls -* the cleanUp-method. -* -* @param int $signal -*/ - public static function signalHandler($signal) - { - logg("SIGNAL: $signal"); - - switch($signal) { - - case SIGINT: - case SIGQUIT: - self::cleanUp(); - die("\n"); - break; - - default: - break; - } - } - -/** - * switch to run the classic- or the fork-mode - */ - public function run() - { - if ($this->processCount > 0) { - $this->runFork(); - } - else $this->runClassic(); - } - - - /** * executes the tasks in a simple loop * * @return void */ - private function runClassic() + public function run() { $s = microtime(true); @@ -147,6 +101,8 @@ $this->countFail++; } + $this->memStore[] = memory_get_usage(true); + print "."; flush(); @@ -162,256 +118,6 @@ /** -* starts the sender, the receiver and forks the defined -* number of child-processes. -* -* @return void -*/ - private function runFork() - { - $startTime = microtime(true); - - // register signal-handler -
[PHP-CVS] cvs: phpruntests /code-samples dirList.php /src rtUtil.php
g2 Mon Jun 22 02:17:17 2009 UTC Added files: /phpruntests/code-samples dirList.php Modified files: /phpruntests/srcrtUtil.php Log: phpruntests - added a alternative parse-method in rtUtil http://cvs.php.net/viewvc.cgi/phpruntests/src/rtUtil.php?r1=1.4&r2=1.5&diff_format=u Index: phpruntests/src/rtUtil.php diff -u phpruntests/src/rtUtil.php:1.4 phpruntests/src/rtUtil.php:1.5 --- phpruntests/src/rtUtil.php:1.4 Sun Jun 21 20:29:12 2009 +++ phpruntests/src/rtUtil.php Mon Jun 22 02:17:17 2009 @@ -48,5 +48,35 @@ return $phptDirectories; } + + + /** +* just a test +* + * @param $path + * @return array +*/ + public static function parseDir($path) { + + $list = array(); + + if (sizeof(glob($path."/*.phpt")) > 0) { + + $list[] = $path.'/'; + } + + foreach (scandir($path) as $file) { + + if (substr($file, 0, 1) != '.' && $file != 'CVS') { + + if (is_dir($path.'/'.$file)) { + + $list = array_merge($list, rtUtil::parseDir($path.'/'.$file)); + } + } + } + + return $list; + } } ?> http://cvs.php.net/viewvc.cgi/phpruntests/code-samples/dirList.php?view=markup&rev=1.1 Index: phpruntests/code-samples/dirList.php +++ phpruntests/code-samples/dirList.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src rtUtil.php
g2 Mon Jun 22 16:36:26 2009 UTC Modified files: /phpruntests/srcrtUtil.php Log: phpruntests - alternative parse-method in rtUtil (minor adjustment) http://cvs.php.net/viewvc.cgi/phpruntests/src/rtUtil.php?r1=1.6&r2=1.7&diff_format=u Index: phpruntests/src/rtUtil.php diff -u phpruntests/src/rtUtil.php:1.6 phpruntests/src/rtUtil.php:1.7 --- phpruntests/src/rtUtil.php:1.6 Mon Jun 22 07:56:12 2009 +++ phpruntests/src/rtUtil.php Mon Jun 22 16:36:26 2009 @@ -50,35 +50,37 @@ } -/** - * just a test - * + /** +* returns a list of directories containing a phpt-file +* * @param $path * @return array - */ -public static function parseDir($path) { - -$list = array(); - -if (sizeof(glob($path."/*.phpt")) > 0) { - -$list[] = $path.'/'; -} - -foreach (scandir($path) as $file) { - -if (substr($file, 0, 1) != '.' && $file != 'CVS') { - -if (is_dir($path.'/'.$file)) { - -$list = array_merge($list, rtUtil::parseDir($path.'/'.$file)); -} -} -} - -return $list; -} +*/ + public static function parseDir($path) + { + $list = array(); + $found = false; + + foreach (scandir($path) as $file) { + + if (substr($file, 0, 1) != '.' && $file != 'CVS') { + + if (is_dir($path.'/'.$file)) { + + $list = array_merge($list, rtUtil::parseDir($path.'/'.$file)); + + } elseif ($found === false && strpos($file, '.phpt') !== false) { + + $list[] = $path.'/'; + $found = true; + } + } + } + + return $list; + } + /** * This is the original version of getDirectoryList which uses PhptFilterIterator */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src rtClassMap.php /src/testcase/exceptions rtPhpRunnerException.php
g2 Tue Jun 23 12:59:52 2009 UTC Added files: /phpruntests/src/testcase/exceptionsrtPhpRunnerException.php Modified files: /phpruntests/srcrtClassMap.php Log: phpruntests - fixed wrong class-filename http://cvs.php.net/viewvc.cgi/phpruntests/src/rtClassMap.php?r1=1.12&r2=1.13&diff_format=u Index: phpruntests/src/rtClassMap.php diff -u phpruntests/src/rtClassMap.php:1.12 phpruntests/src/rtClassMap.php:1.13 --- phpruntests/src/rtClassMap.php:1.12 Tue Jun 2 08:03:32 2009 +++ phpruntests/src/rtClassMap.php Tue Jun 23 12:59:51 2009 @@ -48,7 +48,7 @@ 'rtPhptFilterIterator' => 'rtPhptFilterIterator.php', 'rtText' => 'rtText.php', 'rtUtil' => 'rtUtil.php', -'rtCodeRunnerException'=> 'testcase/exceptions/rtCodeRunnerException.php', +'rtPhpRunnerException' => 'testcase/exceptions/rtPhpRunnerException.php', 'rtTestOutputWriterList' => 'testcase/output/rtTestOutputWriterList.php', 'rtTestOutputWriterXML'=> 'testcase/output/rtTestOutputWriterXML.php', 'rtHasMandatorySections' => 'testcase/preconditions/rtHasMandatorySections.php', http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/exceptions/rtPhpRunnerException.php?view=markup&rev=1.1 Index: phpruntests/src/testcase/exceptions/rtPhpRunnerException.php +++ phpruntests/src/testcase/exceptions/rtPhpRunnerException.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src rtClassMap.php run-tests.php /src/configuration rtCommandLineOptions.php /src/configuration/exceptions rtEnvironmentException.php rtException.php rtMissingArgumentExc
ClassMap.php Fri Jun 26 00:07:24 2009 @@ -8,6 +8,7 @@ */ $rtClassMap = array( 'rtEnvironmentException' => 'configuration/exceptions/rtEnvironmentException.php', +'rtException' => 'configuration/exceptions/rtException.php', 'rtMissingArgumentException' => 'configuration/exceptions/rtMissingArgumentException.php', 'rtUnknownIniSettingException' => 'configuration/exceptions/rtUnknownIniSettingException.php', 'rtUnknownOptionException' => 'configuration/exceptions/rtUnknownOptionException.php', @@ -48,6 +49,12 @@ 'rtPhptFilterIterator' => 'rtPhptFilterIterator.php', 'rtText' => 'rtText.php', 'rtUtil' => 'rtUtil.php', +'rtTask' => 'taskScheduler/rtTask.php', +'rtTaskInterface' => 'taskScheduler/rtTaskInterface.php', +'rtTaskScheduler' => 'taskScheduler/rtTaskScheduler.php', +'rtTaskSchedulerFile' => 'taskScheduler/rtTaskSchedulerFile.php', +'rtTaskSchedulerMsgQ' => 'taskScheduler/rtTaskSchedulerMsgQ.php', +'rtTaskTestGroup' => 'taskScheduler/rtTaskTestGroup.php', 'rtPhpRunnerException' => 'testcase/exceptions/rtPhpRunnerException.php', 'rtTestOutputWriterList' => 'testcase/output/rtTestOutputWriterList.php', 'rtTestOutputWriterXML'=> 'testcase/output/rtTestOutputWriterXML.php', http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/rtCommandLineOptions.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/configuration/rtCommandLineOptions.php diff -u phpruntests/src/configuration/rtCommandLineOptions.php:1.5 phpruntests/src/configuration/rtCommandLineOptions.php:1.6 --- phpruntests/src/configuration/rtCommandLineOptions.php:1.5 Mon May 25 08:56:23 2009 +++ phpruntests/src/configuration/rtCommandLineOptions.php Fri Jun 26 00:07:24 2009 @@ -24,8 +24,7 @@ 'q', 'x', 'v', -'h', -'z', //parallel - run out of obvious letters +'h', ); /** @@ -40,6 +39,7 @@ 'd', 'p', 's', + 'z', //parallel - run out of obvious letters ); /** http://cvs.php.net/viewvc.cgi/phpruntests/src/testrun/rtPhpTestRun.php?r1=1.11&r2=1.12&diff_format=u Index: phpruntests/src/testrun/rtPhpTestRun.php diff -u phpruntests/src/testrun/rtPhpTestRun.php:1.11 phpruntests/src/testrun/rtPhpTestRun.php:1.12 --- phpruntests/src/testrun/rtPhpTestRun.php:1.11 Sun Jun 7 11:06:51 2009 +++ phpruntests/src/testrun/rtPhpTestRun.phpFri Jun 26 00:07:24 2009 @@ -8,6 +8,7 @@ * @packageRUNTESTS * @author Zoe Slattery * @author Stefan Priebsch + * @author Georg Gradwohl * @copyright 2009 The PHP Group * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 * @@ -39,16 +40,43 @@ if ($runConfiguration->getSetting('TestDirectories') != null) { foreach ($runConfiguration->getSetting('TestDirectories') as $testDirectory) { - -//make list of subdirectories which contain tests, includes the top level directory -$subDirectories = rtUtil::getDirectoryList($testDirectory); - -//Run tests in each subdirectory in sequence -foreach ($subDirectories as $subDirectory) { -$testGroup = new rtPhpTestGroup($runConfiguration, $subDirectory); -$testGroup->runGroup($runConfiguration); -$testGroup->writeGroup(); -} + + // make list of subdirectories which contain tests, includes the top level directory + $subDirectories = rtUtil::parseDir($testDirectory); + + // check for the cmd-line-option 'z' which defines parellel-execution + if ($runConfiguration->hasCommandLineOption('z')) { + + $processCount = $runConfiguration->getCommandLineOption('z'); + + if (!is_numeric($processCount) || $processCount <= 0) { +
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskTestGroup.php
g2 Sat Jun 27 17:47:55 2009 UTC Modified files: /phpruntests/src/taskScheduler rtTaskTestGroup.php Log: phpruntests - removed out-commented line (write output) http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskTestGroup.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskTestGroup.php diff -u phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.1 phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.2 --- phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.1 Fri Jun 26 00:07:24 2009 +++ phpruntests/src/taskScheduler/rtTaskTestGroup.php Sat Jun 27 17:47:54 2009 @@ -27,7 +27,7 @@ { $testGroup = new rtPhpTestGroup($this->runConfiguration, $this->subDirectory); $testGroup->runGroup($this->runConfiguration); - // $testGroup->writeGroup(); + $testGroup->writeGroup(); return true; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskScheduler.php rtTaskSchedulerFile.php /tests rtTaskSchedulerTest.php
g2 Sat Jun 27 23:57:46 2009 UTC Modified files: /phpruntests/src/taskScheduler rtTaskScheduler.php rtTaskSchedulerFile.php /phpruntests/tests rtTaskSchedulerTest.php Log: phpruntests - minor bugfix task-scheduler http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskScheduler.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskScheduler.php diff -u phpruntests/src/taskScheduler/rtTaskScheduler.php:1.2 phpruntests/src/taskScheduler/rtTaskScheduler.php:1.3 --- phpruntests/src/taskScheduler/rtTaskScheduler.php:1.2 Sat Jun 27 13:29:32 2009 +++ phpruntests/src/taskScheduler/rtTaskScheduler.php Sat Jun 27 23:57:46 2009 @@ -107,24 +107,21 @@ $task = $this->taskList[$i]; if ($task->run() === true) { - $task->setState(task::PASS); + $task->setState(rtTask::PASS); $this->countPass++; } else { - $task->setState(task::FAIL); + $task->setState(rtTask::FAIL); $this->countFail++; } $this->memStore[] = memory_get_usage(true); - - print "."; - flush(); - + $this->taskList[$i] = $task; } $error = microtime(true); - $this->time = round($error-$s,5); + $this->time = round($e-$s,5); return; } http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskSchedulerFile.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskSchedulerFile.php diff -u phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.1 phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.2 --- phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.1 Fri Jun 26 00:07:24 2009 +++ phpruntests/src/taskScheduler/rtTaskSchedulerFile.php Sat Jun 27 23:57:46 2009 @@ -151,8 +151,6 @@ if ($this->groupTasks == true) { - $c = 0; - foreach ($this->taskList as $key => $list) { for ($i=0; $itaskList); $i++) { - $taskStr[$i%$this->processCount] .= $i.';'; + $cid = $i%$this->processCount; + + if (!isset($taskStr[$cid])) { + $taskStr[$cid] = ''; + } + + $taskStr[$cid] .= $i.';'; } } http://cvs.php.net/viewvc.cgi/phpruntests/tests/rtTaskSchedulerTest.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/tests/rtTaskSchedulerTest.php diff -u phpruntests/tests/rtTaskSchedulerTest.php:1.1 phpruntests/tests/rtTaskSchedulerTest.php:1.2 --- phpruntests/tests/rtTaskSchedulerTest.php:1.1 Fri Jun 26 00:07:24 2009 +++ phpruntests/tests/rtTaskSchedulerTest.php Sat Jun 27 23:57:46 2009 @@ -7,10 +7,11 @@ { public function testResult() { -// create 10 tasks with random numbers $taskList = array(); $expected = array(); + $results = array(); + // create 10 tasks with random numbers for ($i=0; $i<10; $i++) { $n = rand(0,9); $expected[$i] = $n+1; @@ -24,8 +25,6 @@ $scheduler->run(); // get the results from the manupilated task-list - $results = array(); - foreach ($scheduler->getTaskList() as $task) { $results[] = $task->getNumber(); } @@ -61,5 +60,4 @@ } } - -?> +?> \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src cmpResults.php /src/taskScheduler rtTask.php rtTaskSchedulerFile.php rtTaskTestGroup.php /src/testcase rtTestOutputWriter.php /src/testcase/output rtTestOutputWriter
g2 Mon Jun 29 01:34:55 2009 UTC Added files: /phpruntests/srccmpResults.php Modified files: /phpruntests/src/testcase/outputrtTestOutputWriterList.php rtTestOutputWriterCSV.php rtTestOutputWriterXML.php /phpruntests/src/testgroup rtPhpTestGroup.php /phpruntests/src/testrunrtPhpTestRun.php /phpruntests/src/taskScheduler rtTask.php rtTaskSchedulerFile.php rtTaskTestGroup.php /phpruntests/src/testcase rtTestOutputWriter.php Log: phpruntests - implemented rtTestOutputWriterXML - added cmpResults to compare test-results http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterList.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterList.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.5 phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.6 --- phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.5 Sun Jun 7 11:06:51 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterList.php Mon Jun 29 01:34:54 2009 @@ -46,13 +46,18 @@ } -public function write($testDirectory = null) +public function write($testDirectory = null, $cid = null) { if ($testDirectory != null) { echo "\n\nTest output for tests in " . $testDirectory . "\n"; } sort($this->testOutput); foreach ($this->testOutput as $line) { + + if (!is_null($cid)) { + echo "$cid - "; + } + echo $line ."\n"; } } http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterCSV.php?r1=1.1&r2=1.2&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterCSV.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.1 phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.2 --- phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.1 Sun Jun 28 09:46:48 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterCSV.php Mon Jun 29 01:34:54 2009 @@ -44,11 +44,16 @@ } -public function write($testDirectory = null) +public function write($testDirectory = null, $cid = null) { sort($this->testOutput); foreach ($this->testOutput as $line) { -echo $line ."\n"; + + if (!is_null($cid)) { + echo "$cid - "; + } + + echo $line ."\n"; } } } http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterXML.php?r1=1.3&r2=1.4&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterXML.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.3 phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.4 --- phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.3 Mon May 25 11:59:58 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterXML.php Mon Jun 29 01:34:54 2009 @@ -1,6 +1,6 @@ * * Write test output as XML * @@ -8,6 +8,7 @@ * @packageRUNTESTS * @author Zoe Slattery * @author Stefan Priebsch + * @author Georg Gradwohl * @copyright 2009 The PHP Group * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ @@ -15,12 +16,92 @@ */ class rtTestOutputWriterXML extends rtTestOutputWriter { -public function assemble(rtPhpTest $testCase) +private $dom = null; + private $rootNode = null; + private $stamp = 0; + + private static $instance = null; + + + private function __construct() { + + $this->dom = new DOMDocument(); + $this->rootNode = $this->dom->createElement('RUNTESTS'); + $this->dom->appendChild($this->rootNode); + + $this->stamp = round(microtime(true)); + } + +private function __clone() {} + + +public static function getInstance() { + if (is_null(self::$instance)) { + self::$instance = new self; + } + + return self::$instance; } - -public function write() + + +public function setTestResults(array $testResults) { + $this->init($testResults); +} + + +/** + * + * + * @param array of rtTestResults + * + */ +public function init (array $testResults) +{ +$dom = $this->dom; + +foreach ($testResults as $testResult) { + + $test = $dom->createElement('testcase'); + $test->appendChild($
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskSchedulerFile.php rtTaskTestGroup.php /src/testcase/output rtTestOutputWriterXML.php /src/testgroup rtPhpTestGroup.php
g2 Mon Jun 29 22:00:13 2009 UTC Modified files: /phpruntests/src/testcase/outputrtTestOutputWriterXML.php /phpruntests/src/testgroup rtPhpTestGroup.php /phpruntests/src/taskScheduler rtTaskSchedulerFile.php rtTaskTestGroup.php Log: phpruntests - update taskScheduler - fixed out-of-memory-bug while running large tests http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterXML.php?r1=1.4&r2=1.5&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterXML.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.4 phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.5 --- phpruntests/src/testcase/output/rtTestOutputWriterXML.php:1.4 Mon Jun 29 01:34:54 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterXML.php Mon Jun 29 22:00:12 2009 @@ -52,10 +52,8 @@ /** - * - * +* * @param array of rtTestResults - * */ public function init (array $testResults) { @@ -103,5 +101,6 @@ return null; } + } -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/phpruntests/src/testgroup/rtPhpTestGroup.php?r1=1.11&r2=1.12&diff_format=u Index: phpruntests/src/testgroup/rtPhpTestGroup.php diff -u phpruntests/src/testgroup/rtPhpTestGroup.php:1.11 phpruntests/src/testgroup/rtPhpTestGroup.php:1.12 --- phpruntests/src/testgroup/rtPhpTestGroup.php:1.11 Mon Jun 29 01:34:54 2009 +++ phpruntests/src/testgroup/rtPhpTestGroup.phpMon Jun 29 22:00:13 2009 @@ -75,5 +75,12 @@ $testOutputWriter = rtTestOutputWriter::getInstance($this->results, $outType); $testOutputWriter->write($this->testDirectory, $cid); } + + +public function getResults() +{ + return $this->results; +} + } ?> http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskSchedulerFile.php?r1=1.3&r2=1.4&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskSchedulerFile.php diff -u phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.3 phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.4 --- phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.3 Mon Jun 29 01:34:54 2009 +++ phpruntests/src/taskScheduler/rtTaskSchedulerFile.php Mon Jun 29 22:00:13 2009 @@ -17,11 +17,9 @@ { const TMP_FILE = 'taskFile'; - private $inputQueue = NULL; // the input-queue (only used by the sender) private $pidStore = array();// stores the pids of all child-processes private $groupTasks = false;// are the tasks stored in groups? - - private $tmpTaskList = array(); + /** * the constructor @@ -59,8 +57,6 @@ $this->taskList = $taskList; } - - /** * sets the number of child-processes. * in the case of using a multidimensional task-list this parameter is @@ -76,7 +72,6 @@ } } - /** * starts the sender, the receiver and forks the defined @@ -98,8 +93,8 @@ $this->processCount = sizeof($this->taskList); } + // distribute the task to the children $this->createTaskFiles(); - // fork the child-processes for ($i=0; $i<$this->processCount; $i++) { @@ -126,7 +121,7 @@ pcntl_waitpid($this->pidStore[$i], $status); } - // ensure that the tmp-files are completly written + // ensure that the tmp-files are completely written sleep(1); // collecting the results @@ -137,8 +132,7 @@ return; } - - + /** * creates a temporary file for each child which stores the allocated @@ -180,8 +174,9 @@ } - /** +* +* * @return void */ private function receiver() @@ -202,7 +197,7 @@ } $index = $task->getIndex(); - $task->finish($cid); + $task->evaluate($cid); if ($this->groupTasks == true) { @@ -219,10 +214,12 @@ return; } - /** +* executes the assigned tasks and stores the serialized task-object in +* the task-file. +* * @param int $cidthe child-id * @return void */ @@ -231,24 +228,26 @@ $indexList = file_get_contents(self::TMP_FILE.$cid); $indexList = explode(';', $indexList);
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTask.php rtTaskTestGroup.php /src/testrun rtPhpTestRun.php /tests rtTaskSchedulerTest.php
g2 Tue Jun 30 15:39:52 2009 UTC Modified files: /phpruntests/src/testrunrtPhpTestRun.php /phpruntests/src/taskScheduler rtTask.php rtTaskTestGroup.php /phpruntests/tests rtTaskSchedulerTest.php Log: phpruntests - minor adjustment taskScheduler - fixed tmp bug in testcase http://cvs.php.net/viewvc.cgi/phpruntests/src/testrun/rtPhpTestRun.php?r1=1.16&r2=1.17&diff_format=u Index: phpruntests/src/testrun/rtPhpTestRun.php diff -u phpruntests/src/testrun/rtPhpTestRun.php:1.16 phpruntests/src/testrun/rtPhpTestRun.php:1.17 --- phpruntests/src/testrun/rtPhpTestRun.php:1.16 Tue Jun 30 13:35:42 2009 +++ phpruntests/src/testrun/rtPhpTestRun.phpTue Jun 30 15:39:51 2009 @@ -62,9 +62,8 @@ // create the task-list $taskList = array(); foreach ($subDirectories as $subDirectory) { - $taskList[] = new rtTaskTestGroup($runConfiguration, $subDirectory); + $taskList[] = new rtTaskTestGroup($runConfiguration, $subDirectory, $this->outType); } - // start the task-scheduler for multi-processing $scheduler = rtTaskScheduler::getInstance(); http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTask.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/src/taskScheduler/rtTask.php diff -u phpruntests/src/taskScheduler/rtTask.php:1.2 phpruntests/src/taskScheduler/rtTask.php:1.3 --- phpruntests/src/taskScheduler/rtTask.php:1.2Mon Jun 29 01:34:54 2009 +++ phpruntests/src/taskScheduler/rtTask.phpTue Jun 30 15:39:52 2009 @@ -11,7 +11,7 @@ private $message = NULL; - public function finish() {} + public function evaluate() {} public function setState($state) http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskTestGroup.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskTestGroup.php diff -u phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.5 phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.6 --- phpruntests/src/taskScheduler/rtTaskTestGroup.php:1.5 Mon Jun 29 22:00:13 2009 +++ phpruntests/src/taskScheduler/rtTaskTestGroup.php Tue Jun 30 15:39:52 2009 @@ -15,13 +15,15 @@ { private $runConfiguration; private $subDirectory; + private $outType; private $results; - public function __construct($runConfiguration, $subDirectory) + public function __construct($runConfiguration, $subDirectory, $outType='list') { $this->runConfiguration = $runConfiguration; $this->subDirectory = $subDirectory; + $this->outType = $outType; } @@ -46,12 +48,7 @@ */ public function evaluate($cid=null) { - $outType = 'list'; -if ($this->runConfiguration->hasCommandLineOption('o')) { - $outType = $this->runConfiguration->getCommandLineOption('o'); -} - - $testOutputWriter = rtTestOutputWriter::getInstance($this->results, $outType); + $testOutputWriter = rtTestOutputWriter::getInstance($this->results, $this->outType); $testOutputWriter->write($this->subDirectory, $cid); } http://cvs.php.net/viewvc.cgi/phpruntests/tests/rtTaskSchedulerTest.php?r1=1.2&r2=1.3&diff_format=u Index: phpruntests/tests/rtTaskSchedulerTest.php diff -u phpruntests/tests/rtTaskSchedulerTest.php:1.2 phpruntests/tests/rtTaskSchedulerTest.php:1.3 --- phpruntests/tests/rtTaskSchedulerTest.php:1.2 Sat Jun 27 23:57:46 2009 +++ phpruntests/tests/rtTaskSchedulerTest.php Tue Jun 30 15:39:52 2009 @@ -57,7 +57,10 @@ public function getNumber() { return $this->num; - } + } + + // temp - remove this function + public function getDir() {} } ?> \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src run-tests.php /src/configuration rtCommandLineOptions.php /src/taskScheduler rtTask.php rtTaskScheduler.php rtTaskSchedulerFile.php rtTaskTestGroup.php /src/testcase
g2 Sun Jul 5 20:51:16 2009 UTC Modified files: /phpruntests/src/testcase/outputrtTestOutputWriterList.php rtTestOutputWriterCSV.php rtTestOutputWriterXML.php /phpruntests/src/taskScheduler rtTaskScheduler.php rtTaskSchedulerFile.php rtTask.php rtTaskTestGroup.php /phpruntests/src/testcase rtTestResults.php rtTestOutputWriter.php rtTestStatus.php /phpruntests/tests rtTaskSchedulerTest.php /phpruntests/srcrun-tests.php /phpruntests/src/configuration rtCommandLineOptions.php /phpruntests/src/testrunrtPhpTestRun.php Log: phpruntests - rebuild outputWriter - added option to flush test-results during execution - minor adjustments taskScheduler http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterList.php?r1=1.6&r2=1.7&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterList.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.6 phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.7 --- phpruntests/src/testcase/output/rtTestOutputWriterList.php:1.6 Mon Jun 29 01:34:54 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterList.php Sun Jul 5 20:51:15 2009 @@ -2,12 +2,13 @@ /** * rtTestOutputWriterList * - * Write test output line by line to stdout + * Write test output line by line * * @category Testing * @packageRUNTESTS * @author Zoe Slattery * @author Stefan Priebsch + * @author Georg Gradwohl * @copyright 2009 The PHP Group * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ @@ -15,22 +16,15 @@ */ class rtTestOutputWriterList extends rtTestOutputWriter { -protected $testOutput = array(); - -public function __construct(array $testResults) +public function __construct() { -$this->init($testResults); + $this->type = 'txt'; } -/** - * - * - * @param array of rtTestResults - * - */ -public function init (array $testResults) + +public function createOutput() { -foreach ($testResults as $testResult) { +foreach ($this->resultList as $testResult) { $outputString = ""; $testStatus = $testResult->getStatus(); foreach($testStatus->getTestStateNames() as $name) { @@ -41,25 +35,9 @@ } $outputString .= " " . $testResult->getTitle(); $outputString .= " [" . $testResult->getName() . ".phpt]"; -$this->testOutput[] = $outputString; +$this->output .= $outputString."\n"; } } - -public function write($testDirectory = null, $cid = null) -{ -if ($testDirectory != null) { -echo "\n\nTest output for tests in " . $testDirectory . "\n"; -} -sort($this->testOutput); -foreach ($this->testOutput as $line) { - - if (!is_null($cid)) { - echo "$cid - "; - } - -echo $line ."\n"; -} -} } ?> http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/output/rtTestOutputWriterCSV.php?r1=1.3&r2=1.4&diff_format=u Index: phpruntests/src/testcase/output/rtTestOutputWriterCSV.php diff -u phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.3 phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.4 --- phpruntests/src/testcase/output/rtTestOutputWriterCSV.php:1.3 Tue Jun 30 13:36:49 2009 +++ phpruntests/src/testcase/output/rtTestOutputWriterCSV.php Sun Jul 5 20:51:15 2009 @@ -8,6 +8,7 @@ * @packageRUNTESTS * @author Zoe Slattery * @author Stefan Priebsch + * @author Georg Gradwohl * @copyright 2009 The PHP Group * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ @@ -15,22 +16,16 @@ */ class rtTestOutputWriterCSV extends rtTestOutputWriter { -protected $testOutput = array(); -public function __construct(array $testResults) +public function __construct() { -$this->init($testResults); +$this->type = 'csv'; } -/** - * - * - * @param array of rtTestResults - * - */ -public function init (array $testResults) + +public function createOutput() { -foreach ($testResults as $testResult) { +foreach ($this->resultList as $testResult) { $outputString = $testResult->getName(); $testStatus = $testResult->getStatus(); foreach
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskScheduler.php
g2 Mon Jul 6 09:20:20 2009 UTC Modified files: /phpruntests/src/taskScheduler rtTaskScheduler.php Log: phpruntests - minor bugfix http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskScheduler.php?r1=1.4&r2=1.5&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskScheduler.php diff -u phpruntests/src/taskScheduler/rtTaskScheduler.php:1.4 phpruntests/src/taskScheduler/rtTaskScheduler.php:1.5 --- phpruntests/src/taskScheduler/rtTaskScheduler.php:1.4 Sun Jul 5 20:51:15 2009 +++ phpruntests/src/taskScheduler/rtTaskScheduler.php Mon Jul 6 09:20:20 2009 @@ -131,7 +131,7 @@ $task->run(); $results = $task->getResult(); rtTestOutputWriter::flushResult($results, $this->reportStatus); - $this->resultList = array_merge($this->resultList, $resultList); + $this->resultList = array_merge($this->resultList, $results); } return; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src/configuration rtCommandLineOptions.php /src/testcase rtTestOutputWriter.php /src/testrun rtPhpTestRun.php
g2 Mon Jul 6 20:35:54 2009 UTC Modified files: /phpruntests/src/configuration rtCommandLineOptions.php /phpruntests/src/testrunrtPhpTestRun.php /phpruntests/src/testcase rtTestOutputWriter.php Log: phpruntests - update outputWriter, adjusted command-line-arguments http://cvs.php.net/viewvc.cgi/phpruntests/src/configuration/rtCommandLineOptions.php?r1=1.8&r2=1.9&diff_format=u Index: phpruntests/src/configuration/rtCommandLineOptions.php diff -u phpruntests/src/configuration/rtCommandLineOptions.php:1.8 phpruntests/src/configuration/rtCommandLineOptions.php:1.9 --- phpruntests/src/configuration/rtCommandLineOptions.php:1.8 Sun Jul 5 20:51:16 2009 +++ phpruntests/src/configuration/rtCommandLineOptions.php Mon Jul 6 20:35:53 2009 @@ -23,7 +23,7 @@ 'm', 'q', 'x', -'v', +'v', // verbose-mode level 1 'h', ); @@ -38,17 +38,17 @@ 'c', 'd', 'p', -'s', -'o', //new for output type (list, xml, csv...) - 'z', //parallel - run out of obvious letters - 'g', // flushing report durring test-execution +'s', // save - defines the filename to store the results +'o', // output type (list, xml, csv...) + 'z', // parallel - run out of obvious letters ); /** * @var array */ protected $longOptions = array( -'verbose', +'vv', // verbose-mode level 2 + 'vvv', // verbose-mode level 3 'help', 'keep-all', 'keep-php', http://cvs.php.net/viewvc.cgi/phpruntests/src/testrun/rtPhpTestRun.php?r1=1.20&r2=1.21&diff_format=u Index: phpruntests/src/testrun/rtPhpTestRun.php diff -u phpruntests/src/testrun/rtPhpTestRun.php:1.20 phpruntests/src/testrun/rtPhpTestRun.php:1.21 --- phpruntests/src/testrun/rtPhpTestRun.php:1.20 Sun Jul 5 20:51:16 2009 +++ phpruntests/src/testrun/rtPhpTestRun.phpMon Jul 6 20:35:54 2009 @@ -63,15 +63,14 @@ } } -// check for the cmd-line-option 'g' which defines the report-status +// check for the cmd-line-option 'v' which defines the report-status $reportStatus = 0; -if ($runConfiguration->hasCommandLineOption('g')) { - - $reportStatus = $runConfiguration->getCommandLineOption('g'); - - if (!is_numeric($reportStatus) || $processCount < 0) { - $reportStatus = 1; - } +if ($runConfiguration->hasCommandLineOption('v')) { + $reportStatus = 1; +} else if ($runConfiguration->hasCommandLineOption('vv')) { + $reportStatus = 2; +} else if ($runConfiguration->hasCommandLineOption('vvv')) { + $reportStatus = 3; } // create the task-list @@ -98,9 +97,14 @@ $outputWriter = rtTestOutputWriter::getInstance($type); $outputWriter->setResultList($resultList); $outputWriter->printOverview(sizeof($taskList), $scheduler->getProcessCount()); + + $filename = null; + if ($runConfiguration->hasCommandLineOption('s')) { + $filename = $runConfiguration->getCommandLineOption('s'); + } - if ($runConfiguration->hasCommandLineOption('o')) { - $outputWriter->write(); + if ($type || $filename) { + $outputWriter->write($filename); } } else { http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtTestOutputWriter.php?r1=1.7&r2=1.8&diff_format=u Index: phpruntests/src/testcase/rtTestOutputWriter.php diff -u phpruntests/src/testcase/rtTestOutputWriter.php:1.7 phpruntests/src/testcase/rtTestOutputWriter.php:1.8 --- phpruntests/src/testcase/rtTestOutputWriter.php:1.7 Sun Jul 5 20:51:16 2009 +++ phpruntests/src/testcase/rtTestOutputWriter.php Mon Jul 6 20:35:54 2009 @@ -70,7 +70,7 @@ -public function write() +public function write($filename=null) { $this->createOutput(); @@ -80,10 +80,12 @@ mkdir(self::OUTPUT_DIR); } - $file = self::OUTPUT_DIR.'/results_'.microtime(true).'.'.$this->type; + if (is_null($filename)) { + $filename = self::OUTPUT_DIR.'/results_'.round(microtime(true)).'.'.$this->type; + } - if (file_put_contents($file, $this->output)) { - print "\nThe Test-Results were saved in <$file>\n"; + if (file_put_contents($filename, $this->output)) { + print "\nThe Test-Results were
[PHP-CVS] cvs: phpruntests /src/taskScheduler rtTaskSchedulerFile.php
g2 Wed Jul 8 19:35:39 2009 UTC Modified files: /phpruntests/src/taskScheduler rtTaskSchedulerFile.php Log: phpruntests - minor bugfix taskScheduler http://cvs.php.net/viewvc.cgi/phpruntests/src/taskScheduler/rtTaskSchedulerFile.php?r1=1.6&r2=1.7&diff_format=u Index: phpruntests/src/taskScheduler/rtTaskSchedulerFile.php diff -u phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.6 phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.7 --- phpruntests/src/taskScheduler/rtTaskSchedulerFile.php:1.6 Wed Jul 8 19:23:23 2009 +++ phpruntests/src/taskScheduler/rtTaskSchedulerFile.php Wed Jul 8 19:35:39 2009 @@ -116,9 +116,10 @@ // register signal-handler + /* pcntl_signal(SIGINT, "rtTaskSchedulerFile::signalHandler"); pcntl_signal(SIGQUIT, "rtTaskSchedulerFile::signalHandler"); - + */ // wait until all child-processes are terminated for ($i=0; $i<$this->processCount; $i++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: phpruntests /src rtClassMap.php rtException.php /src/taskScheduler rtTaskSchedulerFile.php /src/testcase rtPhpRunner.php /src/testcase/sections/executablesections rtCleanSection.php
g2 Wed Jul 8 19:23:23 2009 UTC Added files: /phpruntests/srcrtException.php Modified files: /phpruntests/srcrtClassMap.php /phpruntests/src/testcase/sections/executablesections rtCleanSection.php rtFileSection.php rtSkipIfSection.php /phpruntests/src/testcase rtPhpRunner.php /phpruntests/src/taskScheduler rtTaskSchedulerFile.php Log: phpruntests - moved rtException in root, replaced PhpRunnerException - added singal-handler to taskSchedulerFile http://cvs.php.net/viewvc.cgi/phpruntests/src/rtClassMap.php?r1=1.15&r2=1.16&diff_format=u Index: phpruntests/src/rtClassMap.php diff -u phpruntests/src/rtClassMap.php:1.15 phpruntests/src/rtClassMap.php:1.16 --- phpruntests/src/rtClassMap.php:1.15 Sun Jun 28 09:47:37 2009 +++ phpruntests/src/rtClassMap.php Wed Jul 8 19:23:23 2009 @@ -8,7 +8,6 @@ */ $rtClassMap = array( 'rtEnvironmentException' => 'configuration/exceptions/rtEnvironmentException.php', -'rtException' => 'configuration/exceptions/rtException.php', 'rtMissingArgumentException' => 'configuration/exceptions/rtMissingArgumentException.php', 'rtUnknownIniSettingException' => 'configuration/exceptions/rtUnknownIniSettingException.php', 'rtUnknownOptionException' => 'configuration/exceptions/rtUnknownOptionException.php', @@ -46,6 +45,7 @@ 'rtAutoload' => 'rtAutoload.php', 'rtClassMap' => 'rtClassMap.php', 'rtDirectoryList' => 'rtDirectoryList.php', +'rtException' => 'rtException.php', 'rtPhptFilterIterator' => 'rtPhptFilterIterator.php', 'rtText' => 'rtText.php', 'rtUtil' => 'rtUtil.php', @@ -55,7 +55,6 @@ 'rtTaskSchedulerFile' => 'taskScheduler/rtTaskSchedulerFile.php', 'rtTaskSchedulerMsgQ' => 'taskScheduler/rtTaskSchedulerMsgQ.php', 'rtTaskTestGroup' => 'taskScheduler/rtTaskTestGroup.php', -'rtCodeRunnerException'=> 'testcase/exceptions/rtCodeRunnerException.php', 'rtPhpRunnerException' => 'testcase/exceptions/rtPhpRunnerException.php', 'rtTestOutputWriterCSV'=> 'testcase/output/rtTestOutputWriterCSV.php', 'rtTestOutputWriterList' => 'testcase/output/rtTestOutputWriterList.php', http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtCleanSection.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtCleanSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtCleanSection.php:1.5 phpruntests/src/testcase/sections/executablesections/rtCleanSection.php:1.6 --- phpruntests/src/testcase/sections/executablesections/rtCleanSection.php:1.5 Tue Jun 2 19:12:08 2009 +++ phpruntests/src/testcase/sections/executablesections/rtCleanSection.php Wed Jul 8 19:23:23 2009 @@ -43,7 +43,7 @@ $testStatus->setMessage('fail_clean','Execution of clean section failed: '.trim($this->output) ); } -} catch (rtPhpRunnerException $e) { +} catch (rtException $e) { $testStatus->setTrue('fail_clean'); $testStatus->setMessage('fail_clean',$e->getMessage); } http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.13&r2=1.14&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.13 phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.14 --- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.13 Tue Jun 2 19:12:08 2009 +++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php Wed Jul 8 19:23:23 2009 @@ -67,7 +67,7 @@ } -} catch (rtPhpRunnerException $e) { +} catch (rtException $e) { $testStatus->setTrue('fail'); $testStatus->setMessage('fail', $e->getMessage() ); } http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtSkipIfSection.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/testcase/sections/executablesections/rtSkipIfSection.php diff -u phpruntests/src/testcase/sections/executablesections/rtSkipIfSection.php:1.5 phpruntests/src/testcase/sections/executablesections/r
[PHP-CVS] cvs: phpruntests /src/testcase rtPhpRunner.php
g2 Thu Jul 9 10:52:10 2009 UTC Modified files: /phpruntests/src/testcase rtPhpRunner.php Log: phpruntests - minor bugfix http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtPhpRunner.php?r1=1.4&r2=1.5&diff_format=u Index: phpruntests/src/testcase/rtPhpRunner.php diff -u phpruntests/src/testcase/rtPhpRunner.php:1.4 phpruntests/src/testcase/rtPhpRunner.php:1.5 --- phpruntests/src/testcase/rtPhpRunner.php:1.4Wed Jul 8 19:23:23 2009 +++ phpruntests/src/testcase/rtPhpRunner.phpThu Jul 9 10:52:10 2009 @@ -75,7 +75,7 @@ throw new rtException('The process running test code has timed out in rtPhpRunner'); } else if ($n > 0) { $counter++; - if ($counter > 10) { + if ($counter > 100) { proc_terminate($proc); throw new rtException('The process running test code has timed out in rtPhpRunner'); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/
g2 Tue, 14 Jul 2009 21:35:06 + URL: http://svn.php.net/viewvc?view=revision&revision=284084 Changed paths: U php/phpruntests/trunk/src/run-tests.php Log: commit-test svn Modified: php/phpruntests/trunk/src/run-tests.php === --- php/phpruntests/trunk/src/run-tests.php 2009-07-14 19:05:52 UTC (rev 284083) +++ php/phpruntests/trunk/src/run-tests.php 2009-07-14 21:35:06 UTC (rev 284084) @@ -20,6 +20,7 @@ + /* * check the version of the running php-executable and * ensure that is 5.3 or higher -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/taskScheduler/
g2 Wed, 15 Jul 2009 20:59:08 + URL: http://svn.php.net/viewvc?view=revision&revision=284147 Changed paths: U php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php Log: minor bugifx to avoid warning Modified: php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php === --- php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php 2009-07-15 19:16:58 UTC (rev 284146) +++ php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php 2009-07-15 20:59:08 UTC (rev 284147) @@ -21,6 +21,18 @@ private $groupTasks = false;// are the tasks stored in groups? + /** +* the signal-handler is called by the interrupt- or quit-signal. this is +* necessary to cleanup the tmp files and terminate the script correct. +* +* @param int $signal +*/ + public static function signalHandler($signal) + { + exit(0); + } + + /** * sets the task-list which has to be an array of task-objects. * it's also possible to use a multidimensional array. in this case the @@ -33,7 +45,7 @@ */ public function setTaskList(array $taskList) { - if (is_array($taskList[0])) { + if (isset($taskList[0]) && is_array($taskList[0])) { $this->groupTasks = true; $this->processCount = sizeof($taskList); } @@ -77,6 +89,7 @@ $this->processCount = sizeof($this->taskList); } + // distribute the task to the children $this->distributeTasks(); @@ -99,7 +112,12 @@ break; } } + + // register signal-handler + pcntl_signal(SIGINT, "rtTaskSchedulerFile::signalHandler"); + pcntl_signal(SIGQUIT, "rtTaskSchedulerFile::signalHandler"); + // wait until all child-processes are terminated for ($i=0; $i<$this->processCount; $i++) { pcntl_waitpid($this->pidStore[$i], $status); @@ -160,16 +178,16 @@ $response = explode("[END]", $response); array_pop($response); - foreach ($response as $resultList) { + foreach ($response as $testGroupResults) { - $resultList = unserialize($resultList); + $testGroupResults = unserialize($testGroupResults); - if ($resultList === false) { + if ($testGroupResults === false) { print "ERROR unserialize - receiver $cid\n"; continue; } - - $this->resultList = array_merge($this->resultList, $resultList); + + $this->resultList[] = $testGroupResults; } unlink(self::TMP_FILE.$cid); @@ -194,6 +212,8 @@ foreach ($taskList as $task) { + $s = microtime(true); + $task = unserialize($task); if ($task === false) { @@ -202,8 +222,15 @@ } $task->run(); + + $e = microtime(true); + $results = $task->getResult(); + if (isset($results[0]) && is_object($results[0])) { + $results[0]->setTime($e-$s); + } + rtTestOutputWriter::flushResult($results, $this->reportStatus, $cid); $response = serialize($results)."[END]"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/testcase/
g2 Wed, 15 Jul 2009 21:44:54 + URL: http://svn.php.net/viewvc?view=revision&revision=284148 Changed paths: U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php U php/phpruntests/trunk/src/testcase/rtTestOutputWriter.php U php/phpruntests/trunk/src/testcase/rtTestResults.php U php/phpruntests/trunk/src/testcase/rtTestStatus.php Log: update outputWriter - extended xml-output Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php 2009-07-15 20:59:08 UTC (rev 284147) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php 2009-07-15 21:44:54 UTC (rev 284148) @@ -25,16 +25,21 @@ public function createOutput() { -foreach ($this->resultList as $testResult) { -$outputString = $testResult->getName(); -$testStatus = $testResult->getStatus(); -foreach($testStatus->getTestStateNames() as $name) { -if($testStatus->getValue($name)) { -$outputString .= " , ". strtoupper($name); - -} -} -$this->output .= $outputString."\n"; + foreach ($this->resultList as $testGroupResults) { + + foreach ($testGroupResults as $testResult) { + + $outputString = $testResult->getName(); + $testStatus = $testResult->getStatus(); + + foreach($testStatus->getTestStateNames() as $name) { + + if($testStatus->getValue($name)) { + $outputString .= " , ". strtoupper($name); + } + } + $this->output .= $outputString."\n"; + } } } Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php 2009-07-15 20:59:08 UTC (rev 284147) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php 2009-07-15 21:44:54 UTC (rev 284148) @@ -24,20 +24,27 @@ public function createOutput() { -foreach ($this->resultList as $testResult) { -$outputString = ""; -$testStatus = $testResult->getStatus(); -foreach($testStatus->getTestStateNames() as $name) { -if($testStatus->getValue($name)) { -$outputString .= " ". strtoupper($name); -$outputString .= " " . $testStatus->getMessage($name); -} -} -$outputString .= " " . $testResult->getTitle(); -$outputString .= " [" . $testResult->getName() . ".phpt]"; -$this->output .= $outputString."\n"; +foreach ($this->resultList as $testGroupResults) { + + foreach ($testGroupResults as $testResult) { + + $outputString = ""; + $testStatus = $testResult->getStatus(); + + foreach($testStatus->getTestStateNames() as $name) { + + if ($testStatus->getValue($name)) { + $outputString .= " ". strtoupper($name); + $outputString .= " " . $testStatus->getMessage($name); + } + } + + $outputString .= " " . $testResult->getTitle(); + $outputString .= " [" . $testResult->getName() . ".phpt]"; + $this->output .= $outputString."\n"; + } } } } -?> +?> \ No newline at end of file Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php 2009-07-15 20:59:08 UTC (rev 284147) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php 2009-07-15 21:44:54 UTC (rev 284148) @@ -38,14 +38,97 @@ */ public function createOutput() { -foreach ($this->resultList as $result) { + $wdir = getcwd(); + + $global_state = array(); + $global_count = 0; + + foreach ($this->resultList as $testGroupResults) { + + // creat group-node + $groupNode = $this->dom->createElement('testgroup'); + $this->rootNode->appendChild($groupNode); - $test = $this->dom->createElement('testcase'); - $test->appendChild($this->dom->createElement('name', $result->getName())); - $test->appendChild($this->dom->createElement('status', $result->getStatus())); - $this->rootNode->appendChild($test); -} + $state = array(); + + foreach ($testGroupResults as $testResult) { + + // create test-node + $testNode = $
[PHP-CVS] svn: php/phpruntests/trunk/src/testcase/output/ rtTestOutputWriterHTML.php
g2 Thu, 16 Jul 2009 11:51:57 + URL: http://svn.php.net/viewvc?view=revision&revision=284182 Changed paths: A php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterHTML.php Log: added outputWriter html Added: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterHTML.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterHTML.php (rev 0) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterHTML.php 2009-07-16 11:51:57 UTC (rev 284182) @@ -0,0 +1,103 @@ + + * @author Stefan Priebsch + * @author Georg Gradwohl + * @copyright 2009 The PHP Group + * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://qa.php.net/ + * + */ +class rtTestOutputWriterHTML extends rtTestOutputWriter +{ + private $dom = null; + private $stage = null; // base-node which holds the content + + + public function __construct() + { + $this->type = 'html'; + + $docTitle = 'PHP RUN-TEST RESULTS'; + + // dom + $imp = new DOMImplementation(); + $dtd = $imp->createDocumentType("html", "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";); + $this->dom = $imp->createDocument("", "", $dtd); + + // html + $htmlNode = $this->dom->createElement('html'); + $this->dom->appendChild($htmlNode); + + // head + $headNode = $this->dom->createElement('head'); + $htmlNode->appendChild($headNode); + $headNode->appendChild($this->dom->createElement('title', $docTitle)); + + // body + $bodyNode = $this->dom->createElement('body'); + $htmlNode->appendChild($bodyNode); + + // stage + $this->stage = $this->dom->createElement('div'); + $this->stage->setAttribute('id', 'stage'); + $bodyNode->appendChild($this->stage); + + $this->stage->appendChild($this->dom->createElement('h1', $docTitle)); + } + + +public function createOutput() +{ +// table + $table = $this->dom->createElement('table'); + $this->stage->appendChild($table); + + // thead + $thead = $this->dom->createElement('thead'); + $table->appendChild($thead); + $tr = $this->dom->createElement('tr'); + $thead->appendChild($tr); + $tr->appendChild($this->dom->createElement('th', 'NAME')); + $tr->appendChild($this->dom->createElement('th', 'STATUS')); + + + foreach ($this->resultList as $testGroupResults) { + + $tbody = $this->dom->createElement('tbody'); + $table->appendChild($tbody); + + foreach ($testGroupResults as $testResult) { + + $tr = $this->dom->createElement('tr'); + $tbody->appendChild($tr); + + // name + $td = $this->dom->createElement('td', $testResult->getName()); + $td->setAttribute('class', 'mainCol'); + $tr->appendChild($td); + + // status + $status = $testResult->getStatus(); + $s = $status->__toString(); + + $td = $this->dom->createElement('td', strtoupper($s)); + $td->setAttribute('class', $s); + $tr->appendChild($td); + } +} + +$this->dom->encoding = 'UTF-8'; +$this->dom->formatOutput = true; + $this->dom->normalizeDocument(); +$this->output = $this->dom->saveXML(); +} + +} +?> \ No newline at end of file Property changes on: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterHTML.php ___ Added: svn:keywords + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/ rtClassMap.php testcase/output/rtTestOutputWriterXML.php
g2 Thu, 16 Jul 2009 11:52:29 + URL: http://svn.php.net/viewvc?view=revision&revision=284184 Changed paths: U php/phpruntests/trunk/src/rtClassMap.php U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php Log: added outputWriter html Modified: php/phpruntests/trunk/src/rtClassMap.php === --- php/phpruntests/trunk/src/rtClassMap.php2009-07-16 11:52:10 UTC (rev 284183) +++ php/phpruntests/trunk/src/rtClassMap.php2009-07-16 11:52:29 UTC (rev 284184) @@ -8,6 +8,7 @@ */ $rtClassMap = array( 'rtEnvironmentException' => 'configuration/exceptions/rtEnvironmentException.php', +'rtException' => 'configuration/exceptions/rtException.php', 'rtMissingArgumentException' => 'configuration/exceptions/rtMissingArgumentException.php', 'rtUnknownIniSettingException' => 'configuration/exceptions/rtUnknownIniSettingException.php', 'rtUnknownOptionException' => 'configuration/exceptions/rtUnknownOptionException.php', @@ -55,8 +56,10 @@ 'rtTaskSchedulerFile' => 'taskScheduler/rtTaskSchedulerFile.php', 'rtTaskSchedulerMsgQ' => 'taskScheduler/rtTaskSchedulerMsgQ.php', 'rtTaskTestGroup' => 'taskScheduler/rtTaskTestGroup.php', +'rtCodeRunnerException'=> 'testcase/exceptions/rtCodeRunnerException.php', 'rtPhpRunnerException' => 'testcase/exceptions/rtPhpRunnerException.php', 'rtTestOutputWriterCSV'=> 'testcase/output/rtTestOutputWriterCSV.php', +'rtTestOutputWriterHTML' => 'testcase/output/rtTestOutputWriterHTML.php', 'rtTestOutputWriterList' => 'testcase/output/rtTestOutputWriterList.php', 'rtTestOutputWriterXML'=> 'testcase/output/rtTestOutputWriterXML.php', 'rtHasMandatorySections' => 'testcase/preconditions/rtHasMandatorySections.php', Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php 2009-07-16 11:52:10 UTC (rev 284183) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterXML.php 2009-07-16 11:52:29 UTC (rev 284184) @@ -20,15 +20,13 @@ private $rootNode = null; - public function __construct() { - + public function __construct() + { $this->type = 'xml'; $this->dom = new DOMDocument(); $this->rootNode = $this->dom->createElement('RUNTESTS'); $this->dom->appendChild($this->rootNode); - - $this->stamp = round(microtime(true)); } @@ -127,15 +125,11 @@ } } + $this->dom->encoding = 'UTF-8'; $this->dom->formatOutput = true; $this->dom->normalizeDocument(); $this->output = $this->dom->saveXML(); } - - - - - } ?> \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/t askScheduler/rtTaskScheduler.php estcase/output/rtTestOutputWriterCSV.php estcase/output/rtTestOutputWriterList.php
g2 Mon, 20 Jul 2009 11:04:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=284429 Changed paths: U php/phpruntests/trunk/src/taskScheduler/rtTaskScheduler.php U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php U php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php Log: bugfix outputwriter Modified: php/phpruntests/trunk/src/taskScheduler/rtTaskScheduler.php === --- php/phpruntests/trunk/src/taskScheduler/rtTaskScheduler.php 2009-07-20 10:54:37 UTC (rev 284428) +++ php/phpruntests/trunk/src/taskScheduler/rtTaskScheduler.php 2009-07-20 11:04:48 UTC (rev 284429) @@ -131,7 +131,7 @@ $task->run(); $results = $task->getResult(); rtTestOutputWriter::flushResult($results, $this->reportStatus); - $this->resultList = array_merge($this->resultList, $results); + $this->resultList[] = $results; } return; Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php 2009-07-20 10:54:37 UTC (rev 284428) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterCSV.php 2009-07-20 11:04:48 UTC (rev 284429) @@ -25,16 +25,22 @@ public function createOutput() { - foreach ($this->resultList as $testResult) { + foreach ($this->resultList as $testGroupResults) { + + foreach ($testGroupResults as $testResult) { + $outputString = $testResult->getName(); $testStatus = $testResult->getStatus(); - foreach($testStatus->getTestStateNames() as $name) { + + foreach($testStatus->getTestStateNames() as $name) { + if($testStatus->getValue($name)) { $outputString .= " , ". strtoupper($name); } } $this->output .= $outputString."\n"; } +} } } Modified: php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php === --- php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php 2009-07-20 10:54:37 UTC (rev 284428) +++ php/phpruntests/trunk/src/testcase/output/rtTestOutputWriterList.php 2009-07-20 11:04:48 UTC (rev 284429) @@ -3,7 +3,7 @@ * rtTestOutputWriterList * * Write test output line by line - * + * * @category Testing * @packageRUNTESTS * @author Zoe Slattery @@ -12,32 +12,37 @@ * @copyright 2009 The PHP Group * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 * @link http://qa.php.net/ - * + * */ class rtTestOutputWriterList extends rtTestOutputWriter { public function __construct() { -$this->type = 'txt'; + $this->type = 'txt'; } - + public function createOutput() { -foreach ($this->resultList as $testResult) { -$outputString = ""; -$testStatus = $testResult->getStatus(); - -foreach($testStatus->getTestStateNames() as $name) { +foreach ($this->resultList as $testGroupResults) { + + foreach ($testGroupResults as $testResult) { -if ($testStatus->getValue($name)) { -$outputString .= " ". strtoupper($name); -$outputString .= " " . $testStatus->getMessage($name); -} -} -$outputString .= " " . $testResult->getTitle(); -$outputString .= " [" . $testResult->getName() . ".phpt]"; -$this->output .= $outputString."\n"; + $outputString = ""; + $testStatus = $testResult->getStatus(); + + foreach($testStatus->getTestStateNames() as $name) { + + if ($testStatus->getValue($name)) { + $outputString .= " ". strtoupper($name); + $outputString .= " " . $testStatus->getMessage($name); + } + } + + $outputString .= " " . $testResult->getTitle(); + $outputString .= " [" . $testResult->getName() . ".phpt]"; + $this->output .= $outputString."\n"; + } } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: php/phpruntests/trunk/src/testcase/ rtTestResults.php
g2 Mon, 20 Jul 2009 15:00:54 + Revision: http://svn.php.net/viewvc?view=revision&revision=284442 Changed paths: U php/phpruntests/trunk/src/testcase/rtTestResults.php Log: minor bugfix - ensure to request skip-section only if it exists Modified: php/phpruntests/trunk/src/testcase/rtTestResults.php === --- php/phpruntests/trunk/src/testcase/rtTestResults.php2009-07-20 14:51:04 UTC (rev 284441) +++ php/phpruntests/trunk/src/testcase/rtTestResults.php2009-07-20 15:00:54 UTC (rev 284442) @@ -134,7 +134,7 @@ { if ($runConfiguration->hasCommandLineOption('keep-all') || $runConfiguration->hasCommandLineOption('keep-skip')) { $this->savedFileNames['skipif'] = $this->testName. 'skipif.php'; -} else { +} else if($testCase->hasSection('SKIPIF')) { $skipSection = $testCase->getSection('SKIPIF'); $skipSection->deleteFile(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/phpruntests/trunk/src/testcase/ rtPhpTest.php rtTestOutputWriter.php rtTestStatus.php sections/executablesections/rtFileSection.php sections/executablesections/rtSkipIfSection.php
g2 Thu, 20 Aug 2009 21:08:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=287516 Log: update phpruntests - added php-command to verbose-output Changed paths: U php/phpruntests/trunk/src/testcase/rtPhpTest.php U php/phpruntests/trunk/src/testcase/rtTestOutputWriter.php U php/phpruntests/trunk/src/testcase/rtTestStatus.php U php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php U php/phpruntests/trunk/src/testcase/sections/executablesections/rtSkipIfSection.php U php/phpruntests/trunk/src/testcase/sections/rtExecutableSection.php Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php === --- php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-20 20:59:24 UTC (rev 287515) +++ php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-20 21:08:45 UTC (rev 287516) @@ -104,10 +104,13 @@ 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(); Modified: php/phpruntests/trunk/src/testcase/rtTestOutputWriter.php === --- php/phpruntests/trunk/src/testcase/rtTestOutputWriter.php 2009-08-20 20:59:24 UTC (rev 287515) +++ php/phpruntests/trunk/src/testcase/rtTestOutputWriter.php 2009-08-20 21:08:45 UTC (rev 287516) @@ -277,6 +277,11 @@ print "$t:\t$file\n"; } } + + $cmd = $s->getExecutedPhpCommand(); + if (!is_null($cmd)) { + print "PHP-COMMAND: $cmd\n"; + } } break; } Modified: php/phpruntests/trunk/src/testcase/rtTestStatus.php === --- php/phpruntests/trunk/src/testcase/rtTestStatus.php 2009-08-20 20:59:24 UTC (rev 287515) +++ php/phpruntests/trunk/src/testcase/rtTestStatus.php 2009-08-20 21:08:45 UTC (rev 287516) @@ -17,6 +17,7 @@ protected $testName; protected $states = array(); protected $messages = array(); +protected $executedPhpCommand; protected $testStateNames = array ('skip', 'bork', 'warn', @@ -73,6 +74,16 @@ { return $this->testName; } + +public function setExecutedPhpCommand($cmd) +{ + $this->executedPhpCommand = $cmd; +} + +public function getExecutedPhpCommand() +{ + return $this->executedPhpCommand; +} public function __toString() { Modified: php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php === --- php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php 2009-08-20 20:59:24 UTC (rev 287515) +++ php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php 2009-08-20 21:08:45 UTC (rev 287516) @@ -52,6 +52,7 @@ $phpCommand .= ' '.$testCase->testConfiguration->getTestCommandLineArguments(); $phpCommand .= ' 2>&1 '.$testCase->testConfiguration->getInputFileString(); +$this->phpCommand = $phpCommand; $PhpRunner = new rtPhpRunner($phpCommand, $testCase->testConfiguration->getEnvironmentVariables(), @@ -100,14 +101,17 @@ } -public function deleteMemFile() { +public function deleteMemFile() +{ @unlink($this->memFileName); } -public function getMemFileName() { +public function getMemFileName() +{ return $this->memFileName; } + } ?> Modified: php/phpruntests/trunk/src/testcase/sections/executablesections/rtSkipIfSection.php === --- php/phpruntests/trunk/src/testcase/sections/executablesections/rtSkipIfSection.php 2009-08-20 20:59:24 UTC (rev 287515) +++ php/phpruntests/trunk/src/testcase/sections/executablesections/rtSkipIfSection.php 2009-08-20 2
[PHP-CVS] svn: /php/phpruntests/trunk/ src/configuration/rtEnvironmentVariables.php src/configuration/rtRuntestsConfiguration.php src/configuration/unix/rtUnixConfiguration.php src/configuration/unix/
g2 Fri, 28 Aug 2009 22:31:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=287869 Log: added os-check and env-var 'SystemRoot' for windows Changed paths: U php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php U php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php U php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php U php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php U php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php U php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php U php/phpruntests/trunk/src/testrun/rtPhpTestRun.php U php/phpruntests/trunk/tests/configuration/rtEnvironmentVariablesTest.php Modified: php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php === --- php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/rtEnvironmentVariables.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -33,10 +33,10 @@ protected $environmentVariables = array(); -public function __construct() -{ -} + +protected function __construct() {} + static public function getInstance ($os = 'Unix') { if ($os == 'Windows') { @@ -57,7 +57,6 @@ $this->environmentVariables[$variable] = getenv($variable); } } - } public function setVariable($var,$value) Modified: php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php === --- php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/rtRuntestsConfiguration.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -22,6 +22,7 @@ protected $settings; protected $environmentVariables; protected $commandLine; +protected $operatingSystem; protected $memoryTool = null; @@ -58,7 +59,7 @@ $this->commandLine->parse($this->commandLineArgs); //create object to hold environment variables -$this->environmentVariables = rtEnvironmentVariables::getInstance(); +$this->environmentVariables = rtEnvironmentVariables::getInstance($this->operatingSystem); } /** Modified: php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php === --- php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/unix/rtUnixConfiguration.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -17,7 +17,8 @@ { public function __construct($cmdlineArgs) { -$this->commandLineArgs = $cmdlineArgs; +$this->operatingSystem = 'Unix'; + $this->commandLineArgs = $cmdlineArgs; $this->init(); } Modified: php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php === --- php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/unix/rtUnixEnvironmentVariables.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -19,7 +19,7 @@ * Adapts the environment to Unix * */ -public function adaptEnvironment() +public function __construct() { array_push($this->userSuppliedVariables, 'TEST_PHP_PARALLEL'); } Modified: php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php === --- php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/windows/rtWinConfiguration.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -17,7 +17,8 @@ { public function __construct($cmdlineArgs) { -$this->commandLineArgs = $cmdlineArgs; +$this->operatingSystem = 'Windows'; + $this->commandLineArgs = $cmdlineArgs; $this->init(); } Modified: php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php === --- php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php 2009-08-28 22:09:11 UTC (rev 287868) +++ php/phpruntests/trunk/src/configuration/windows/rtWinEnvironmentVariables.php 2009-08-28 22:31:24 UTC (rev 287869) @@ -19,9 +19,9 @@ * Adapts the environment variables for Windows * */ -public function adaptEnvironment() +public function __construct() { -array_
[PHP-CVS] svn: /php/phpruntests/trunk/src/ configuration/rtCommandLineOptions.php configuration/unix/rtUnixSettingList.php configuration/windows/rtWinSettingList.php rtClassMap.php texts/help.txt
g2 Thu, 03 Sep 2009 18:15:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=287997 Log: updated commandline-options and help-file, removed unused classes Changed paths: D php/phpruntests/trunk/src/configuration/exceptions/ U php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php D php/phpruntests/trunk/src/configuration/unix/rtUnixSettingList.php D php/phpruntests/trunk/src/configuration/windows/rtWinSettingList.php U php/phpruntests/trunk/src/rtClassMap.php D php/phpruntests/trunk/src/testcase/exceptions/ U php/phpruntests/trunk/src/texts/help.txt Modified: php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php === --- php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php 2009-09-03 15:55:39 UTC (rev 287996) +++ php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php 2009-09-03 18:15:48 UTC (rev 287997) @@ -19,62 +19,46 @@ * @var array */ protected $shortOptions = array( -'n', -'m', -'q', -'x', +'n', // pass -n option to the php binary +'m', // memory-check (valgrind) +'q', // quiet, no user interaction 'v', // verbose-mode level 1 -'h', +'h', // help ); /** * @var array */ protected $shortOptionsWithArgs = array( -'l', -'r', -'w', -'a', -'c', -'d', -'p', -'s', // save - defines the filename to store the results -'o', // output type (list, xml, csv...) - 'z', // parallel - run out of obvious letters +'c', // look for php.ini +'d', // pass option to the php binary +'p', // specify php executable +'s', // save - defines the filename to store the results +'o', // output type (list, xml, csv...) + 'z', // parallel - run out of obvious letters ); /** * @var array */ protected $longOptions = array( -'vv', // verbose-mode level 2 - 'vvv', // verbose-mode level 3 -'help', -'keep-all', -'keep-php', -'keep-skip', -'keep-clean', -'keep-out', -'keep-exp', -'show-all', -'show-php', -'show-skip', -'show-clean', -'show-exp', -'show-diff', -'show-out', -'no-clean', +'vv', // verbose-mode level 2 + 'vvv', // verbose-mode level 3 +'help', // help +'keep-all', // keep all files +'keep-php', // keep only php files +'keep-skip', // keep only skip files +'keep-clean', // keep only clean files +'keep-out', // keep only out files +'keep-exp', // keep only exp files +'no-clean', // do not execute clean section ); /** * @var array */ protected $longOptionsWithArgs = array( -'html', -'temp-source', -'temp-target', -'set-timeout', -'mopts', +'mopts', // memory-options (valgrind) ); /** Deleted: php/phpruntests/trunk/src/configuration/unix/rtUnixSettingList.php === --- php/phpruntests/trunk/src/configuration/unix/rtUnixSettingList.php 2009-09-03 15:55:39 UTC (rev 287996) +++ php/phpruntests/trunk/src/configuration/unix/rtUnixSettingList.php 2009-09-03 18:15:48 UTC (rev 287997) @@ -1,26 +0,0 @@ - - * @author Stefan Priebsch - * @copyright 2009 The PHP Group - * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://qa.php.net/ - * - */ -class rtUnixSettingList extends rtSettingList -{ -/** - * Adapt the list of settings for things that only need to be set on Unix - * - */ -public function adaptList() -{ -} -} -?> Deleted: php/phpruntests/trunk/src/configuration/windows/rtWinSettingList.php === --- php/phpruntests/trunk/src/configuration/windows/rtWinSettingList.php 2009-09-03 15:55:39 UTC (rev 287996) +++ php/phpruntests/trunk/src/configuration/windows/rtWinSettingList.php 2009-09-03 18:15:48 UTC (rev 287997) @@ -1,26 +0,0 @@ - - * @author Stefan Priebsch - * @copyright 2009 The PHP Group - * @licensehttp://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://qa.php.net/ - * - */ -class rtWinSettingList extends rtSettingList -{ -/** - * Adapt the list to include things that only need to be set on Windows - * - */ -public function adaptList() -{ -} -} -?> Modified: php/phpruntests/trunk/src/rtClassMap.php === --- php/phpruntests/trunk/src/rtClassMap.php 2009-09-03 15:55:39 UTC (rev 287996) +++ php/phpruntests/trunk/src/rtClassMap.ph
[PHP-CVS] svn: /php/phpruntests/trunk/ src/configuration/rtCommandLineOptions.php src/texts/help.txt tests/configuration/rtCommandLineOptionsTest.php
g2 Thu, 03 Sep 2009 18:40:09 + Revision: http://svn.php.net/viewvc?view=revision&revision=287999 Log: updated commandline-options and testcase Changed paths: U php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php U php/phpruntests/trunk/src/texts/help.txt U php/phpruntests/trunk/tests/configuration/rtCommandLineOptionsTest.php Modified: php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php === --- php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php 2009-09-03 18:32:37 UTC (rev 287998) +++ php/phpruntests/trunk/src/configuration/rtCommandLineOptions.php 2009-09-03 18:40:09 UTC (rev 287999) @@ -30,6 +30,8 @@ * @var array */ protected $shortOptionsWithArgs = array( +'l', // read the testfiles to be executed from +'r', // read the testfiles to be executed from 'c', // look for php.ini 'd', // pass option to the php binary 'p', // specify php executable Modified: php/phpruntests/trunk/src/texts/help.txt === --- php/phpruntests/trunk/src/texts/help.txt2009-09-03 18:32:37 UTC (rev 287998) +++ php/phpruntests/trunk/src/texts/help.txt2009-09-03 18:40:09 UTC (rev 287999) @@ -1,4 +1,3 @@ - Synopsis: php run-tests.php [options] [files] [directories] @@ -24,7 +23,14 @@ -o Output format (default=list) -s Write output to + +-lRead the testfiles to be executed from . After the test +has finished all failed tests are written to the same . +If the list is empty and no further test is specified then +all tests are executed (same as: -r -w ). +-rRead the testfiles to be executed from . + -v verbose-mode level 1 basic information, test-name and status Modified: php/phpruntests/trunk/tests/configuration/rtCommandLineOptionsTest.php === --- php/phpruntests/trunk/tests/configuration/rtCommandLineOptionsTest.php 2009-09-03 18:32:37 UTC (rev 287998) +++ php/phpruntests/trunk/tests/configuration/rtCommandLineOptionsTest.php 2009-09-03 18:40:09 UTC (rev 287999) @@ -33,19 +33,19 @@ public function testShortOptionWithArg() { $clo = new rtCommandLineOptions(); -$clo->parse(array('run-tests.php', '-l', 'the-l-arg')); +$clo->parse(array('run-tests.php', '-d', 'the-d-arg')); -$this->assertTrue($clo->hasOption('l')); -$this->assertEquals('the-l-arg', $clo->getOption('l')); +$this->assertTrue($clo->hasOption('d')); +$this->assertEquals('the-d-arg', $clo->getOption('d')); } public function testLongOptionWithArg() { $clo = new rtCommandLineOptions(); -$clo->parse(array('run-tests.php', '--html', 'the-html-arg')); +$clo->parse(array('run-tests.php', '--keep-all', 'the-keepall-arg')); -$this->assertTrue($clo->hasOption('html')); -$this->assertEquals('the-html-arg', $clo->getOption('html')); +$this->assertTrue($clo->hasOption('keep-all')); +$this->assertEquals('the-keepall-arg', $clo->getOption('keep-all')); } public function testNonexistingOption() @@ -63,8 +63,8 @@ public function testMissingShortOptionArgument() { $clo = new rtCommandLineOptions(); -$clo->parse(array('run-tests.php', '-l')); -$clo->getOption('l'); +$clo->parse(array('run-tests.php', '-d')); +$clo->getOption('d'); } /** @@ -73,8 +73,8 @@ public function testMissingLongOptionArgument() { $clo = new rtCommandLineOptions(); -$clo->parse(array('run-tests.php', '--html')); -$clo->getOption('html'); +$clo->parse(array('run-tests.php', '--mopts')); +$clo->getOption('--mopts'); } public function testFileArgument() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php