[pLog-svn] r3734 - in plog/trunk: . class/test

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Jul 17 21:16:31 GMT 2006


Author: mark
Date: 2006-07-17 21:16:30 +0000 (Mon, 17 Jul 2006)
New Revision: 3734

Modified:
   plog/trunk/class/test/testrunner.class.php
   plog/trunk/runtests.php
Log:
Some bug fixed.

Modified: plog/trunk/class/test/testrunner.class.php
===================================================================
--- plog/trunk/class/test/testrunner.class.php	2006-07-17 20:47:17 UTC (rev 3733)
+++ plog/trunk/class/test/testrunner.class.php	2006-07-17 21:16:30 UTC (rev 3734)
@@ -35,6 +35,11 @@
 	 * pattern for test class names
 	 */
 	define( "TEST_CLASS_NAME_PATTERN", "*_test.class.php" );
+
+	/**
+	 * Exclude folders, seperated by comma
+	 **/
+	define( "EXCLUDE_FOLDERS_LIST", ".svn" );
 	
 	class TestRunner
 	{
@@ -42,11 +47,13 @@
 		var $pattern;
 		var $files;
 		var $suite;
+		var $excludeFolders;
 		
 		function TestRunner( $folder = TEST_CLASS_FOLDER, $pattern = TEST_CLASS_NAME_PATTERN )
 		{
 			$this->folder = $folder;
 			$this->pattern = $pattern;
+			$this->excludeFolders = explode( ",", EXCLUDE_FOLDERS_LIST );
 			
 			$this->files = $this->_findClasses( $this->folder, $this->pattern );
 		}
@@ -118,9 +125,12 @@
 			foreach( $files as $file ) {
 				// recursive call
 				if( File::isDir( $file )) {
-					$res = $this->_findClasses( $file, $pattern );
-					foreach( $res as $f ) {
-						$list[] = $f;
+					if( array_search( basename( $file ), $this->excludeFolders ) === false )
+					{
+						$res = $this->_findClasses( $file, $pattern );
+						foreach( $res as $f ) {
+							$list[] = $f;
+						}
 					}
 				}
 				else {

Modified: plog/trunk/runtests.php
===================================================================
--- plog/trunk/runtests.php	2006-07-17 20:47:17 UTC (rev 3733)
+++ plog/trunk/runtests.php	2006-07-17 21:16:30 UTC (rev 3734)
@@ -15,7 +15,7 @@
 	
 	// get the suite name from the request or run all of them if no parameter specified
 	$request = HttpVars::getRequest();
-	$suiteName = isset( $request["suite"] ) ? $request["suite"] : "";
+	$suiteName = isset( $request["suite"] ) ? strtolower($request["suite"]) : "";
 
 	// create a new TestRunner class, which will take care of loading all our
 	// tests cases, instantiate them and tell PHPUnit to run the tests specified



More information about the pLog-svn mailing list