Skip to content

Commit

Permalink
Fix qt5 travis build and update README for Processing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Médéric Ribreux authored and Médéric RIBREUX committed May 29, 2016
1 parent 3f6e84f commit 235f986
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -84,6 +84,7 @@ matrix:
- graphviz
- libpq-dev
- libfcgi-dev
- libfftw3-3
- pkg-config
- poppler-utils
- txt2tags
Expand Down
14 changes: 6 additions & 8 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Expand Up @@ -100,23 +100,21 @@ def check_algorithm(self, name, defs):

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

def doCheck():
alg.execute()

self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])

if expectFailure:
try:
doCheck()
alg.execute()
self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])
except Exception:
pass
else:
raise _UnexpectedSuccess
else:
doCheck()
alg.execute()
self.check_results(alg.getOutputValuesAsDictionary(), defs['results'])


def load_params(self, params):
"""
Expand Down
17 changes: 17 additions & 0 deletions python/plugins/processing/tests/README.md
Expand Up @@ -54,6 +54,23 @@ The above translates to
name: expected/polys_densify.gml
```

For GRASS 7 raster outputs
--------------------------

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).

Here are a few instructions (for Debian based GNU/Linux distributions) to assure you use the same version of GRASS than in Travis-Ci:

* Install osgeo4travis binaries into your home directory:
`curl -L https://github.com/opengisch/osgeo4travis/archive/qt4bin.tar.gz | tar -xzC ${HOME} --strip-components=1`
* Modify the grass70 script which incorporates a hardlink to /home/travis:
`sed -i 's#/home/travis#'${HOME}'#g' ${HOME}/osgeo4travis/bin/grass70`
* Launch QGIS with the following command:
`PATH=${HOME}/osgeo4travis/bin:$PATH LD_LIBRARY_PATH=${HOME}/osgeo4travis/lib:$LD_LIBRARY_PATH qgis`

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.


Params and results
------------------

Expand Down

0 comments on commit 235f986

Please sign in to comment.