| Index: testing/libfuzzer/fuzzer_test.gni
|
| diff --git a/testing/libfuzzer/fuzzer_test.gni b/testing/libfuzzer/fuzzer_test.gni
|
| index 9fc5c6a5e5d0e09db1f75537cbfe056c96fb245b..58742329f04ffcdad1504cd09dc58db97fc3e665 100644
|
| --- a/testing/libfuzzer/fuzzer_test.gni
|
| +++ b/testing/libfuzzer/fuzzer_test.gni
|
| @@ -16,6 +16,7 @@ import("//testing/test.gni")
|
| # - additional_configs - additional configs to be used for compilation
|
| # - dict - a dictionary file for the fuzzer.
|
| # - libfuzzer_options - options for the fuzzer (e.g. -max_len or -timeout).
|
| +# - seed_corpus - a directory with seed corpus.
|
| #
|
| # If use_libfuzzer gn flag is defined, then proper fuzzer would be build.
|
| # Without use_libfuzzer a unit-test style binary would be built on linux
|
| @@ -49,6 +50,32 @@ template("fuzzer_test") {
|
| test_deps += [ ":" + target_name + "_libfuzzer_options_copy" ]
|
| }
|
|
|
| + if (defined(invoker.seed_corpus)) {
|
| + depfile = "$root_build_dir/$target_name" + ".seed_corpus.d"
|
| + out = "$root_build_dir/$target_name" + "_seed_corpus.zip"
|
| +
|
| + action(target_name + "_seed_corpus") {
|
| + script = "//testing/libfuzzer/archive_corpus.py"
|
| + args = [
|
| + "--depfile",
|
| + rebase_path(depfile),
|
| + "--corpus",
|
| + rebase_path(invoker.seed_corpus),
|
| + "--output",
|
| + rebase_path(out),
|
| + "--fuzzer",
|
| + rebase_path("$root_build_dir/$target_name"),
|
| + ]
|
| +
|
| + depfile = depfile
|
| + outputs = [
|
| + out,
|
| + ]
|
| + }
|
| +
|
| + test_deps += [ ":" + target_name + "_seed_corpus" ]
|
| + }
|
| +
|
| if (defined(invoker.dict)) {
|
| # Copy dictionary to output.
|
| copy(target_name + "_dict_copy") {
|
| @@ -115,6 +142,9 @@ template("fuzzer_test") {
|
| if (defined(invoker.libfuzzer_options)) {
|
| assert(invoker.libfuzzer_options == [] || invoker.libfuzzer_options != [])
|
| }
|
| + if (defined(invoker.seed_corpus)) {
|
| + assert(invoker.seed_corpus == [] || invoker.seed_corpus != [])
|
| + }
|
|
|
| group(target_name) {
|
| }
|
|
|