Changeset View
Changeset View
Standalone View
Standalone View
test/README.md
The [functional](/test/functional/) folder contains a script test_runner | This directory contains integration tests that test bitcoind and its | ||||
to call multiple functional tests from its folder. | utilities in their entirety. It does not contain unit tests, which | ||||
can be found in [/src/test](/src/test), [/src/wallet/test](/src/wallet/test), | |||||
etc. | |||||
There are currently two sets of tests in this directory: | |||||
- [functional](/test/functional) which test the functionality of | |||||
bitcoind and bitcoin-qt by interacting with them through the RPC and P2P | |||||
interfaces. | |||||
- [util](test/util) which tests the bitcoin utilities, currently only | |||||
bitcoin-tx. | |||||
The util tests are run as part of `make check` target. The functional | |||||
tests are run by the travis continuous build process whenever a pull | |||||
request is opened. Both sets of tests can also be run locally. | |||||
Functional Test dependencies | |||||
============================ | |||||
The ZMQ functional test requires a python ZMQ library. To install it: | |||||
Every pull request to the bitcoin repository is built and run through | - on Unix, run `sudo apt-get install python3-zmq` | ||||
the regression test suite. You can also run all or only individual | - on mac OS, run `pip3 install pyzmq` | ||||
tests locally. | |||||
Test dependencies | |||||
================= | |||||
Before running the tests, the following must be installed. | |||||
Unix | |||||
---- | |||||
The python3-zmq library is required. On Ubuntu or Debian it can be installed via: | |||||
``` | |||||
sudo apt-get install python3-zmq | |||||
``` | |||||
OS X | Running tests locally | ||||
------ | ===================== | ||||
``` | |||||
pip3 install pyzmq | |||||
``` | |||||
Running tests | Functional tests | ||||
============= | ---------------- | ||||
You can run any single test by calling | You can run any single test by calling | ||||
test/functional/test_runner.py <testname> | test/functional/test_runner.py <testname> | ||||
Or you can run any combination of tests by calling | Or you can run any combination of tests by calling | ||||
test/functional/test_runner.py <testname1> <testname2> <testname3> ... | test/functional/test_runner.py <testname1> <testname2> <testname3> ... | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
If you get into a bad state, you should be able | If you get into a bad state, you should be able | ||||
to recover with: | to recover with: | ||||
```bash | ```bash | ||||
rm -rf cache | rm -rf cache | ||||
killall bitcoind | killall bitcoind | ||||
``` | ``` | ||||
Writing tests | Util tests | ||||
============= | ---------- | ||||
You are encouraged to write tests for new or existing features. | |||||
Util tests can be run locally by running `test/util/bitcoin-util-test.py`. | |||||
Use the `-v` option for verbose output. | |||||
Writing functional tests | |||||
======================== | |||||
Further information about the test framework and individual functional | You are encouraged to write functional tests for new or existing features. | ||||
Further information about the functional test framework and individual | |||||
tests is found in [test/functional](/test/functional). | tests is found in [test/functional](/test/functional). |