zoe Wed, 15 Jul 2009 10:35:04 +
URL: http://svn.php.net/viewvc?view=revisionrevision=284111
Changed paths:
U php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php
U php/phpruntests/trunk/src/testcase/rtPhpRunner.php
U php/phpruntests/trunk/src/testcase/rtPhpTest.php
U php/phpruntests/trunk/src/testcase/rtPhpTestFile.php
U
php/phpruntests/trunk/src/testcase/sections/executablesections/rtCleanSection.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/testgroup/rtPhpTestGroup.php
U php/phpruntests/trunk/src/testrun/rtPhpTestRun.php
Log:
Fixing the parser to deal with empty sections
Modified: php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php
===
--- php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php 2009-07-15 10:17:04 UTC (rev 284110)
+++ php/phpruntests/trunk/src/taskScheduler/rtTaskSchedulerFile.php 2009-07-15 10:35:04 UTC (rev 284111)
@@ -21,18 +21,6 @@
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
@@ -88,9 +76,7 @@
if ($this-processCount sizeof($this-taskList)) {
$this-processCount = sizeof($this-taskList);
}
-
-
// distribute the task to the children
$this-distributeTasks();
@@ -113,14 +99,7 @@
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);
@@ -195,8 +174,6 @@
unlink(self::TMP_FILE.$cid);
}
-
- $this-pidStore = array();
}
Modified: php/phpruntests/trunk/src/testcase/rtPhpRunner.php
===
--- php/phpruntests/trunk/src/testcase/rtPhpRunner.php 2009-07-15 10:17:04 UTC (rev 284110)
+++ php/phpruntests/trunk/src/testcase/rtPhpRunner.php 2009-07-15 10:35:04 UTC (rev 284111)
@@ -58,8 +58,6 @@
fclose($pipes[0]);
-$counter = 0;
-
while (true) {
/* hide errors from interrupted syscalls */
$r = $pipes;
@@ -69,19 +67,14 @@
$n = @stream_select($r, $w, $e, $this-timeOut);
if ($n === false) {
-throw new rtException('Stream select failure in rtPhpRunner');
+throw new rtPhpRunnerException('Stream select failure in rtPhpRunner');
} else if ($n === 0) {
proc_terminate($proc);
-throw new rtException('The process running test code has timed out in rtPhpRunner');
+throw new rtPhpRunnerException ('The process running test code has timed out in rtPhpRunner');
} else if ($n 0) {
- $counter++;
- if ($counter 100) {
- proc_terminate($proc);
- throw new rtException('The process running test code has timed out in rtPhpRunner');
- }
- $line = fread($pipes[1], 8192);
+$line = fread($pipes[1], 8192);
if (strlen($line) == 0) {
-// EOF
+/* EOF */
break;
}
$data .= (binary) $line;
Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php
===
--- php/phpruntests/trunk/src/testcase/rtPhpTest.php 2009-07-15 10:17:04 UTC (rev 284110)
+++ php/phpruntests/trunk/src/testcase/rtPhpTest.php 2009-07-15 10:35:04 UTC (rev 284111)
@@ -42,7 +42,7 @@
{
$lastSection = end($this-sectionHeadings);
$start=0;
-
+
foreach($this-sectionHeadings as $keyNumber = $sectionKey) {
if($keyNumber count($this-sectionHeadings) - 1) {
@@ -53,9 +53,9 @@
for($index=$start; $indexcount($this-contents); $index++)
if($this-contents[$index] == --.$sectionKey.--) {
//Found the beginning of the section
-
+
for($contentsLine=$index + 1; $contentsLinecount($this-contents); $contentsLine ++) {
-
+
if( ($this-contents[$contentsLine] == --.$nextKey.--) || ($contentsLine == count($this-contents))) {
//Found the end