HomePhabricator

[tests] Add libFuzzer support.

Description

[tests] Add libFuzzer support.

Summary:
This is a backport of core PR10440:
https://github.com/bitcoin/bitcoin/pull/10440/files

I added some modifications to the CMake files to support enabling the
libFuzzer support easily (it requires manual compilation otherwise).
This is natively supported by ECM, but will try to apply to every build
with a main() which is not the desired behavior as it should only
apply to the test_bitcoin_fuzzy target.

Depends on D5182 (for the test plan).

Test Plan:
Build with Clang >= 6.0:

cmake -GNinja .. -DENABLE_SANITIZERS=fuzzer
ninja test_bitcoin_fuzzy
./src/test/test_bitcoin_fuzzy

Stop it with CTRL+C when you're bored, as it will run indefinitely.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4588

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on May 22 2017, 11:55
FabienCommitted on Feb 10 2020, 13:17
FabienPushed on Feb 10 2020, 13:49
Reviewer
Restricted Project
Differential Revision
D4588: [tests] Add libFuzzer support.
Parents
rSTAGING8e591f10ec22: Cache the result of chainparams.GetConsensus() in miner code
Branches
Unknown
Tags
Unknown