From dbeab81f5d10a2b0c8c1715c48132fc631c52699 Mon Sep 17 00:00:00 2001 From: Abhishek Arya Date: Fri, 24 Jul 2020 16:41:45 -0700 Subject: Add corpus-dir to run_fuzzer, for later use in coverage cmd. (#4191) * Add corpus-dir to run_fuzzer, for later use in coverage cmd. * Update as per comment. --- docs/getting-started/new_project_guide.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs/getting-started') diff --git a/docs/getting-started/new_project_guide.md b/docs/getting-started/new_project_guide.md index 17ff2376f..5e752e7b0 100644 --- a/docs/getting-started/new_project_guide.md +++ b/docs/getting-started/new_project_guide.md @@ -306,11 +306,23 @@ You can build your docker image and fuzz targets locally, so you can test them b 3. If you want to test changes against a particular fuzz target, run the following command: ```bash - $ python infra/helper.py run_fuzzer $PROJECT_NAME + $ python infra/helper.py run_fuzzer $PROJECT_NAME --corpus-dir= ``` -4. We recommend taking a look at your code coverage as a sanity check to make sure that your -fuzz targets get to the code you expect. Please refer to [code coverage]({{ site.baseurl }}/advanced-topics/code-coverage/). +4. We recommend taking a look at your code coverage as a sanity check to make +sure that your fuzz targets get to the code you expect. This would use the +corpus generated from the previous `run_fuzzer` step in your local corpus +directory. + + ```bash + $ python infra/helper.py build_fuzzers --sanitizer coverage $PROJECT_NAME + $ python infra/helper.py coverage $PROJECT_NAME --fuzz-target= --corpus-dir= + ``` + +Please refer to +[code coverage]({{ site.baseurl }}/advanced-topics/code-coverage/) for detailed +information on code coverage generation. + **Note:** Currently, we only support AddressSanitizer (address) and UndefinedBehaviorSanitizer (undefined) configurations. MemorySanitizer is recommended, but needs to be enabled manually once you verify -- cgit v1.2.3