[QGIS Commit] r8718 - trunk/qgis/tests/src/gui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Jul 6 18:39:11 EDT 2008
Author: timlinux
Date: 2008-07-06 18:39:11 -0400 (Sun, 06 Jul 2008)
New Revision: 8718
Modified:
trunk/qgis/tests/src/gui/CMakeLists.txt
trunk/qgis/tests/src/gui/testqgsquickprint.cpp
Log:
Use qgisapp path properly for quickprint test too
Modified: trunk/qgis/tests/src/gui/CMakeLists.txt
===================================================================
--- trunk/qgis/tests/src/gui/CMakeLists.txt 2008-07-06 22:21:56 UTC (rev 8717)
+++ trunk/qgis/tests/src/gui/CMakeLists.txt 2008-07-06 22:39:11 UTC (rev 8718)
@@ -43,6 +43,7 @@
# the TEST_DATA_DIR variable is set in the top level CMakeLists.txt
ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")
+ADD_DEFINITIONS(-DINSTALL_PREFIX="\\"${CMAKE_INSTALL_PREFIX}\\"")
#############################################################
# libraries
Modified: trunk/qgis/tests/src/gui/testqgsquickprint.cpp
===================================================================
--- trunk/qgis/tests/src/gui/testqgsquickprint.cpp 2008-07-06 22:21:56 UTC (rev 8717)
+++ trunk/qgis/tests/src/gui/testqgsquickprint.cpp 2008-07-06 22:39:11 UTC (rev 8718)
@@ -46,7 +46,6 @@
void cleanup(){};// will be called after every testfunction.
void basicMapTest();
- QString getQgisPath(); // Gets the path to QGIS installation
private:
bool imageCheck(QString theType); //as above
QgsMapRender * mpMapRenderer;
@@ -57,35 +56,18 @@
QString mReport;
};
-QString TestQgsQuickPrint::getQgisPath()
-{
-#ifdef Q_OS_LINUX
- QString qgisPath = QCoreApplication::applicationDirPath () + "/../";
-#else //mac and win
- QString qgisPath = QCoreApplication::applicationDirPath () ;
-#endif
- return qgisPath;
-}
-
void TestQgsQuickPrint::initTestCase()
{
+ //
+ // Runs once before any tests are run
+ //
// init QGIS's paths - true means that all path will be inited from prefix
- //QString qgisPath = QCoreApplication::applicationDirPath ();
- QgsApplication::setPrefixPath(getQgisPath(), TRUE);
-#ifdef Q_OS_LINUX
-// QgsApplication::setPkgDataPath(qgisPath + "/../share/qgis");
-// QgsApplication::setPluginPath(qgisPath + "/../lib/qgis");
-#endif
+ QString qgisPath = QCoreApplication::applicationDirPath ();
+ QgsApplication::setPrefixPath(INSTALL_PREFIX, true);
+ QgsApplication::showSettings();
// Instantiate the plugin directory so that providers are loaded
QgsProviderRegistry::instance(QgsApplication::pluginPath());
- //create some objects that will be used in all tests...
-
- std::cout << "Prefix PATH: " << QgsApplication::prefixPath().toLocal8Bit().data() << std::endl;
- std::cout << "Plugin PATH: " << QgsApplication::pluginPath().toLocal8Bit().data() << std::endl;
- std::cout << "PkgData PATH: " << QgsApplication::pkgDataPath().toLocal8Bit().data() << std::endl;
- std::cout << "User DB PATH: " << QgsApplication::qgisUserDbFilePath().toLocal8Bit().data() << std::endl;
-
//
//create a point layer that will be used in all tests...
//
More information about the QGIS-commit
mailing list