[Fusionforge-commits] r7544 - in trunk/tests/func: . Testing

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Apr 29 23:11:54 CEST 2009


Author: aljeux
Date: 2009-04-29 23:11:54 +0200 (Wed, 29 Apr 2009)
New Revision: 7544

Modified:
   trunk/tests/func/Testing/SeleniumGforge.php
   trunk/tests/func/config.php.sample
   trunk/tests/func/db_reload.php
Log:
Tests: Allow configuration of db reload command

Modified: trunk/tests/func/Testing/SeleniumGforge.php
===================================================================
--- trunk/tests/func/Testing/SeleniumGforge.php	2009-04-29 18:36:18 UTC (rev 7543)
+++ trunk/tests/func/Testing/SeleniumGforge.php	2009-04-29 21:11:54 UTC (rev 7544)
@@ -51,8 +51,10 @@
 {
     protected function setUp()
     {
+	if (defined(DB_INIT_CMD)) {
 		// Reload a fresh database before running this test suite.
-		system("php ".dirname(dirname(__FILE__))."/db_reload.php");
+		system(DB_INIT_CMD);
+	}
 
     	$this->setBrowser('*firefox');
         $this->setBrowserUrl(URL);

Modified: trunk/tests/func/config.php.sample
===================================================================
--- trunk/tests/func/config.php.sample	2009-04-29 18:36:18 UTC (rev 7543)
+++ trunk/tests/func/config.php.sample	2009-04-29 21:11:54 UTC (rev 7544)
@@ -24,6 +24,7 @@
 define('DB_NAME', 'fforge');
 define('DB_USER', 'gforge');
 define('DB_PASSWORD', '@@FFDB_PASS@@');
+define('DB_INIT_CMD', 'php '.dirname(__FILE__).'/db_reload.php');
 
 // Enter true when file is configured.
 define('CONFIGURED', false);

Modified: trunk/tests/func/db_reload.php
===================================================================
--- trunk/tests/func/db_reload.php	2009-04-29 18:36:18 UTC (rev 7543)
+++ trunk/tests/func/db_reload.php	2009-04-29 21:11:54 UTC (rev 7544)
@@ -83,7 +83,7 @@
 	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("psql -q -U".DB_USER." ".DB_NAME." -f ".dirname(dirname(dirname(__FILE__)))."/db/gforge.sql &>/tmp/gforge-import.log");
 } else {
 	print "Unsupported database type: ".DB_TYPE. "\n";
 	exit;




More information about the Fusionforge-commits mailing list