[Fusionforge-commits] r10199 - in trunk/tests: build/documentation code/deprecations code/syntax func func/Testing unit/config unit/utils

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Jul 8 10:34:28 CEST 2010


Author: lolando
Date: 2010-07-08 10:34:28 +0200 (Thu, 08 Jul 2010)
New Revision: 10199

Modified:
   trunk/tests/build/documentation/DocumentationTest.php
   trunk/tests/code/deprecations/DeprecationsTest.php
   trunk/tests/code/syntax/SyntaxTest.php
   trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php
   trunk/tests/func/db_reload.php
   trunk/tests/unit/config/ConfigTest.php
   trunk/tests/unit/utils/DbUtilsTest.php
   trunk/tests/unit/utils/TextSanitizerTest.php
   trunk/tests/unit/utils/UtilsTest.php
Log:
Adapted testsuite to gforge directory renamed as src

Modified: trunk/tests/build/documentation/DocumentationTest.php
===================================================================
--- trunk/tests/build/documentation/DocumentationTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/build/documentation/DocumentationTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -19,7 +19,7 @@
     {
 	    $tests = dirname( dirname( dirname( dirname (__FILE__)))); 
 	    $base = dirname( $tests );
-	    system("cd ../gforge/docs/docbook; make TARGET=$base/build/documentation/ html", $retval);
+	    system("cd ../src/docs/docbook; make TARGET=$base/build/documentation/ html", $retval);
 	    $this->assertEquals(0, $retval);
     }
 
@@ -30,7 +30,7 @@
     {
 	    $tests = dirname( dirname( dirname( dirname (__FILE__)))); 
 	    $base = dirname( $tests );
-	    system("cd ../gforge/docs/docbook; make TARGET=$base/build/documentation/ pdf", $retval);
+	    system("cd ../src/docs/docbook; make TARGET=$base/build/documentation/ pdf", $retval);
 	    $this->assertEquals(0, $retval);
     }
 }

Modified: trunk/tests/code/deprecations/DeprecationsTest.php
===================================================================
--- trunk/tests/code/deprecations/DeprecationsTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/code/deprecations/DeprecationsTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -17,12 +17,12 @@
 	 */
 	public function testdb_query()
 	{
-		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -l '\bdb_m?query\b' \
+		$output = `cd .. ; find src tests -name '*.php' -type f | xargs pcregrep -l '\bdb_m?query\b' \
 					   | grep -v ^tests/code/deprecations/DeprecationsTest.php \
-					   | grep -v ^gforge/db/upgrade-db.php \
-					   | grep -v ^gforge/www/include/database-oci8.php \
-					   | grep -v ^gforge/common/include/database-pgsql.php \
-					   | grep -v ^gforge/common/include/database-mysql.php`;
+					   | grep -v ^src/db/upgrade-db.php \
+					   | grep -v ^src/www/include/database-oci8.php \
+					   | grep -v ^src/common/include/database-pgsql.php \
+					   | grep -v ^src/common/include/database-mysql.php`;
 		$this->assertEquals('', $output);
 	}
 	
@@ -125,12 +125,12 @@
 
 		$pattern = implode ('|', $vars) ;
 		
-		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -n '\\$($pattern)\b(?! *=[^=])' \
-					   | grep -v ^gforge/common/include/config-vars.php`;
+		$output = `cd .. ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\$($pattern)\b(?! *=[^=])' \
+					   | grep -v ^src/common/include/config-vars.php`;
 		$this->assertEquals('', $output, "Found deprecated \$var for var in ($pattern):");
 
-		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -n '\\\$GLOBALS\\[.?($pattern).?\\](?! *=[^=])' \
-					   | grep -v ^gforge/common/include/config-vars.php`;
+		$output = `cd .. ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\$GLOBALS\\[.?($pattern).?\\](?! *=[^=])' \
+					   | grep -v ^src/common/include/config-vars.php`;
 		$this->assertEquals('', $output, "Found deprecated \$GLOBALS['\$var'] for var in ($pattern):");
 	}
 		
