Skip to content
Permalink
Browse files

fix tests on windows

  • Loading branch information
jef-n committed Aug 17, 2012
1 parent 07e3c16 commit 96b2d51e97dd4906b1b4b08e6ae568a099469568
@@ -35,8 +35,8 @@ MACRO(ADD_PYTHON_TEST TESTNAME FILENAME)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake
"
IF(WIN32)
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE}\")
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/${CMAKE_BUILD_TYPE};\$ENV{PATH}\")
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE}\")
SET(ENV{PATH} \"${QGIS_OUTPUT_DIRECTORY}/bin/\${CMAKE_BUILD_TYPE};\$ENV{PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/;\$ENV{PYTHONPATH}\")
MESSAGE(\"PATH:\$ENV{PATH}\")
ELSE(WIN32)
@@ -63,7 +63,11 @@ IF(import_res)
ENDIF(import_res)
"
)
ADD_TEST(${TESTNAME} ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake)
IF(CMAKE_CONFIGURATION_TYPES)
ADD_TEST(NAME ${TESTNAME} COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=$<CONFIGURATION> -P ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake)
ELSE(CMAKE_CONFIGURATION_TYPES)
ADD_TEST(NAME ${TESTNAME} COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake)
ENDIF(CMAKE_CONFIGURATION_TYPES)
ENDMACRO(ADD_PYTHON_TEST)

# Byte compile recursively a directory (DIRNAME)
@@ -48,7 +48,7 @@ class TestQgsComposerMap: public QObject

void TestQgsComposerMap::initTestCase()
{
QgsApplication::init( QString() );
QgsApplication::init();
QgsApplication::initQgis();

//create maplayers from testdata and add to layer registry
@@ -83,7 +83,7 @@ class TestQgsRasterLayer: public QObject
void TestQgsRasterLayer::initTestCase()
{
// init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::init( QString() );
QgsApplication::init();
QgsApplication::initQgis();
// disable any PAM stuff to make sure stats are consistent
CPLSetConfigOption( "GDAL_PAM_ENABLED", "NO" );
@@ -62,7 +62,7 @@ class TestQgsWcsProvider: public QObject
void TestQgsWcsProvider::initTestCase()
{
// init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::init( QString() );
QgsApplication::init();
QgsApplication::initQgis();
QString mySettings = QgsApplication::showSettings();
mySettings = mySettings.replace( "\n", "<br />" );
@@ -26,6 +26,7 @@ def testLogger(self):
#myLogger.fatal('Aaaargh...fatal'); #kills QGIS not testable
myFile = open(myFilename, 'rt')
myText = myFile.readlines()
myFile.close()
myExpectedText = ['QGIS Logger Unit Test\n',
'This is a debug\n',
'This is a warning\n',

0 comments on commit 96b2d51

Please sign in to comment.
You can’t perform that action at this time.