aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.test.include
Commit message (Collapse)AuthorAgeFilesLines
...
| * [Tests] Adding unit tests for GetDifficulty in blockchain.cpp.sean2017-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | [tests] remove redundant univalue_tests.cppJohn Newbery2017-12-121-1/+0
| |
* | [tests] Test that mempool rejects coinbase transactionsJames O'Beirne2017-11-181-0/+1
| |
* | build: Remove -I for everything but project rootWladimir J. van der Laan2017-11-161-1/+1
|/ | | | | Remove -I from build system for everything but the project root, and built-in dependencies.
* Merge #11433: qa: Restore bitcoin-util-test py2 compatibilityMarcoFalke2017-10-031-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * qa: Restore bitcoin-util-test py2 compatibilityMarcoFalke2017-10-011-1/+1
| |
* | Merge #11293: Deduplicate CMerkleBlock construction code, add test coverageMarcoFalke2017-10-031-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Add tests for CMerkleBlock usage with txids specifiedJames O'Beirne2017-09-201-0/+1
| | |
* | | Import Bech32 C++ reference code & testsPieter Wuille2017-09-281-0/+1
| | | | | | | | | | | | | | | | | | 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.
* | | [script] Unit tests for script/standard functionsJim Posen2017-09-211-0/+1
|/ /
* / Remove redundant testutil filesMeshCollider2017-09-051-2/+0
|/
* Fix test_bitcoin circular dependency issueJonas Schnelli2017-07-171-3/+4
|
* Merge #10544: Update to LevelDB 1.20Wladimir J. van der Laan2017-06-131-2/+2
|\ | | | | | | | | | | | | | | 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
| * leveldb: enable runtime-detected crc32 instructionsCory Fields2017-06-091-2/+2
| |
* | Merge #10321: Use FastRandomContext for all testsPieter Wuille2017-06-071-1/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Merge test_random.h into test_bitcoin.hPieter Wuille2017-06-051-1/+0
| |/
* | Merge #10331: Share config between util and functional testsMarcoFalke2017-06-061-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | 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
| * Change bitcoin-util-test.py to use Python3John Newbery2017-05-031-1/+1
| |
* | torcontrol: Add unit tests for Tor reply parsersJack Grigg2017-05-161-0/+1
|/
* Merge #9792: FastRandomContext improvements and switch to ChaCha20Wladimir J. van der Laan2017-04-241-1/+1
|\ | | | | | | | | | | | | | | | | | | 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
| * Switch FastRandomContext to ChaCha20Pieter Wuille2017-03-291-1/+1
| |
* | allow libevent logging to be updated during runtimeJohn Newbery2017-04-101-1/+1
|/
* Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.pyJohn Newbery2017-03-201-59/+2
|
* Merge #9974: Add basic Qt wallet testJonas Schnelli2017-03-171-0/+1
|\ | | | | | | | | | | | | | | | | | | | | 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
| * Make test_bitcoin.cpp compatible with Qt Test frameworkRussell Yanofsky2017-03-101-0/+1
| | | | | | | | Move Boost.Test main function and global overrides to a new test_bitcoin_main.cpp file.
* | Merge #9497: CCheckQueue Unit TestsWladimir J. van der Laan2017-03-141-0/+1
|\ \ | |/ |/| | | | | | | | | 96c7f2c Add CheckQueue Tests (Jeremy Rubin) e207342 Fix CCheckQueue IsIdle (potential) race condition and remove dangerous constructors. (Jeremy Rubin) Tree-SHA512: 5989743ad0f8b08998335e7ca9256e168fa319053f91b9dece9dbb134885bef7753b567b591acc7135785f23d19799ed7e6375917f59fe0178d389e961633d62
| * Add CheckQueue TestsJeremy Rubin2017-02-161-0/+1
| |
* | util: Specific GetOSRandom for Linux/FreeBSD/OpenBSDWladimir J. van der Laan2017-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge #9525: test: Include tx data in EXTRA_DISTMarcoFalke2017-01-121-14/+36
|\ \ | |/ |/| | | fa29736 test: Include tx data in EXTRA_DIST (MarcoFalke)
| * test: Include tx data in EXTRA_DISTMarcoFalke2017-01-121-14/+36
| |
* | Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deletersWladimir J. van der Laan2017-01-051-2/+3
|\ \ | |/ |/| | | | | | | | | 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)
| * Added EVENT_CFLAGS to test makefile to explicitly include libevent headers.Karl-Johan Alm2017-01-041-1/+1
| |
| * Added some simple tests for the RAII-style events.Karl-Johan Alm2016-12-211-1/+2
| |
* | test: Include tx data in EXTRA_DISTMarcoFalke2016-12-271-0/+15
| |
* | Merge #9376: Remove unused test files and referencesWladimir J. van der Laan2016-12-211-2/+1
|\ \ | |/ |/| | | | | 9cb6624 Fix testfile reference (BtcDrak) 23208ac Remove unused test files and references (BtcDrak)
| * Fix testfile referenceBtcDrak2016-12-201-1/+1
| |
| * Remove unused test files and referencesBtcDrak2016-12-191-1/+0
| |
* | Uses built-in byte swap if available (Apple) and if bswap_XX is undefined.Karl-Johan Alm2016-12-171-0/+1
|/ | | | 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.
* Merge #9172: Resurrect pstratem's "Simple fuzzing framework"Wladimir J. van der Laan2016-12-151-0/+21
|\ | | | | | | | | 8b15434 doc: Add bare-bones documentation for fuzzing (Wladimir J. van der Laan) a4153e2 Simple fuzzing framework (Patrick Strateman)
| * Simple fuzzing frameworkPatrick Strateman2016-12-151-0/+21
| |
* | Merge #8895: Better SigCache ImplementationPieter Wuille2016-12-141-0/+1
|\ \ | |/ |/| | | | | 67dac4e Add unit tests for the CuckooCache (Jeremy Rubin) c9e69fb Add CuckooCache implementation and replace the sigcache map_type with it (Jeremy Rubin)
| * Add unit tests for the CuckooCacheJeremy Rubin2016-12-141-0/+1
| | | | | | | | SQUASHME: Update Tests for other SQUASHMEs
* | Bugfix: Correctly replace generated headers and fail cleanlyLuke Dashjr2016-11-121-12/+6
| | | | | | | | Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
* | test: Fix test_random includesMarcoFalke2016-11-071-0/+1
| |
* | Remove GetTotalBlocksEstimate and checkpoint tests that test nothing.Gregory Maxwell2016-11-021-1/+0
|/ | | | | | | | 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.
* Add MIT license to MakefilesLuke Dashjr2016-09-211-0/+4
|
* Remove rpc_wallet_tests.cppPatrick Strateman2016-08-071-2/+1
|
* Merge #8275: Remove bad chain alert partition checkWladimir J. van der Laan2016-07-061-1/+0
|\ | | | | | | ab8be98 Remove bad chain alert partition check (BtcDrak)
| * Remove bad chain alert partition checkBtcDrak2016-06-141-1/+0
| | | | | | | | | | | | | | | | | | As per meeting 2016-03-31 https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts The partition checker was producing huge number of false-positives and was disabled in 0.12.1 on the understanding it would either be fixed in 0.13 or removed entirely from master if not.
* | Add some blockencodings testsMatt Corallo2016-06-191-0/+1
|/