aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.test.include
AgeCommit message (Collapse)Author
2018-03-13Add tests for the Branch and Bound algorithmAndrew Chow
2018-02-19Split off key_io_tests from base58_testsPieter Wuille
2017-12-23Merge #11748: [Tests] Adding unit tests for GetDifficulty in blockchain.cpp.Wladimir J. van der Laan
3e1ee31 [Tests] Adding unit tests for GetDifficulty in blockchain.cpp. (sean) Pull request description: blockchain.cpp has low unit test coverage. This commit is intended to start improving its code coverage to reasonable levels. One or more follow up commits will complete the task that this commit is starting (though the usefulness of this commit is not dependent upon later commits). Note that these tests were not written based upon a specification of how GetDifficulty *should* work, but rather how it actually *does* work. As a result, if there are any bugs in the current GetDifficulty implementation, these unit tests serve to lock them in rather than expose them. -- Why has blockchain.cpp been modified if this is a unit testing change? Since the existing GetDifficulty function relies on a global variable, chainActive, it was not suitable for unit testing purposes. Both the existing GetDifficulty function and the unit tests now call through to a new, more modular version of GetDifficulty that can work on any chain, not just chainActive. -- Why does blockchain_tests.cpp directly include blockchain.cpp instead of blockchain.h? While the new GetDifficulty function's signature is arguably better than the old one's, it still isn't great, and doesn't seem to warrant inclusion as part of the blockchain.h API, especially since only test code is directly using it. If a better way of exposing the new GetDifficulty function to unit tests exists, please mention it and the commit will be updated accordingly. -- Why is the test fixture named blockchain_difficulty_tests rather than blockchain_tests? The Bitcoin Core policy for naming unit test files is to match the the file under test ("blockchain" becomes "blockchain_tests"). While this commit complies with that, blockchain.cpp is a massive file, such that having all of the unit tests in one file will tend towards disorder. Since there will be a lot more tests added to this file, the intention is to divide up different types of tests into different test fixtures within the same file. Tree-SHA512: a7dda9c2a9414d4819b4d2911f5637891dc19cecbecfc1463846161d2a78793151927a5ab911c69a5d3013f7668e75a1d78a65667cb9d83910cda439cbe84d62
2017-12-12[tests] remove redundant univalue_tests.cppJohn Newbery
2017-11-22[Tests] Adding unit tests for GetDifficulty in blockchain.cpp.sean
blockchain.cpp has low unit test coverage. This commit is intended to start improving its code coverage to reasonable levels. One or more follow up commits will complete the task that this commit is starting (though the usefulness of this commit is not dependent upon later commits). Note that these tests were not written based upon a specification of how GetDifficulty *should* work, but rather how it actually *does* work. As a result, if there are any bugs in the current GetDifficulty implementation, these unit tests serve to lock them in rather than expose them. -- Why has blockchain.cpp been modified if this is a unit testing change? Since the existing GetDifficulty function relies on a global variable, chainActive, it was not suitable for unit testing purposes. Both the existing GetDifficulty function and the unit tests now call through to a new, more modular version of GetDifficulty that can work on any chain, not just chainActive. -- Why does blockchain_tests.cpp directly include blockchain.cpp instead of blockchain.h? While the new GetDifficulty function's signature is arguably better than the old one's, it still isn't great, and doesn't seem to warrant inclusion as part of the blockchain.h API, especially since only test code is directly using it. If a better way of exposing the new GetDifficulty function to unit tests exists, please mention it and the commit will be updated accordingly. -- Why is the test fixture named blockchain_difficulty_tests rather than blockchain_tests? The Bitcoin Core policy for naming unit test files is to match the the file under test ("blockchain" becomes "blockchain_tests"). While this commit complies with that, blockchain.cpp is a massive file, such that having all of the unit tests in one file will tend towards disorder. Since there will be a lot more tests added to this file, the intention is to divide up different types of tests into different test fixtures within the same file.
2017-11-18[tests] Test that mempool rejects coinbase transactionsJames O'Beirne
2017-11-16build: Remove -I for everything but project rootWladimir J. van der Laan
Remove -I from build system for everything but the project root, and built-in dependencies.
2017-10-03Merge #11433: qa: Restore bitcoin-util-test py2 compatibilityMarcoFalke
fafff1220 qa: Restore bitcoin-util-test py2 compatibility (MarcoFalke) Pull request description: Currently `./configure && make check` will look for python3, then python2. As long as we support python2 (and use it as fallback), `make check` should run fine with both python2 and python3. Fixes #11352 by @Zenitur Tree-SHA512: a335ebdd224328d6f924fe52a9b97de196926476c9ee04ce3280743ea93bcae355eb2d5d4bed4050c01b2e904105595eac7db2eaa9307207581caa0a98ebcc0b
2017-10-03Merge #11293: Deduplicate CMerkleBlock construction code, add test coverageMarcoFalke
46ce223d1 Add tests for CMerkleBlock usage with txids specified (James O'Beirne) 5ab586f90 Consolidate CMerkleBlock constructor into a single method (James O'Beirne) Pull request description: What started as a simple task to add test coverage ended up giving way to a light refactoring. This consolidates the mostly-identical `CMerkleBlock` constructors into one (using C++11 constructor delegation) and adds coverage for the by-txids construction case. ### Before ![selection_006](https://user-images.githubusercontent.com/73197/30242104-0f381fe4-9545-11e7-9617-83b87fce0456.png) ### After ![selection_008](https://user-images.githubusercontent.com/73197/30242107-1425dfaa-9545-11e7-9e6b-2c3432517dd1.png) Tree-SHA512: eed84ed3e8bfc43473077b575c8252759a857e37275e4b36ca7cc2c17a65895e5f494bfd9d4aeab09fc6e98fc6a9c641ac7ecc0ddbeefe01a9e4308e7909e529
2017-10-01qa: Restore bitcoin-util-test py2 compatibilityMarcoFalke
2017-09-28Import Bech32 C++ reference code & testsPieter Wuille
This includes a reformatted version of the Bech32 reference code (see https://github.com/sipa/bech32/tree/master/ref/c%2B%2B), with extra documentation.
2017-09-21[script] Unit tests for script/standard functionsJim Posen
2017-09-20Add tests for CMerkleBlock usage with txids specifiedJames O'Beirne
2017-09-05Remove redundant testutil filesMeshCollider
2017-07-17Fix test_bitcoin circular dependency issueJonas Schnelli
2017-06-13Merge #10544: Update to LevelDB 1.20Wladimir J. van der Laan
3ee3d04 Add extra LevelDB source to Makefile (MarcoFalke) 2424989 leveldb: enable runtime-detected crc32 instructions (Cory Fields) cf44e4c Squashed 'src/leveldb/' changes from a31c8aa40..196962ff0 (Pieter Wuille) Tree-SHA512: 19ade77e3f6265507b3ab7b9aa5150d378aa0751e24ac7a61567b0f720a566cedc6c3d3336da17a3bd2b5d068ee86600d96a15228f78bd20ccf98c8fc9041a91
2017-06-09leveldb: enable runtime-detected crc32 instructionsCory Fields
2017-06-07Merge #10321: Use FastRandomContext for all testsPieter Wuille
e94584858 scripted-diff: Use new naming style for insecure_rand* functions (Pieter Wuille) 2fcd9cc86 scripted-diff: Use randbits/bool instead of randrange where possible (Pieter Wuille) 2ada67852 Use randbits instead of ad-hoc emulation in prevector tests (Pieter Wuille) 5f0b04eed Replace rand() & ((1 << N) - 1) with randbits(N) (Pieter Wuille) 3ecabae36 Replace more rand() % NUM by randranges (Pieter Wuille) efee1db21 scripted-diff: use insecure_rand256/randrange more (Pieter Wuille) 1119927df Add various insecure_rand wrappers for tests (Pieter Wuille) 124d13a58 Merge test_random.h into test_bitcoin.h (Pieter Wuille) 90620d66c scripted-diff: Rename cuckoo tests' local rand context (Pieter Wuille) 37e864eb9 Add FastRandomContext::rand256() and ::randbytes() (Pieter Wuille) Tree-SHA512: d09705a3ec718ae792f7d66a75401903ba7b9c9d3fc36669d6e3b9242f0194738106be26baefc8a8e3fa6df7c9a35978c71c0c430278a028b331df23a3ea3070
2017-06-06Merge #10331: Share config between util and functional testsMarcoFalke
8ad5bde Merge bctest.py into bitcoin-util-test.py (John Newbery) 95836c5 Use shared config file for functional and util tests (John Newbery) 89fcd35 Use an .ini config file for environment vars in bitcoin-util-test.py (John Newbery) e9265df Change help_text in bitcoin-util-test.py to a docstring. (John Newbery) ce58e93 Change bitcoin-util-test.py to use Python3 (John Newbery) Tree-SHA512: 66dab0b4a8546aee0dfaef134a165f1447aff4c0ec335754bbc7d9e55909721c62f09cdbf4b22d02ac1fcd5a9b66780f91e1cc4d8687fae7288cc9072a23a78f
2017-06-05Merge test_random.h into test_bitcoin.hPieter Wuille
2017-05-16torcontrol: Add unit tests for Tor reply parsersJack Grigg
2017-05-03Change bitcoin-util-test.py to use Python3John Newbery
2017-04-24Merge #9792: FastRandomContext improvements and switch to ChaCha20Wladimir J. van der Laan
4fd2d2f Add a FastRandomContext::randrange and use it (Pieter Wuille) 1632922 Switch FastRandomContext to ChaCha20 (Pieter Wuille) e04326f Add ChaCha20 (Pieter Wuille) 663fbae FastRandom benchmark (Pieter Wuille) c21cbe6 Introduce FastRandomContext::randbool() (Pieter Wuille) Tree-SHA512: 7fff61e3f6d6dc6ac846ca643d877b377db609646dd401a0e8f50b052c6b9bcd2f5fc34de6bbf28f04afd1724f6279ee163ead5f37d724fb782a00239f35db1d
2017-04-10allow libevent logging to be updated during runtimeJohn Newbery
2017-03-29Switch FastRandomContext to ChaCha20Pieter Wuille
2017-03-20Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.pyJohn Newbery
2017-03-17Merge #9974: Add basic Qt wallet testJonas Schnelli
9576b01 Enable xvfb in travis to allow running test_bitcoin-qt (Russell Yanofsky) 9e6817e Add new test_bitcoin-qt static library dependencies (Russell Yanofsky) 2754ef1 Add simple qt wallet test sending a transaction (Russell Yanofsky) b61b34c Add braces to if statements in Qt test_main (Russell Yanofsky) cc9503c Make qt test compatible with TestChain100Setup framework (Russell Yanofsky) 91e3035 Make test_bitcoin.cpp compatible with Qt Test framework (Russell Yanofsky) Tree-SHA512: da491181848b8c39138e997ae5ff2df0b16eef2d9cdd0a965229b1a28d4fa862d5f1ef314a1736e5050e88858f329124d15c689659fc6e50fefde769ba24e523
2017-03-14Merge #9497: CCheckQueue Unit TestsWladimir J. van der Laan
96c7f2c Add CheckQueue Tests (Jeremy Rubin) e207342 Fix CCheckQueue IsIdle (potential) race condition and remove dangerous constructors. (Jeremy Rubin) Tree-SHA512: 5989743ad0f8b08998335e7ca9256e168fa319053f91b9dece9dbb134885bef7753b567b591acc7135785f23d19799ed7e6375917f59fe0178d389e961633d62
2017-03-10Make test_bitcoin.cpp compatible with Qt Test frameworkRussell Yanofsky
Move Boost.Test main function and global overrides to a new test_bitcoin_main.cpp file.
2017-02-21util: Specific GetOSRandom for Linux/FreeBSD/OpenBSDWladimir J. van der Laan
These are available in sandboxes without access to files or devices. Also [they are safer and more straightforward](https://en.wikipedia.org/wiki/Entropy-supplying_system_calls) to use than `/dev/urandom` as reading from a file has quite a few edge cases: - Linux: `getrandom(buf, buflen, 0)`. [getrandom(2)](http://man7.org/linux/man-pages/man2/getrandom.2.html) was introduced in version 3.17 of the Linux kernel. - OpenBSD: `getentropy(buf, buflen)`. The [getentropy(2)](http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2) function appeared in OpenBSD 5.6. - FreeBSD and NetBSD: `sysctl(KERN_ARND)`. Not sure when this was added but it has existed for quite a while. Alternatives: - Linux has sysctl `CTL_KERN` / `KERN_RANDOM` / `RANDOM_UUID` which gives 16 bytes of randomness. This may be available on older kernels, however [sysctl is deprecated on Linux](https://lwn.net/Articles/605392/) and even removed in some distros so we shouldn't use it. Add tests for `GetOSRand()`: - Test that no error happens (otherwise `RandFailure()` which aborts) - Test that all 32 bytes are overwritten (initialize with zeros, try multiple times) Discussion: - When to use these? Currently they are always used when available. Another option would be to use them only when `/dev/urandom` is not available. But this would mean these code paths receive less testing, and I'm not sure there is any reason to prefer `/dev/urandom`. Closes: #9676
2017-02-16Add CheckQueue TestsJeremy Rubin
2017-01-12Merge #9525: test: Include tx data in EXTRA_DISTMarcoFalke
fa29736 test: Include tx data in EXTRA_DIST (MarcoFalke)
2017-01-12test: Include tx data in EXTRA_DISTMarcoFalke
2017-01-05Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deletersWladimir J. van der Laan
05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm) 280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm) 7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm) e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
2017-01-04Added EVENT_CFLAGS to test makefile to explicitly include libevent headers.Karl-Johan Alm
2016-12-27test: Include tx data in EXTRA_DISTMarcoFalke
2016-12-21Merge #9376: Remove unused test files and referencesWladimir J. van der Laan
9cb6624 Fix testfile reference (BtcDrak) 23208ac Remove unused test files and references (BtcDrak)
2016-12-21Added some simple tests for the RAII-style events.Karl-Johan Alm
2016-12-20Fix testfile referenceBtcDrak
2016-12-19Remove unused test files and referencesBtcDrak
2016-12-17Uses built-in byte swap if available (Apple) and if bswap_XX is undefined.Karl-Johan Alm
Defers to pre-defined version if found (e.g. protobuf). For protobuf case, the definitions are identical and thus include order should not affect results.
2016-12-15Merge #9172: Resurrect pstratem's "Simple fuzzing framework"Wladimir J. van der Laan
8b15434 doc: Add bare-bones documentation for fuzzing (Wladimir J. van der Laan) a4153e2 Simple fuzzing framework (Patrick Strateman)
2016-12-15Simple fuzzing frameworkPatrick Strateman
2016-12-14Merge #8895: Better SigCache ImplementationPieter Wuille
67dac4e Add unit tests for the CuckooCache (Jeremy Rubin) c9e69fb Add CuckooCache implementation and replace the sigcache map_type with it (Jeremy Rubin)
2016-12-14Add unit tests for the CuckooCacheJeremy Rubin
SQUASHME: Update Tests for other SQUASHMEs
2016-11-12Bugfix: Correctly replace generated headers and fail cleanlyLuke Dashjr
Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
2016-11-07test: Fix test_random includesMarcoFalke
2016-11-02Remove GetTotalBlocksEstimate and checkpoint tests that test nothing.Gregory Maxwell
GetTotalBlocksEstimate is no longer used and it was the only thing the checkpoint tests were testing. Since checkpoints are on their way out it makes more sense to remove the test file than to cook up a new pointless test.
2016-09-21Add MIT license to MakefilesLuke Dashjr
2016-08-07Remove rpc_wallet_tests.cppPatrick Strateman