Skip to content
Permalink
Browse files

- make python tests runnable from build directory again

- don't change testfiles in test runs
  • Loading branch information
jef-n committed Sep 8, 2012
1 parent e8a938a commit 82c4b4a521acc98a36c2cd6474797cee21bfb7b3
Showing with 8 additions and 19 deletions.
  1. +6 −2 tests/src/providers/testqgswcsprovider.cpp
  2. +2 −17 tests/src/python/utilities.py
@@ -113,15 +113,19 @@ void TestQgsWcsProvider::read( )
{
foreach ( QString identifier, identifiers )
{
QString filePath = mTestDataDir + "/" + identifier + ".tif";
foreach ( QString ext, QStringList() << ".tif" << ".tif.aux.xml" )
{
QFile::remove( QDir::tempPath() + "/" + identifier + ext );
QVERIFY( QFile::copy( mTestDataDir + "/" + identifier + ext, QDir::tempPath() + "/" + identifier + ext ) );
}

QgsDataSourceURI uri;
uri.setParam( "url", mUrl );
uri.setParam( "identifier", identifier );
uri.setParam( "crs", "epsg:4326" );
uri.setParam( "version", version );

if ( !read( identifier, uri.encodedUri(), filePath, mReport ) )
if ( !read( identifier, uri.encodedUri(), QDir::tempPath() + "/" + identifier + ".tif", mReport ) )
{
ok = false;
}
@@ -67,24 +67,9 @@ def getQgisTestApp():

if QGISAPP is None:
myGuiFlag = True # All test will run qgis in gui mode

# Note: QGIS_PREFIX_PATH is evaluated in QgsApplication - no need to mess with it here.
QGISAPP = QgsApplication(sys.argv, myGuiFlag)
# Note: QGIS_PREFIX_PATH is set by cmake to the output dir
if 'QGIS_PREFIX_PATH' in os.environ:
myPath = os.environ['QGIS_PREFIX_PATH']
myUseDefaultPathFlag = True
QGISAPP.setPrefixPath(myPath, myUseDefaultPathFlag)

if sys.platform.startswith('darwin'):
# override resource paths, otherwise looks for Resources in app
if 'QGIS_MAC_PKGDATA_DIR' in os.environ:
myPkgPath = os.environ['QGIS_MAC_PKGDATA_DIR']
QGISAPP.setPkgDataPath(myPkgPath)
if 'QGIS_MAC_SVG_DIR' in os.environ:
mySVGPath = os.environ['QGIS_MAC_SVG_DIR']
mySVGPaths = QGISAPP.svgPaths()
# doesn't get rid of incorrect path, just adds correct one
mySVGPaths.prepend(mySVGPath)
QGISAPP.setDefaultSvgPaths(mySVGPaths)

QGISAPP.initQgis()
s = QGISAPP.showSettings()

0 comments on commit 82c4b4a

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