zcashd/src/test
Per Grön 4bffaf040c Be consistent with how to #include test data headers
It helps the Bazel scripts to not have multiple search paths to a
single header, and it seems to be the right thing to do anyway.
2018-01-23 07:44:05 +01:00
..
data Repair tests for strict DER signatures. 2017-06-19 16:32:15 +01:00
DoS_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Makefile
README.md Clarification of unit test build instructions. 2015-10-14 08:21:55 +00:00
accounting_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
addrman_tests.cpp Increase test coverage for addrman and addrinfo 2016-05-24 12:55:33 -07:00
alert_tests.cpp Be consistent with how to #include test data headers 2018-01-23 07:44:05 +01:00
allocator_tests.cpp
arith_uint256_tests.cpp
base32_tests.cpp
base58_tests.cpp Be consistent with how to #include test data headers 2018-01-23 07:44:05 +01:00
base64_tests.cpp
bctest.py
bignum.h Assert that new OpenSSL allocators succeed 2016-09-29 17:58:29 +13:00
bip32_tests.cpp extend bip32 tests to cover Base58c/CExtKey decode 2017-03-03 10:57:25 -08:00
bitcoin-util-test.py
bloom_tests.cpp Remove #1144 from bloom_tests by reverting to commit 5012190. 2016-09-07 15:12:09 -07:00
buildenv.py.in
checkblock_tests.cpp Skip JoinSplit verification before the last checkpoint 2016-12-09 21:06:45 +13:00
coins_tests.cpp Separate core memory usage computation in core_memusage.h 2017-03-14 13:45:05 +13:00
compress_tests.cpp
crypto_tests.cpp
equihash_tests.cpp Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
getarg_tests.cpp
hash_tests.cpp
key_tests.cpp Re-encode hard-coded addresses in tests 2016-10-03 23:53:14 -07:00
main_tests.cpp Update tests to account for decreased block interval 2016-06-10 12:02:47 +12:00
mempool_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
miner_tests.cpp Explicitly set tx.nVersion for the genesis block and mining tests 2018-01-22 10:30:41 -05:00
mruset_tests.cpp
multisig_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
netbase_tests.cpp add unit test for CNetAddr::GetGroup. 2015-09-22 00:43:14 +00:00
pmt_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
policyestimator_tests.cpp Update tests to check actual infinity as well as INF_FEERATE 2017-04-13 17:59:36 +01:00
pow_tests.cpp Update tests for new genesis blocks 2016-10-28 02:56:15 -07:00
raii_event_tests.cpp Skip RAII event tests if libevent is built without event_set_mem_functions 2017-03-24 09:03:59 +13:00
reverselock_tests.cpp c++11: don't throw from the reverselock destructor 2017-11-29 17:24:59 +00:00
rpc_tests.cpp Get rid of implicit hidden dependencies between test .cpp files 2018-01-23 07:43:51 +01:00
rpc_wallet_tests.cpp Don't clobber cwd in rpc_wallet_tests.cpp 2018-01-23 07:44:05 +01:00
sanity_tests.cpp
scheduler_tests.cpp Update to address @daira comments wrt fixing configure.ac 2017-11-23 11:58:25 -05:00
script_P2SH_tests.cpp Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
script_tests.cpp Be consistent with how to #include test data headers 2018-01-23 07:44:05 +01:00
scriptnum_tests.cpp Make CScriptNum() take nMaxNumSize as an argument 2015-10-08 17:46:55 +02:00
serialize_tests.cpp New implementation of incremental merkle tree 2016-04-28 16:07:52 -06:00
sha256compress_tests.cpp Remove unused code in libzerocash util.cpp 2016-05-18 11:22:29 -06:00
sighash_tests.cpp Be consistent with how to #include test data headers 2018-01-23 07:44:05 +01:00
sigopcount_tests.cpp
skiplist_tests.cpp
test_bitcoin.cpp Remove crusty old "loadVerifyingKey"/"loadProvingKey" APIs and associated invariants. 2017-10-21 15:42:41 +03:00
test_bitcoin.h Fix NPE in rpc_wallet_tests 2017-11-05 12:02:21 -05:00
test_util.cpp Get rid of implicit hidden dependencies between test .cpp files 2018-01-23 07:43:51 +01:00
test_util.h Get rid of implicit hidden dependencies between test .cpp files 2018-01-23 07:43:51 +01:00
timedata_tests.cpp
torcontrol_tests.cpp Check that >3-digit octals are truncated. 2017-04-21 13:23:29 +12:00
transaction_tests.cpp Be consistent with how to #include test data headers 2018-01-23 07:44:05 +01:00
uint256_tests.cpp
univalue_tests.cpp UniValue: don't escape solidus, keep espacing of reverse solidus 2017-03-02 13:23:03 -08:00
util_tests.cpp rpc: Accept scientific notation for monetary amounts in JSON 2017-02-10 02:18:58 +00:00

README.md

Notes

The sources in this directory are unit test cases. Boost includes a unit testing framework, and since bitcoin already uses boost, it makes sense to simply use this framework rather than require developers to configure some other framework (we want as few impediments to creating unit tests as possible).

The build system is setup to compile an executable called "test_bitcoin" that runs all of the unit tests. The main source file is called test_bitcoin.cpp, which simply includes other files that contain the actual unit tests (outside of a couple required preprocessor directives). The pattern is to create one test file for each class or source file for which you want to create unit tests. The file naming convention is "<source_filename>_tests.cpp" and such files should wrap their tests in a test suite called "<source_filename>_tests". For an examples of this pattern, examine uint160_tests.cpp and uint256_tests.cpp.

Add the source files to /src/Makefile.test.include to add them to the build.

For further reading, I found the following website to be helpful in explaining how the boost unit test framework works: http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/.