[PHP-CVS] svn: /php/phpruntests/trunk/src/testcase/ rtPhpTest.php rtTestOutputWriter.php rtTestStatus.php sections/executablesections/rtFileSection.php sections/executablesections/rtSkipIfSection.php

2009-08-20 Thread Georg Gradwohl
g2   Thu, 20 Aug 2009 21:08:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 .= ' 21 
'.$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 21:08:45 UTC (rev 287516)
@@ -39,6 +39,8 @@

[PHP-CVS] svn: /php/phpruntests/trunk/src/testcase/ rtPhpTest.php rtTestResults.php rtTestStatus.php sections/executablesections/rtFileSection.php

2009-08-08 Thread Zoe Slattery
zoe  Sat, 08 Aug 2009 20:22:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=286934

Log:
reworked valgrind support to be a little more in line with run-tests.php

Changed paths:
U   php/phpruntests/trunk/src/testcase/rtPhpTest.php
U   php/phpruntests/trunk/src/testcase/rtTestResults.php
U   php/phpruntests/trunk/src/testcase/rtTestStatus.php
U   
php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php

Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php
===
--- php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-08 20:11:30 UTC 
(rev 286933)
+++ php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-08 20:22:39 UTC 
(rev 286934)
@@ -79,8 +79,6 @@
 //Identify the file and expect section types
 $this-fileSection = $this-setFileSection();
 $this-expectSection = $this-setExpectSection();
-$this-fileSection-setExecutableFileName($this-getName());
-
 }



Modified: php/phpruntests/trunk/src/testcase/rtTestResults.php
===
--- php/phpruntests/trunk/src/testcase/rtTestResults.php2009-08-08 
20:11:30 UTC (rev 286933)
+++ php/phpruntests/trunk/src/testcase/rtTestResults.php2009-08-08 
20:22:39 UTC (rev 286934)
@@ -113,6 +113,10 @@
 $testCase-getSection('SKIPIF')-deleteFile();
 }

+if($testCase-getStatus()-getValue('leak') == true) {
+$this-savedFileNames['mem'] = 
$testCase-getSection('FILE')-getMemFileName();
+}
+
 }

 protected function onFail(rtPhpTest $testCase)
@@ -146,6 +150,10 @@
 if ($testCase-hasSection('SKIPIF')) {
 $this-savedFileNames['skipif'] = $this-testName. 'skipif.php';
 }
+
+if($testCase-getStatus()-getValue('leak') == true) {
+$this-savedFileNames['mem'] = 
$testCase-getSection('FILE')-getMemFileName();
+}
 }

 protected function onSkip(rtPhpTest $testCase, rtRuntestsConfiguration 
$runConfiguration)
@@ -153,10 +161,10 @@
 if ($runConfiguration-hasCommandLineOption('keep-all') || 
$runConfiguration-hasCommandLineOption('keep-skip')) {
 $this-savedFileNames['skipif'] = $this-testName. 'skipif.php';
 } else if($testCase-hasSection('SKIPIF')) {
-$skipSection = $testCase-getSection('SKIPIF');
-$skipSection-deleteFile();
+$testCase-getSection('SKIPIF')-deleteFile();
 }

+//TODO I think this can go? Have since updated code to BORK on finding 
blank sections
 //It may seem odd to check for an XFAIL if we are skipping the test, 
on the other hand I found
 //a few windows tests with blank XFAIL sections and wanted to know 
about those.

@@ -166,6 +174,8 @@
 }
 }

+
+
 public function getStatus()
 {
 return $this-testStatus;

Modified: php/phpruntests/trunk/src/testcase/rtTestStatus.php
===
--- php/phpruntests/trunk/src/testcase/rtTestStatus.php 2009-08-08 20:11:30 UTC 
(rev 286933)
+++ php/phpruntests/trunk/src/testcase/rtTestStatus.php 2009-08-08 20:22:39 UTC 
(rev 286934)
@@ -27,6 +27,7 @@
 'fail_skip',
 'fail_headers',
 'pass_headers',
+'leak',
 );

 public function __construct($testName)

Modified: 
php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php
===
--- 
php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php
2009-08-08 20:11:30 UTC (rev 286933)
+++ 
php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php
2009-08-08 20:22:39 UTC (rev 286934)
@@ -18,13 +18,9 @@
 protected $headers;
 protected $memFileName;

-public function setExecutableFileName($testName)
-{
-$this-fileName = $testName . .php;
-$this-memFileName = $testName . .mem;
-}
-
 protected function init() {
+$this-fileName = $this-testName . .php;
+$this-memFileName = $this-testName . .mem;
 }

 public function run(rtPhpTest $testCase, rtRuntestsConfiguration 
$runConfiguration)
@@ -83,6 +79,15 @@
 $testStatus-setMessage('fail', $e-getMessage() );
 }

+
+if($runConfiguration-hasMemoryTool()) {
+if(filesize($this-memFileName)  0) {
+$testStatus-setTrue('leak');
+} else {
+$this-deleteMemFile();
+}
+}
+
 return $testStatus;
 }

@@ -99,5 +104,10 @@
 @unlink($this-memFileName);
 }

+
+public function getMemFileName() {
+return $this-memFileName;
+}
+
 }
 ?

-- 

[PHP-CVS] svn: /php/phpruntests/trunk/src/testcase/ rtPhpTest.php rtTestResults.php sections/configurationsections/rtDeflatePostSection.php sections/configurationsections/rtGzipPostSection.php section

