Skip to content

Commit

Permalink
Add description for starting python tests in gdb
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 20, 2017
1 parent 45f4a3e commit 85146ca
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/README.md
Expand Up @@ -90,3 +90,30 @@ WCS testing information can be found in:
About benchmark tests you can read:

${TOP_SRCDIR}/tests/bench/README


# Run python tests in GDB

First find out the required environment variables by running the test outside
the debugger.

ctest -V -R ProcessingQgisAlgorithmsTest

Which prints for somewhere in the initialization code something like:

export LD_LIBRARY_PATH=NOTFOUND:/home/m-kuhn/dev/cpp/qgis/build-qt5/output/lib:
export PYTHONPATH=/home/m-kuhn/dev/cpp/qgis/build-qt5/output/python/:/home/m-kuhn/dev/cpp/qgis/build-qt5/output/python/plugins:/home/m-kuhn/dev/cpp/qgis/QGIS/tests/src/python:

First, run these two commands in the terminal.

On the following line it says something like:

-- Running /usr/bin/python3 /home/m-kuhn/dev/cpp/qgis/QGIS/python/plugins/processing/tests/QgisAlgorithmsTest.py

Which you can run in gdb with:

gdb -ex r --args /usr/bin/python3 /home/m-kuhn/dev/cpp/qgis/QGIS/python/plugins/processing/tests/QgisAlgorithmsTest.py

Now you can start using the usual gdb (`bt` etc.) interface or - if you have
installed the [appropriate debug tools (adjust for python3!)](https://wiki.python.org/moin/DebuggingWithGdb)
even allows doing python introspection (`py-bt`).

0 comments on commit 85146ca

Please sign in to comment.