@@ -139,9 +139,9 @@
 	 */
 	public function testsession_require()
 	{
-		$output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -l '\bsession_require[^_]' \
+		$output = `cd .. ; find src tests -name '*.php' -type f | xargs pcregrep -l '\bsession_require[^_]' \
 					   | grep -v ^tests/code/deprecations/DeprecationsTest.php \
-					   | grep -v ^gforge/common/include/session.php`;
+					   | grep -v ^src/common/include/session.php`;
 		$this->assertEquals('', $output);
 	}
 	

Modified: trunk/tests/code/syntax/SyntaxTest.php
===================================================================
--- trunk/tests/code/syntax/SyntaxTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/code/syntax/SyntaxTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -30,11 +30,11 @@
    */
   public function testPath()
   {
-    $output = `ls ../gforge >/dev/null; echo $?`;
+    $output = `ls ../src >/dev/null; echo $?`;
     $rc = trim($output);
     if ($rc != '0') {
-      $output = `ls ../gforge`;
-      $this->fail('Must be run from inside the "tests/" subdir : `ls ../gforge` reports "'.$output);
+      $output = `ls ../src`;
+      $this->fail('Must be run from inside the "tests/" subdir : `ls ../src` reports "'.$output);
     }
   }
     /**
@@ -42,7 +42,7 @@
      */
     public function testPhpSyntax()
     {
-	    $output = `cd .. ; find gforge tests -name '*.php' -type f  -exec php -l {} \; | grep -v '^No syntax errors detected'`;
+	    $output = `cd .. ; find src tests -name '*.php' -type f  -exec php -l {} \; | grep -v '^No syntax errors detected'`;
 	    $this->assertEquals('', $output);
     }
 
@@ -52,13 +52,13 @@
     public function testUTF8Chars()
     {
 	    // Skip the wiki part which is not UTF-8 encoded.
-	    $output = `cd .. ; find gforge tests -name '*.php' -not -path 'gforge/plugins/wiki/www/*' -type f | xargs isutf8`;
+	    $output = `cd .. ; find src tests -name '*.php' -not -path 'src/plugins/wiki/www/*' -type f | xargs isutf8`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.sql' -type f | xargs isutf8`;
+	    $output = `cd .. ; find src tests -name '*.sql' -type f | xargs isutf8`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.sh' -type f | xargs isutf8`;
+	    $output = `cd .. ; find src tests -name '*.sh' -type f | xargs isutf8`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.pl' -type f | xargs isutf8`;
+	    $output = `cd .. ; find src tests -name '*.pl' -type f | xargs isutf8`;
 	    $this->assertEquals('', $output);
     }
 
@@ -67,13 +67,13 @@
      */
     public function testUnixLineEndings()
     {
-	    $output = `cd .. ; find gforge tests -name '*.php' -type f | xargs pcregrep -l '\r$'`;
+	    $output = `cd .. ; find src tests -name '*.php' -type f | xargs pcregrep -l '\r$'`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.sql' -type f | xargs pcregrep -l '\r$'`;
+	    $output = `cd .. ; find src tests -name '*.sql' -type f | xargs pcregrep -l '\r$'`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.sh' -type f | xargs pcregrep -l '\r$'`;
+	    $output = `cd .. ; find src tests -name '*.sh' -type f | xargs pcregrep -l '\r$'`;
 	    $this->assertEquals('', $output);
-	    $output = `cd .. ; find gforge tests -name '*.pl' -type f | xargs pcregrep -l '\r$'`;
+	    $output = `cd .. ; find src tests -name '*.pl' -type f | xargs pcregrep -l '\r$'`;
 	    $this->assertEquals('', $output);
     }
 
@@ -82,7 +82,7 @@
      */
     public function testEmptyLastLine()
     {
-	    $output = `cd .. ; find gforge tests -name '*.php' -type f | while read i ; do [ -z "\$(tail -n 1 \$i)" ] && echo \$i ; done`;
+	    $output = `cd .. ; find src tests -name '*.php' -type f | while read i ; do [ -z "\$(tail -n 1 \$i)" ] && echo \$i ; done`;
 	    $this->assertEquals('', $output);
     }
 }

Modified: trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php
===================================================================
--- trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/func/Testing/RPMSeleniumRemoteSuite.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -11,8 +11,8 @@
 		system("scp -r ../tests root@".HOST.":/usr/share");
 		
 		system("scp -rp ~/fusionforge_repo root@".HOST.":");
-		system("scp -rp ".dirname(__FILE__)."/../../../gforge/rpm-specific/dag-rpmforge.repo root@".HOST.":/etc/yum.repos.d/");
-		system("scp -rp ".dirname(__FILE__)."/../../../gforge/rpm-specific/fusionforge-ci.repo root@".HOST.":/etc/yum.repos.d/");
+		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/dag-rpmforge.repo root@".HOST.":/etc/yum.repos.d/");
+		system("scp -rp ".dirname(__FILE__)."/../../../src/rpm-specific/fusionforge-ci.repo root@".HOST.":/etc/yum.repos.d/");
 
 		# Prefill yum cache to reduce real downloads.
 		//system("scp -rp ~/yum-cache-prefill/* root@".HOST.":/var/cache/yum/");

Modified: trunk/tests/func/db_reload.php
===================================================================
--- trunk/tests/func/db_reload.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/func/db_reload.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -69,8 +69,8 @@
 	// Reload a fresh database before running this test suite.
 	system("mysqladmin -f -u".DB_USER." -p".DB_PASSWORD." drop ".DB_NAME." &>/dev/null");
 	system("mysqladmin -u".DB_USER." -p".DB_PASSWORD." create ".DB_NAME);
