Merge #10152: [trivial] remove unused line in Travis config
[bitcoinplatinum.git] / test / README.md
blobdec8db960d399c52c0bacebc7070db9d33ea8a09
1 This directory contains integration tests that test bitcoind and its
2 utilities in their entirety. It does not contain unit tests, which
3 can be found in [/src/test](/src/test), [/src/wallet/test](/src/wallet/test),
4 etc.
6 There are currently two sets of tests in this directory:
8 - [functional](/test/functional) which test the functionality of 
9 bitcoind and bitcoin-qt by interacting with them through the RPC and P2P
10 interfaces.
11 - [util](test/util) which tests the bitcoin utilities, currently only
12 bitcoin-tx.
14 The util tests are run as part of `make check` target. The functional
15 tests are run by the travis continuous build process whenever a pull
16 request is opened. Both sets of tests can also be run locally.
18 Functional Test dependencies
19 ============================
20 The ZMQ functional test requires a python ZMQ library. To install it:
22 - on Unix, run `sudo apt-get install python3-zmq`
23 - on mac OS, run `pip3 install pyzmq`
25 Running tests locally
26 =====================
28 Functional tests
29 ----------------
31 You can run any single test by calling
33     test/functional/test_runner.py <testname>
35 Or you can run any combination of tests by calling
37     test/functional/test_runner.py <testname1> <testname2> <testname3> ...
39 Run the regression test suite with
41     test/functional/test_runner.py
43 Run all possible tests with
45     test/functional/test_runner.py --extended
47 By default, tests will be run in parallel. To specify how many jobs to run,
48 append `--jobs=n` (default n=4).
50 If you want to create a basic coverage report for the RPC test suite, append `--coverage`.
52 Possible options, which apply to each individual test run:
54 ```
55   -h, --help            show this help message and exit
56   --nocleanup           Leave bitcoinds and test.* datadir on exit or error
57   --noshutdown          Don't stop bitcoinds after the test execution
58   --srcdir=SRCDIR       Source directory containing bitcoind/bitcoin-cli
59                         (default: ../../src)
60   --tmpdir=TMPDIR       Root directory for datadirs
61   --tracerpc            Print out all RPC calls as they are made
62   --coveragedir=COVERAGEDIR
63                         Write tested RPC commands into this directory
64 ```
66 If you set the environment variable `PYTHON_DEBUG=1` you will get some debug
67 output (example: `PYTHON_DEBUG=1 test/functional/test_runner.py wallet`).
69 A 200-block -regtest blockchain and wallets for four nodes
70 is created the first time a regression test is run and
71 is stored in the cache/ directory. Each node has 25 mature
72 blocks (25*50=1250 BTC) in its wallet.
74 After the first run, the cache/ blockchain and wallets are
75 copied into a temporary directory and used as the initial
76 test state.
78 If you get into a bad state, you should be able
79 to recover with:
81 ```bash
82 rm -rf cache
83 killall bitcoind
84 ```
86 Util tests
87 ----------
89 Util tests can be run locally by running `test/util/bitcoin-util-test.py`. 
90 Use the `-v` option for verbose output.
92 Writing functional tests
93 ========================
95 You are encouraged to write functional tests for new or existing features.
96 Further information about the functional test framework and individual 
97 tests is found in [test/functional](/test/functional).