zcash-patched-for-explorer/src/test
Jack Grigg 554e00e8f9
Disable Sapling features on mainnet
Also places them behind an experimental features flag on testnet
2018-08-13 14:18:18 +01:00
..
data Add json test vectors for Sapling key components. 2018-06-13 10:38:32 -07:00
Checkpoints_tests.cpp
DoS_tests.cpp
Makefile
README.md
accounting_tests.cpp
addrman_tests.cpp
alert_tests.cpp move rpc* to rpc/ 2018-07-18 11:07:16 -06:00
allocator_tests.cpp
arith_uint256_tests.cpp
base32_tests.cpp Simplify Base32 and Base64 conversions 2018-06-07 17:19:43 +12:00
base58_tests.cpp Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
base64_tests.cpp Simplify Base32 and Base64 conversions 2018-06-07 17:19:43 +12:00
bctest.py
bech32_tests.cpp Raise the 90-character limit on Bech32 encodings 2018-07-30 16:01:22 +01:00
bignum.h
bip32_tests.cpp Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
bitcoin-util-test.py Use portable #! in python scripts (/usr/bin/env) 2018-06-05 21:56:13 +12:00
bloom_tests.cpp Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
buildenv.py.in Use portable #! in python scripts (/usr/bin/env) 2018-06-05 21:56:13 +12:00
checkblock_tests.cpp
coins_tests.cpp Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
compress_tests.cpp
convertbits_tests.cpp Generalize ConvertBits 2018-06-07 17:19:34 +12:00
crypto_tests.cpp
dbwrapper_tests.cpp Get rid of nType and nVersion 2018-04-17 13:09:28 +01:00
equihash_tests.cpp
getarg_tests.cpp
hash_tests.cpp
key_tests.cpp test: Use regtest in key_tests/zs_address_test 2018-08-13 14:17:17 +01:00
main_tests.cpp
mempool_tests.cpp
miner_tests.cpp Fix miner tests 2018-05-07 14:37:46 -06:00
mruset_tests.cpp
multisig_tests.cpp
netbase_tests.cpp
pmt_tests.cpp [test] Remove unused code 2018-05-04 10:27:11 +01:00
policyestimator_tests.cpp
pow_tests.cpp
prevector_tests.cpp
raii_event_tests.cpp
reverselock_tests.cpp
rpc_tests.cpp Add tests for expiryheight parameter of RPC createrawtransaction. 2018-07-30 10:24:10 -07:00
rpc_wallet_tests.cpp Disable Sapling features on mainnet 2018-08-13 14:18:18 +01:00
sanity_tests.cpp
scheduler_tests.cpp
script_P2SH_tests.cpp
script_tests.cpp
scriptnum_tests.cpp
serialize_tests.cpp Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
sha256compress_tests.cpp
sighash_tests.cpp Improve/Fix variable names 2018-06-09 20:27:35 -07:00
sigopcount_tests.cpp
skiplist_tests.cpp
test_bitcoin.cpp Switch to use the official Sapling parameters. 2018-08-04 16:28:39 -06:00
test_bitcoin.h
timedata_tests.cpp
torcontrol_tests.cpp
transaction_tests.cpp Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
uint256_tests.cpp Get rid of nType and nVersion 2018-04-17 13:09:28 +01:00
univalue_tests.cpp
util_tests.cpp [test] Remove unused code 2018-05-04 10:27:11 +01: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/.