Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
error and debugging messages are written there. | error and debugging messages are written there. | ||||
The -debug=... command-line option controls debugging; running with just -debug or -debug=1 will turn | The -debug=... command-line option controls debugging; running with just -debug or -debug=1 will turn | ||||
on all categories (and give you a very large debug.log file). | on all categories (and give you a very large debug.log file). | ||||
The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt | The Qt code routes qDebug() output to debug.log under category "qt": run with -debug=qt | ||||
to see it. | 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** | **testnet and regtest modes** | ||||
Run with the -testnet option to run with "play bitcoins" on the test network, if you | Run with the -testnet option to run with "play bitcoins" on the test network, if you | ||||
are testing multi-machine code that needs to operate across the internet. | are testing multi-machine code that needs to operate across the internet. | ||||
If you are testing something that can run on one machine, run with the -regtest option. | If you are testing something that can run on one machine, run with the -regtest option. | ||||
In regression test mode, blocks can be created on-demand; see test/functional/ for tests | In regression test mode, blocks can be created on-demand; see test/functional/ for tests | ||||
that run in -regtest mode. | that run in -regtest mode. | ||||
▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines |