Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: testing/libfuzzer/fuzzer_test.gni

Issue 1768743002: [libfuzzer] in-vcs corpus support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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") {

Powered by Google App Engine
This is Rietveld 408576698