dash/src/test
2021-08-11 19:55:26 +03:00
..
data Fix more spelling errors 2021-07-19 12:52:03 -05:00
fuzz bitcoin#17225: Test serialisation as part of deserialisation fuzzing. Test round-trip equality where possible 2021-08-11 09:48:41 +05:30
addrman_tests.cpp Merge #14624: Some simple improvements to the RNG code 2021-07-19 19:00:04 -05:00
allocator_tests.cpp Merge #14287: tests: Use MakeUnique to construct objects owned by unique_ptrs 2021-06-28 21:05:29 -04:00
amount_tests.cpp Merge #14460: tests: Improve 'CAmount' tests 2021-06-28 21:05:29 -04:00
arith_uint256_tests.cpp
base32_tests.cpp
base58_tests.cpp
base64_tests.cpp
bech32_tests.cpp
bip32_tests.cpp
bip39_tests.cpp
blockchain_tests.cpp
blockencodings_tests.cpp scripted-diff: Remove unused first argument to addUnchecked END 13792 2021-07-19 17:11:16 -05:00
blockfilter_tests.cpp Merge #14307: Consolidate redundant implementations of ParseHashStr 2021-08-04 00:25:04 -03:00
bloom_tests.cpp
bls_tests.cpp
bswap_tests.cpp
cachemap_tests.cpp
cachemultimap_tests.cpp
checkdatasig_tests.cpp
checkqueue_tests.cpp merge #16117: Replace boost sleep with std sleep 2021-08-05 16:13:47 +05:30
coins_tests.cpp Merge bitcoin#14771: test: Add BOOST_REQUIRE to getters returning optional (#4297) 2021-07-29 00:53:44 -05:00
compress_tests.cpp
crypto_tests.cpp Merge #14047: Add HKDF_HMAC256_L32 and method to negate a private key 2021-08-10 23:55:56 +03:00
cuckoocache_tests.cpp Merge #14624: Some simple improvements to the RNG code 2021-07-19 19:00:04 -05:00
dbwrapper_tests.cpp Merge bitcoin#14771: test: Add BOOST_REQUIRE to getters returning optional (#4297) 2021-07-29 00:53:44 -05:00
denialofservice_tests.cpp Merge #14953: test: Make g_insecure_rand_ctx thread_local 2021-08-03 18:39:34 -03:00
descriptor_tests.cpp Merge pull request #4303 from linuxsh2/backport/batch-1 2021-08-06 16:23:59 -05:00
dip0020opcodes_tests.cpp fix misc. spelling errors 2021-07-19 12:51:30 -05:00
evo_deterministicmns_tests.cpp refactor: misc bls, evo, include refactoring (#4305) 2021-07-31 21:29:12 +03:00
evo_simplifiedmns_tests.cpp
fs_tests.cpp merge #21052: Replace fs::unique_path with GetUniquePath(path) calls 2021-08-09 12:38:04 +05:30
getarg_tests.cpp Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2021-07-19 17:11:18 -05:00
governance_validators_tests.cpp
hash_tests.cpp tests: reenable when backporting Bitcoin #10321 (#4273) 2021-07-19 12:36:30 +03:00
key_io_tests.cpp Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2021-07-19 17:11:18 -05:00
key_tests.cpp Merge #14047: Add HKDF_HMAC256_L32 and method to negate a private key 2021-08-10 23:55:56 +03:00
lcg.h
limitedmap_tests.cpp
logging_tests.cpp
main.cpp bitcoin#15504: Link BasicTestingSetup (shared with unit tests) 2021-08-11 09:48:40 +05:30
Makefile
mempool_tests.cpp scripted-diff: Remove unused first argument to addUnchecked END 13792 2021-07-19 17:11:16 -05:00
merkle_tests.cpp
merkleblock_tests.cpp
miner_tests.cpp Merge #13783: validation: Pass tx pool reference into CheckSequenceLocks 2021-07-26 09:57:19 -04:00
multisig_tests.cpp
net_tests.cpp partial Merge #14094: refactoring: Remove unreferenced local variables 2021-07-19 17:11:17 -05:00
netbase_tests.cpp Merge #16248: Make whitebind/whitelist permissions more flexible 2021-07-19 19:00:04 -05:00
pmt_tests.cpp
policyestimator_tests.cpp scripted-diff: Remove unused first argument to addUnchecked END 13792 2021-07-19 17:11:16 -05:00
pow_tests.cpp Merge #14684: [doc] conf: Remove deprecated options from docs, Other cleanup 2021-08-03 11:42:08 -04:00
prevector_tests.cpp Merge #14624: Some simple improvements to the RNG code 2021-07-19 19:00:04 -05:00
raii_event_tests.cpp Merge #16564: test: Always define the raii_event_tests test suite 2021-07-15 13:26:07 -05:00
random_tests.cpp Merge #14624: Some simple improvements to the RNG code 2021-07-19 19:00:04 -05:00
ratecheck_tests.cpp
README.md Merge #16752: doc: Delete stale URL in test README 2021-07-12 20:52:56 -05:00
reverselock_tests.cpp
rpc_tests.cpp Merge #13918: rpc: Replace median fee rate with feerate percentiles in getblockstats 2021-07-06 20:29:32 +03:00
sanity_tests.cpp
scheduler_tests.cpp merge #16117: Replace boost sleep with std sleep 2021-08-05 16:13:47 +05:30
script_p2pk_tests.cpp
script_p2pkh_tests.cpp
script_p2sh_tests.cpp Merge #17254: test: fix script_p2sh_tests OP_PUSHBACK2/4 missing 2021-07-13 20:43:16 -05:00
script_standard_tests.cpp
script_tests.cpp Merge #13767: Remove redundant assignments (dead stores) 2021-08-03 13:57:37 -03:00
scriptnum10.h
scriptnum_tests.cpp
serialize_tests.cpp Merge #14838: Use const in COutPoint class 2021-07-08 11:57:10 -05:00
sighash_tests.cpp Merge #14838: Use const in COutPoint class 2021-07-08 11:57:10 -05:00
sigopcount_tests.cpp
skiplist_tests.cpp Merge bitcoin#14636: Avoid using numeric_limits for sequence numbers and lock times (#4296) 2021-07-28 09:16:46 -05:00
streams_tests.cpp Merge bitcoin/bitcoin#21581: streams: Accept URef obj for VectorReader unserialize 2021-07-15 16:01:43 -05:00
subsidy_tests.cpp
sync_tests.cpp
test_dash.cpp bitcoin#15504: Link BasicTestingSetup (shared with unit tests) 2021-08-11 09:48:40 +05:30
test_dash.h bitcoin#15504: Link BasicTestingSetup (shared with unit tests) 2021-08-11 09:48:40 +05:30
timedata_tests.cpp
torcontrol_tests.cpp
transaction_tests.cpp Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2021-07-19 17:11:18 -05:00
txindex_tests.cpp merge #16117: Replace boost sleep with std sleep 2021-08-05 16:13:47 +05:30
txvalidation_tests.cpp Merge #13534: Don't assert(foo()) where foo() has side effects 2021-06-28 22:09:56 -04:00
txvalidationcache_tests.cpp Merge #18010: test: rename test suite name "tx_validationcache_tests" to match filename 2021-07-15 11:07:36 -05:00
uint256_tests.cpp
util_tests.cpp merge #21052: Replace fs::unique_path with GetUniquePath(path) calls 2021-08-09 12:38:04 +05:30
util_threadnames_tests.cpp
validation_block_tests.cpp Merge pull request #4229 from kittywhiskers/auxports 2021-08-10 22:34:17 +03:00
validation_tests.cpp bitcoin#15504: Link BasicTestingSetup (shared with unit tests) 2021-08-11 09:48:40 +05:30
versionbits_tests.cpp Merge #13555: Tests: parameterize adjustment period in versionbits_computeblockversion 2021-07-12 17:11:08 -05:00

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 test_dash.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.