Merge #19916: build: allow user to specify DIR_FUZZ_SEED_CORPUS for cov_fuzz

fb3bacce69 .gitignore: ignore qa-assets/ folder (eugene)
a9f201439a build: use DIR_FUZZ_SEED_CORPUS if specified for cov_fuzz target (eugene)

Pull request description:

  This PR contains two commits:
  - The cov_fuzz target now uses `DIR_FUZZ_SEED_CORPUS` as the seed directory instead of the hard-coded `qa-assets/fuzz_seed_corpus`. Otherwise, running it requires me to copy the corpus to the bitcoin directory first. In case `DIR_FUZZ_SEED_CORPUS` is not specified, the original default is used.
  - add qa-assets folder to gitignore

  Example usage:
  `make cov_fuzz DIR_FUZZ_SEED_CORPUS=~/workspace/qa-assets/fuzz_seed_corpus`

  It can also just be an environment variable.

ACKs for top commit:
  fanquake:
    ACK fb3bacce69 - looks fine.
  practicalswift:
    ACK fb3bacce69 - patch looks correct

Tree-SHA512: 19ad7c6a2b0c088df14fb71a217d956e66a69eea78f016cd1e914d39c5d7cc196766a637e6c941c6706322663010e7162e85f57e888b8f3b05d0c37d44740847
This commit is contained in:
fanquake 2020-09-11 14:03:15 +08:00
commit 9366a73d69
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View file

@ -122,6 +122,7 @@ total.coverage/
fuzz.coverage/
coverage_percent.txt
/cov_tool_wrapper.sh
qa-assets/
#build tests
linux-coverage-build

View file

@ -193,6 +193,8 @@ LCOV_FILTER_PATTERN = \
-p "src/secp256k1" \
-p "depends"
DIR_FUZZ_SEED_CORPUS ?= qa-assets/fuzz_seed_corpus
$(COV_TOOL_WRAPPER):
@echo 'exec $(COV_TOOL) "$$@"' > $(COV_TOOL_WRAPPER)
@chmod +x $(COV_TOOL_WRAPPER)
@ -205,7 +207,7 @@ baseline_filtered.info: baseline.info
$(LCOV) -a $@ $(LCOV_OPTS) -o $@
fuzz.info: baseline_filtered.info
@TIMEOUT=15 test/fuzz/test_runner.py qa-assets/fuzz_seed_corpus -l DEBUG
@TIMEOUT=15 test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src