diff --git a/doc/developer-notes.md b/doc/developer-notes.md --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -126,6 +126,30 @@ The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt to see it. +**running and debugging tests** + +Unit tests are run via `make check` +For running functional tests, see `/test/README.md` + +Simple example of debugging unit tests with GDB on Linux: +``` +cd /build/src/test +gdb test_bitcoin +break interpreter.cpp:295 # No path is necessary, just the file name and line number +run +# GDB hits the breakpoint +p/x opcode # print the value of the variable (in this case, opcode) in hex +c # continue +``` + +Simple example of debugging unit tests with LLDB (OSX or Linux): +``` +cd /build/src/test +lldb -- test_bitcoin +break set --file interpreter.cpp --line 295 +run +``` + **testnet and regtest modes** Run with the -testnet option to run with "play bitcoins" on the test network, if you