2009-08-04 Thread Zoe Slattery
zoe  Tue, 04 Aug 2009 21:46:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=286820

Log:
Change to the way POST section files are created

Changed paths:
U   php/phpruntests/trunk/src/testcase/rtPhpTest.php
U   php/phpruntests/trunk/src/testcase/rtTestResults.php
U   
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php
U   
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php
U   
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php
U   
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php
U   php/phpruntests/trunk/src/testcase/sections/rtSection.php

Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php
===
--- php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-04 21:43:16 UTC 
(rev 286819)
+++ php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-08-04 21:46:19 UTC 
(rev 286820)
@@ -62,7 +62,7 @@
 if($this-isFileSection($sectionKey)) {
 $tempArray = $this-removeDone($tempArray);
 }
-$testSection = rtSection::getInstance($sectionKey, 
$tempArray);
+$testSection = rtSection::getInstance($sectionKey, 
$tempArray, $this-testName);
 $this-sections[$sectionKey] = $testSection;
 break;
 } else {
@@ -72,7 +72,7 @@
 }
 }

-$testSection = rtSection::getInstance($lastSection, $tempArray);
+$testSection = rtSection::getInstance($lastSection, $tempArray, 
$this-testName);
 $this-sections[$lastSection] = $testSection;



Modified: php/phpruntests/trunk/src/testcase/rtTestResults.php
===
--- php/phpruntests/trunk/src/testcase/rtTestResults.php2009-08-04 
21:43:16 UTC (rev 286819)
+++ php/phpruntests/trunk/src/testcase/rtTestResults.php2009-08-04 
21:46:19 UTC (rev 286820)
@@ -64,6 +64,13 @@
 @unlink($this-testName . '.mem');
 }
 }
+
+//always delete temporary files used in POST sections
+if(file_exists($this-testName . '.post')) {
+@unlink($this-testName . '.post');
+}
+
+
 }

 /**

Modified: 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php
===
--- 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php
  2009-08-04 21:43:16 UTC (rev 286819)
+++ 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php
  2009-08-04 21:46:19 UTC (rev 286820)
@@ -26,7 +26,7 @@
 $this-postVariables['CONTENT_LENGTH'] = strlen($compressedPostString);
 $this-postVariables['REQUEST_METHOD'] = 'POST';

-$this-postFileName = tempnam(sys_get_temp_dir(), 'post');
+$this-postFileName = $this-testName . .post;

 file_put_contents($this-postFileName, $compressedPostString);
 }

Modified: 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php
===
--- 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php
 2009-08-04 21:43:16 UTC (rev 286819)
+++ 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php
 2009-08-04 21:46:19 UTC (rev 286820)
@@ -26,7 +26,7 @@
 $this-postVariables['CONTENT_LENGTH'] = strlen($gzipPostString);
 $this-postVariables['REQUEST_METHOD'] = 'POST';

-$this-postFileName = tempnam(sys_get_temp_dir(), 'post');
+$this-postFileName = $this-testName . .post;

 file_put_contents($this-postFileName, $gzipPostString);
 }

Modified: 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php
===
--- 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php
  2009-08-04 21:43:16 UTC (rev 286819)
+++ 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php
  2009-08-04 21:46:19 UTC (rev 286820)
@@ -36,8 +36,8 @@
 $this-postVariables['CONTENT_LENGTH'] = strlen($postString);
 $this-postVariables['REQUEST_METHOD'] = 'POST';

-$this-postFileName = tempnam(sys_get_temp_dir(), 'post');
-
+$this-postFileName = $this-testName . .post;
+
 file_put_contents($this-postFileName, $postString);
 }


Modified: 
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php
===

[PHP-CVS] svn: php/phpruntests/trunk/src/testcase/ rtPhpTest.php

2009-07-18 Thread Zoe Slattery
zoe Sat, 18 Jul 2009 17:38:12 +

URL: http://svn.php.net/viewvc?view=revisionrevision=284332

Changed paths:
U   php/phpruntests/trunk/src/testcase/rtPhpTest.php

Log:
remove unnecessary check

Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php
===
--- php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-07-18 17:10:12 UTC 
(rev 284331)
+++ php/phpruntests/trunk/src/testcase/rtPhpTest.php2009-07-18 17:38:12 UTC 
(rev 284332)
@@ -42,7 +42,7 @@
 {
 $lastSection = end($this-sectionHeadings);
 $start=0;
-
+
 foreach($this-sectionHeadings as $keyNumber = $sectionKey) {

 if($keyNumber  count($this-sectionHeadings) - 1) {
@@ -53,20 +53,17 @@
 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 of the section OR the end of the test
 $start = $contentsLine - 1;
 if($this-isFileSection($sectionKey)) {
 $tempArray = $this-removeDone($tempArray);
-}
-
-if(count($tempArray)  0) {
-$testSection = rtSection::getInstance($sectionKey, 
$tempArray);
-$this-sections[$sectionKey] = $testSection;
-}
+}
+$testSection = rtSection::getInstance($sectionKey, 
$tempArray);
+$this-sections[$sectionKey] = $testSection;
 break;
 } else {
 $tempArray[] = $this-contents[$contentsLine];
@@ -183,7 +180,7 @@
 $result = array();
 foreach($array as $line) {
 $result[] = $line;
-// If found at the start of the line, so ' ===done===' won't work.
+// If found at the start of the line, so ' ===done===' won't work.
 if(stripos($line, ===done===) === 0) {
 break;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php