Chromium Code Reviews| Index: testing/libfuzzer/fuzzer_test.gni |
| diff --git a/testing/libfuzzer/fuzzer_test.gni b/testing/libfuzzer/fuzzer_test.gni |
| index 9fc5c6a5e5d0e09db1f75537cbfe056c96fb245b..5445b2e4764442aca62815cd714de15bffa2ec68 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). |
| +# - corpus - a directory with seed corpus. |
|
mmoroz
2016/03/07 14:08:55
May be let's use |seed_corpus| option name and the
aizatsky
2016/03/07 21:42:54
Done.
|
| # |
| # 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,30 @@ template("fuzzer_test") { |
| test_deps += [ ":" + target_name + "_libfuzzer_options_copy" ] |
| } |
| + if (defined(invoker.corpus)) { |
| + depfile = "$root_build_dir/$target_name" + ".corpus.d" |
| + out = "$root_build_dir/$target_name" + "_corpus.zip" |
| + |
| + action(target_name + "_corpus") { |
| + script = "//testing/libfuzzer/archive_corpus.py" |
| + args = [ |
| + "--depfile", |
| + rebase_path(depfile), |
| + "--corpus", |
| + rebase_path(invoker.corpus), |
| + "--output", |
| + rebase_path(out), |
| + ] |
| + |
| + depfile = depfile |
| + outputs = [ |
| + out, |
| + ] |
| + } |
| + |
| + test_deps += [ ":" + target_name + "_corpus" ] |
| + } |
| + |
| if (defined(invoker.dict)) { |
| # Copy dictionary to output. |
| copy(target_name + "_dict_copy") { |