Skip to content

Commit 85146ca

Browse files
committed
Add description for starting python tests in gdb
1 parent 45f4a3e commit 85146ca

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,30 @@ WCS testing information can be found in:
9090
About benchmark tests you can read:
9191

9292
${TOP_SRCDIR}/tests/bench/README
93+
94+
95+
# Run python tests in GDB
96+
97+
First find out the required environment variables by running the test outside
98+
the debugger.
99+
100+
ctest -V -R ProcessingQgisAlgorithmsTest
101+
102+
Which prints for somewhere in the initialization code something like:
103+
104+
export LD_LIBRARY_PATH=NOTFOUND:/home/m-kuhn/dev/cpp/qgis/build-qt5/output/lib:
105+
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:
106+
107+
First, run these two commands in the terminal.
108+
109+
On the following line it says something like:
110+
111+
-- Running /usr/bin/python3 /home/m-kuhn/dev/cpp/qgis/QGIS/python/plugins/processing/tests/QgisAlgorithmsTest.py
112+
113+
Which you can run in gdb with:
114+
115+
gdb -ex r --args /usr/bin/python3 /home/m-kuhn/dev/cpp/qgis/QGIS/python/plugins/processing/tests/QgisAlgorithmsTest.py
116+
117+
Now you can start using the usual gdb (`bt` etc.) interface or - if you have
118+
installed the [appropriate debug tools (adjust for python3!)](https://wiki.python.org/moin/DebuggingWithGdb)
119+
even allows doing python introspection (`py-bt`).

0 commit comments

Comments
 (0)