Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show First 20 Lines • Show All 174 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** | **writing tests** | ||||
Unit tests are run via `make check` | For details on unit tests, see `unit-tests.md` | ||||
For running functional tests, see `/test/README.md` | |||||
Simple example of debugging unit tests with GDB on Linux: | For details on functional tests, see `/test/README.md` | ||||
``` | |||||
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 | |||||
``` | |||||
**writing script integration tests** | **writing script integration tests** | ||||
Script integration tests are built using `src/test/script_tests.cpp`: | Script integration tests are built using `src/test/script_tests.cpp`: | ||||
1. Uncomment the line with `#define UPDATE_JSON_TESTS` | 1. Uncomment the line with `#define UPDATE_JSON_TESTS` | ||||
2. Add a new TestBuilder to the `script_build` test to cover your test case. | 2. Add a new TestBuilder to the `script_build` test to cover your test case. | ||||
3. `make && ./src/test/test_bitcoin --run_test=script_tests` | 3. `make && ./src/test/test_bitcoin --run_test=script_tests` | ||||
▲ Show 20 Lines • Show All 335 Lines • Show Last 20 Lines |