HomePhabricator

Make the fuzzer test runner compatible with cmake

Description

Make the fuzzer test runner compatible with cmake

Summary:
The current implementation of the fuzzer test runner reads the
Makefile.test.include to extract a list of the fuzz targets that it
can run.
This diff makes it explore the actually built binaries instead, so it
can work with both autotools and cmake.

Creating a link at build time with autotools makes it easier to run with
out-of-tree builds.

Depends on D4629.

Test Plan:

export CC=clang CXX=clang++
../configure --enable-fuzz --with-sanitizers=fuzzer,address \
  --disable-wallet \
  --disable-bench \
  --with-utils=no \
  --with-daemon=no \
  --with-libs=no \
  --with-gui=no \
  --with-seeder=no
make
./test/fuzz/test_runner.py -l DEBUG <path_to_corpus>
cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" \
  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja bitcoin-fuzzers link-fuzz-test_runner.py
./test/fuzz/test_runner.py -l DEBUG <path_to_corpus>

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
FabienAuthored on Mar 17 2020, 14:32
jasonbcoxPushed on Mar 19 2020, 17:10
Reviewer
Restricted Project
Differential Revision
D5499: Make the fuzzer test runner compatible with cmake
Parents
rSTAGING6282730dd61a: Bump copyright headers in tests (part3)
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/17051, tag: phabricator/base/17050