Skip to content

Commit 235f986

Browse files
Médéric RibreuxMédéric RIBREUX
Médéric Ribreux
authored and
Médéric RIBREUX
committed
Fix qt5 travis build and update README for Processing tests
1 parent 3f6e84f commit 235f986

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ matrix:
8484
- graphviz
8585
- libpq-dev
8686
- libfcgi-dev
87+
- libfftw3-3
8788
- pkg-config
8889
- poppler-utils
8990
- txt2tags

python/plugins/processing/tests/AlgorithmsTestBase.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,21 @@ def check_algorithm(self, name, defs):
100100

101101
expectFailure = False
102102
if 'expectedFailure' in defs:
103-
exec '\n'.join(defs['expectedFailure'][:-1]) in globals(), locals()
103+
exec('\n'.join(defs['expectedFailure'][:-1])) in globals(), locals()
104104
expectFailure = eval(defs['expectedFailure'][-1])
105105

106-
def doCheck():
107-
alg.execute()
108-
109-
self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])
110-
111106
if expectFailure:
112107
try:
113-
doCheck()
108+
alg.execute()
109+
self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])
114110
except Exception:
115111
pass
116112
else:
117113
raise _UnexpectedSuccess
118114
else:
119-
doCheck()
115+
alg.execute()
116+
self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])
117+
120118

121119
def load_params(self, params):
122120
"""

python/plugins/processing/tests/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ The above translates to
5454
name: expected/polys_densify.gml
5555
```
5656

57+
For GRASS 7 raster outputs
58+
--------------------------
59+
60+
If you want to create a test for a GRASS 7 module which exports a raster output, you will need extra steps. There isa great chance that your GRASS 7 installation will be different from the Travis-Ci environment (for the moment, it is provided by [osgeo4travis archive]( and it is based on GRASS 7.0.2). It means that your raster hashes will be different from the ones produced in Travis-Ci (GRASS adds a metadata which contains the GRASS version in the GTiff).
61+
62+
Here are a few instructions (for Debian based GNU/Linux distributions) to assure you use the same version of GRASS than in Travis-Ci:
63+
64+
* Install osgeo4travis binaries into your home directory:
65+
`curl -L https://github.com/opengisch/osgeo4travis/archive/qt4bin.tar.gz | tar -xzC ${HOME} --strip-components=1`
66+
* Modify the grass70 script which incorporates a hardlink to /home/travis:
67+
`sed -i 's#/home/travis#'${HOME}'#g' ${HOME}/osgeo4travis/bin/grass70`
68+
* Launch QGIS with the following command:
69+
`PATH=${HOME}/osgeo4travis/bin:$PATH LD_LIBRARY_PATH=${HOME}/osgeo4travis/lib:$LD_LIBRARY_PATH qgis`
70+
71+
From now, you will be using osgeo4travis GRASS 7 installation in QGIS Processing and you can proceed with the above method to easily produce unit tests.
72+
73+
5774
Params and results
5875
------------------
5976

0 commit comments

Comments
 (0)