Reland "Add 'use_centipede' alternative to 'use_libfuzzer'"
This is a reland of commit e6164f6238b2d16985026ab69f11d01a93384b28
Changes: removing an errant space in a gn target name
Original change's description:
> Add 'use_centipede' alternative to 'use_libfuzzer'
>
> Chromium has supported multiple fuzzing engines for a while - libfuzzer
> and AFL. libfuzzer is gradually on its way to deprecation and its
> success is centipede. This CL introduces a 'use_centipede' gn argument
> which can be used to build all the existing fuzzers using centipede
> instead of libfuzzer.
>
> The resulting binaries don't work quite the same way: libfuzzer
> executables are standalone, whereas centipede requires an external
> runner harness as described at
> https://github.com/google/centipede
>
> As a complete example of how to use this;
> * Use these gn args:
> use_goma = true
> dcheck_always_on = false
> enable_mojom_fuzzer = true
> enable_nacl = false
> is_asan = true
> is_component_build = false
> is_debug = false
> optimize_for_fuzzing = true
> pdf_enable_xfa = true
> use_centipede = true
> use_sanitizer_coverage = true
> * autoninja -C <wherever> components/cbor:reader_fuzzer
> * Configure BIN_DIR and WD per the centipede instructions linked above.
> * $BIN_DIR/centipede --binary=$YOUR_OUT/reader_fuzzer --workdir=$WD --j=5
>
> Bug: 1369919
> Change-Id: I877f1ef84bc8fed8aac19eeee2e6d15b1f6731e0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4218946
> Reviewed-by: Jonathan Metzman <[email protected]>
> Reviewed-by: Bruce Dawson <[email protected]>
> Commit-Queue: Adrian Taylor <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1115595}
Bug: 1369919
Change-Id: I67ba6ee069318990b485a0e30bd771d75b8f9706
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4329030
Reviewed-by: Bruce Dawson <[email protected]>
Reviewed-by: Jonathan Metzman <[email protected]>
Commit-Queue: Adrian Taylor <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1115727}
diff --git a/tools/code_coverage/coverage.py b/tools/code_coverage/coverage.py
index 50ac299a..b1c62a1 100755
--- a/tools/code_coverage/coverage.py
+++ b/tools/code_coverage/coverage.py
@@ -527,7 +527,9 @@
build_args = _GetBuildArgs()
use_libfuzzer = ('use_libfuzzer' in build_args and
build_args['use_libfuzzer'] == 'true')
- return use_libfuzzer and target.endswith('_fuzzer')
+ use_centipede = ('use_centipede' in build_args
+ and build_args['use_centipede'] == 'true')
+ return (use_libfuzzer or use_centipede) and target.endswith('_fuzzer')
def _ExecuteIOSCommand(command, output_file_path):