-	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/gforge/db/gforge-struct-mysql.sql");
-	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/gforge/db/gforge-data-mysql.sql");
+	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/src/db/gforge-struct-mysql.sql");
+	system("mysql -u".DB_USER." -p".DB_PASSWORD." ".DB_NAME." < ".dirname(dirname(__FILE__))."/src/db/gforge-data-mysql.sql");
 } elseif ( DB_TYPE == 'pgsql') {
 	if (!function_exists('pg_connect')) {
 		print "ERROR: Missing pgsql on PHP to run tests on PostgreSQL.\n";
@@ -83,8 +83,8 @@
 	system("service postgresql restart 2>&1 >/dev/null");
 	system("su - postgres -c 'dropdb -q ".DB_NAME."'");
 	system("su - postgres -c 'createdb -q --encoding UNICODE ".DB_NAME."'");
-	system("psql -q -U".DB_USER." ".DB_NAME." -f ".dirname(dirname(dirname(__FILE__)))."/gforge/db/gforge.sql &>/tmp/gforge-import.log");
-	system("php ".dirname(dirname(dirname(__FILE__)))."/gforge/db/upgrade-db.php &>/tmp/gforge-upgrade-db.log");
+	system("psql -q -U".DB_USER." ".DB_NAME." -f ".dirname(dirname(dirname(__FILE__)))."/src/db/gforge.sql &>/tmp/gforge-import.log");
+	system("php ".dirname(dirname(dirname(__FILE__)))."/src/db/upgrade-db.php &>/tmp/gforge-upgrade-db.log");
 } else {
 	print "Unsupported database type: ".DB_TYPE. "\n";
 	exit;

Modified: trunk/tests/unit/config/ConfigTest.php
===================================================================
--- trunk/tests/unit/config/ConfigTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/unit/config/ConfigTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -1,7 +1,7 @@
 <?php
 
 require_once 'PHPUnit/Framework/TestCase.php';
-require_once dirname(__FILE__) . '/../../../gforge/common/include/config.php';
+require_once dirname(__FILE__) . '/../../../src/common/include/config.php';
 
 /**
  * Simple tests for the config library.
@@ -26,7 +26,7 @@
 		$this->assertEquals('default', forge_get_config ('forge_name', 'core'));
 		$this->assertTrue(forge_get_config ('user_registration_restricted'));
 
-		forge_read_config_file (dirname(__FILE__) . '/../../../gforge/etc/config.ini-fhs') ;
+		forge_read_config_file (dirname(__FILE__) . '/../../../src/etc/config.ini-fhs') ;
 
 		$this->assertEquals('FusionForge', forge_get_config ('forge_name'));
 		$this->assertEquals('FusionForge', forge_get_config ('forge_name', 'core'));
@@ -41,7 +41,7 @@
 		$this->assertEquals('FusionForge', $forge_name);
 		$this->assertFalse($core__user_registration_restricted);
 
-		forge_read_config_dir (dirname(__FILE__) . '/../../../gforge/etc/config.ini.d') ;
+		forge_read_config_dir (dirname(__FILE__) . '/../../../src/etc/config.ini.d') ;
 
 		$this->assertEquals('anonsvn', forge_get_config ('anonsvn_login', 'scmsvn'));
 		$this->assertEquals('/var/lib/gforge/chroot/scmrepos/svn', forge_get_config ('repos_path', 'scmsvn'));

Modified: trunk/tests/unit/utils/DbUtilsTest.php
===================================================================
--- trunk/tests/unit/utils/DbUtilsTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/unit/utils/DbUtilsTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -1,7 +1,7 @@
 <?php
 
 require_once 'PHPUnit/Framework/TestCase.php' ;
-require_once dirname(__FILE__) . '/../../../gforge/common/include/database-pgsql.php' ;
+require_once dirname(__FILE__) . '/../../../src/common/include/database-pgsql.php' ;
 
 /**
  * Simple tests for the utils library.

Modified: trunk/tests/unit/utils/TextSanitizerTest.php
===================================================================
--- trunk/tests/unit/utils/TextSanitizerTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/unit/utils/TextSanitizerTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -1,8 +1,8 @@
 <?php
 
 require_once 'PHPUnit/Framework/TestCase.php';
-require_once dirname(__FILE__) . '/../../../gforge/common/include/Error.class.php';
-require_once dirname(__FILE__) . '/../../../gforge/common/include/TextSanitizer.class.php';
+require_once dirname(__FILE__) . '/../../../src/common/include/Error.class.php';
+require_once dirname(__FILE__) . '/../../../src/common/include/TextSanitizer.class.php';
 
 /**
  * Simple tests for the text sanitizer class.

Modified: trunk/tests/unit/utils/UtilsTest.php
===================================================================
--- trunk/tests/unit/utils/UtilsTest.php	2010-07-08 08:34:01 UTC (rev 10198)
+++ trunk/tests/unit/utils/UtilsTest.php	2010-07-08 08:34:28 UTC (rev 10199)
@@ -1,7 +1,7 @@
 <?php
 
 require_once 'PHPUnit/Framework/TestCase.php';
-require_once dirname(__FILE__) . '/../../../gforge/common/include/utils.php';
+require_once dirname(__FILE__) . '/../../../src/common/include/utils.php';
 
 /**
  * Simple tests for the utils library.




More information about the Fusionforge-commits mailing list