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

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: making sure 2nd build doesn't build anything. Created 4 years, 9 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
« no previous file with comments | « testing/libfuzzer/archive_corpus.py ('k') | third_party/boringssl/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
}
« no previous file with comments | « testing/libfuzzer/archive_corpus.py ('k') | third_party/boringssl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698