dash/src/test
2021-12-05 15:47:46 +05:30
..
data
fuzz Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
addrman_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
allocator_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
amount_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
arith_uint256_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
base32_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
base58_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
base64_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
bech32_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
bip32_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
bip39_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
blockchain_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
blockencodings_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
blockfilter_index_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
blockfilter_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
bloom_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
bls_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
bswap_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
cachemap_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
cachemultimap_tests.cpp fix: resolve numerous compilation warnings under -Wall (#4599) 2021-12-01 22:59:34 +03:00
checkdatasig_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
checkqueue_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
coins_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
compilerbug_tests.cpp Merge #15985: Add test for GCC bug 90348 2021-11-09 14:08:50 -05:00
compress_tests.cpp Merge #17220: tests: Add unit testing for the CompressScript function 2021-11-03 12:24:05 -04:00
crypto_tests.cpp partial Merge #15919: Remove unused OpenSSL includes to make it more clear where OpenSSL is used 2021-11-21 07:13:12 +05:30
cuckoocache_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
dbwrapper_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
denialofservice_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
descriptor_tests.cpp merge bitcoin#16570: Make descriptor tests deterministic 2021-12-05 15:47:46 +05:30
dip0020opcodes_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
evo_deterministicmns_tests.cpp Merge pull request #4511 from kittywhiskers/bench 2021-10-25 22:58:54 +03:00
evo_simplifiedmns_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
flatfile_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
fs_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
getarg_tests.cpp merge bitcoin#16097: Add Flags enum to ArgsManager class (#4569) 2021-11-12 19:25:46 -05:00
governance_validators_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
hash_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
key_io_tests.cpp Merge pull request #4511 from kittywhiskers/bench 2021-10-25 22:58:54 +03:00
key_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
lcg.h
limitedmap_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
logging_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
main.cpp
Makefile
mempool_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
merkle_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
merkleblock_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
miner_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
multisig_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
net_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
netbase_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
pmt_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
policyestimator_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
pow_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
prevector_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
raii_event_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
random_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
ratecheck_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
README.md merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
reverselock_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
rpc_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
sanity_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
scheduler_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
script_p2pk_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
script_p2pkh_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
script_p2sh_tests.cpp merge bitcoin#15638: Pull wallet code out of libbitcoin_server (#4560) 2021-11-16 10:19:47 -05:00
script_standard_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
script_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
scriptnum10.h Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
scriptnum_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
serialize_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
setup_common.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
setup_common.h Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
sighash_tests.cpp merge bitcoin#15638: Pull wallet code out of libbitcoin_server (#4560) 2021-11-16 10:19:47 -05:00
sigopcount_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
skiplist_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
streams_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
subsidy_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
sync_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
timedata_tests.cpp Merge #16563: test: Add unit test for AddTimeData 2021-11-03 12:24:04 -04:00
torcontrol_tests.cpp Merge pull request #4511 from kittywhiskers/bench 2021-10-25 22:58:54 +03:00
transaction_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
txindex_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
txvalidation_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
txvalidationcache_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
uint256_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
util_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
util_threadnames_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
util.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
util.h partial bitcoin#15779: wallet_balance benchmark 2021-10-25 21:28:37 +05:30
validation_block_tests.cpp Merge #16278: tests: Remove unused includes (#4528) 2021-11-30 00:53:40 -05:00
validation_flush_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
validation_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30
versionbits_tests.cpp merge bitcoin#15788: Unify testing setups for fuzz, bench, and unit tests 2021-10-25 21:28:37 +05:30

Compiling/running unit tests

Unit tests will be automatically compiled if dependencies were met in ./configure and tests weren't explicitly disabled.

After configuring, they can be run with make check.

To run the dashd tests manually, launch src/test/test_dash. To recompile after a test file was modified, run make and then run the test again. If you modify a non-test file, use make -C src/test to recompile only what's needed to run the dashd tests.

To add more dashd tests, add BOOST_AUTO_TEST_CASE functions to the existing .cpp files in the test/ directory or add new .cpp files that implement new BOOST_AUTO_TEST_SUITE sections.

To run the dash-qt tests manually, launch src/qt/test/test_dash-qt

To add more dash-qt tests, add them to the src/qt/test/ directory and the src/qt/test/test_main.cpp file.

Running individual tests

test_dash has some built-in command-line arguments; for example, to run just the getarg_tests verbosely:

test_dash --log_level=all --run_test=getarg_tests

... or to run just the doubledash test:

test_dash --run_test=getarg_tests/doubledash

Run test_dash --help for the full list.

Note on adding test cases

The sources in this directory are unit test cases. Boost includes a unit testing framework, and since Dash Core 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_dash that runs all of the unit tests. The main source file is called setup_common.cpp. To add a new unit test file to our test suite you need to add the file to src/Makefile.test.include. 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 example of this pattern, examine uint256_tests.cpp.