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

Unified Diff: testing/libfuzzer/fuzzer_test.gni

Issue 1867833002: [libfuzzer] store custom options in .GN build target instead of a separate file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update reference.md of libFuzzer & CF documentation. Created 4 years, 8 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/efficient_fuzzer.md ('k') | testing/libfuzzer/fuzzers/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 266016ce4f9ac539d4beafddfa65bf820899a9e7..cd1ca2c08fa3fdbcd3658a9bc515f959056016a5 100644
--- a/testing/libfuzzer/fuzzer_test.gni
+++ b/testing/libfuzzer/fuzzer_test.gni
@@ -36,20 +36,6 @@ template("fuzzer_test") {
test_deps += invoker.deps
}
- if (defined(invoker.libfuzzer_options) && !defined(invoker.dict)) {
- # Copy libfuzzer_options to output if dict is not provided.
- copy(target_name + "_libfuzzer_options_copy") {
- sources = [
- invoker.libfuzzer_options,
- ]
- outputs = [
- "$root_build_dir/" + target_name + ".options",
- ]
- }
-
- 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"
@@ -79,36 +65,41 @@ template("fuzzer_test") {
test_deps += [ ":" + target_name + "_seed_corpus" ]
}
- if (defined(invoker.dict)) {
- # Copy dictionary to output.
- copy(target_name + "_dict_copy") {
- sources = [
- invoker.dict,
- ]
- outputs = [
- "$root_build_dir/" + target_name + ".dict",
- ]
+ if (defined(invoker.dict) || defined(invoker.libfuzzer_options)) {
+ if (defined(invoker.dict)) {
+ # Copy dictionary to output.
+ copy(target_name + "_dict_copy") {
+ sources = [
+ invoker.dict,
+ ]
+ outputs = [
+ "$root_build_dir/" + target_name + ".dict",
+ ]
+ }
+ test_deps += [ ":" + target_name + "_dict_copy" ]
}
- test_deps += [ ":" + target_name + "_dict_copy" ]
-
- # Generate new .options file or update an existing one.
+ # Generate .options file.
config_name = target_name + ".options"
action(config_name) {
script = "//testing/libfuzzer/gen_fuzzer_config.py"
args = [
"--config",
rebase_path("$root_build_dir/" + config_name),
- "--dict",
- rebase_path("$root_build_dir/" + invoker.target_name + ".dict"),
]
- if (defined(invoker.libfuzzer_options)) {
+ if (defined(invoker.dict)) {
args += [
- "--libfuzzer_options",
- rebase_path(invoker.libfuzzer_options),
+ "--dict",
+ rebase_path("$root_build_dir/" + invoker.target_name + ".dict"),
]
}
+
+ if (defined(invoker.libfuzzer_options)) {
+ args += [ "--libfuzzer_options" ]
+ args += invoker.libfuzzer_options
+ }
+
outputs = [
"$root_build_dir/$config_name",
]
« no previous file with comments | « testing/libfuzzer/efficient_fuzzer.md ('k') | testing/libfuzzer/fuzzers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698