File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,8 +67,25 @@ def getQgisTestApp():
6767
6868 if QGISAPP is None :
6969 myGuiFlag = True # All test will run qgis in gui mode
70-
7170 QGISAPP = QgsApplication (sys .argv , myGuiFlag )
71+ # Note: QGIS_PREFIX_PATH is set by cmake to the output dir
72+ if 'QGIS_PREFIX_PATH' in os .environ :
73+ myPath = os .environ ['QGIS_PREFIX_PATH' ]
74+ myUseDefaultPathFlag = True
75+ QGISAPP .setPrefixPath (myPath , myUseDefaultPathFlag )
76+
77+ if sys .platform .startswith ('darwin' ):
78+ # override resource paths, otherwise looks for Resources in app
79+ if 'QGIS_MAC_PKGDATA_DIR' in os .environ :
80+ myPkgPath = os .environ ['QGIS_MAC_PKGDATA_DIR' ]
81+ QGISAPP .setPkgDataPath (myPkgPath )
82+ if 'QGIS_MAC_SVG_DIR' in os .environ :
83+ mySVGPath = os .environ ['QGIS_MAC_SVG_DIR' ]
84+ mySVGPaths = QGISAPP .svgPaths ()
85+ # doesn't get rid of incorrect path, just adds correct one
86+ mySVGPaths .prepend (mySVGPath )
87+ QGISAPP .setDefaultSvgPaths (mySVGPaths )
88+
7289 QGISAPP .initQgis ()
7390 s = QGISAPP .showSettings ()
7491 print s
You can’t perform that action at this time.
0 commit comments