summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-11 05:20:54 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-11 05:20:54 +0000
commit8dc38b40c10321a6858b000c3d0b7d90e4540dca (patch)
treeb23f2e718a7dad32f2426b5f045d027e8e0ccb58 /testing
parent40be505a7023925a65ec905865df3a5b42dd427d (diff)
downloadpdfium-8dc38b40c10321a6858b000c3d0b7d90e4540dca.tar.xz
Fix double V8 initialization with fuzzers.
Commit 95860d7 added some new fuzzers, but they try to use both the generic fuzzer's initialization code, as well as their own custom initialization code. Add a new "pdfium_public_fuzzer" GN template for these new fuzzers, so they use their own initialization code rather than the generic one. BUG=chromium:894053 TBR=tsepez@chromium.org Change-Id: I6110a199e1c64d7c0632f9966e146fd316b757ae Reviewed-on: https://pdfium-review.googlesource.com/c/43832 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/fuzzers/BUILD.gn55
1 files changed, 32 insertions, 23 deletions
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index 5a6af69f69..f528ad5c9d 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -65,11 +65,40 @@ group("fuzzers") {
}
}
+template("pdfium_public_fuzzer") {
+ source_set(target_name) {
+ sources = invoker.sources + [
+ "pdfium_fuzzer_helper.cc",
+ "pdfium_fuzzer_helper.h",
+ ]
+ deps = [
+ "../../:pdfium",
+ "../../:test_support",
+ ]
+ if (defined(invoker.deps)) {
+ deps += invoker.deps
+ }
+ testonly = true
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [
+ "//build/config/compiler:no_chromium_code",
+ ":fuzzer_config",
+ ]
+ if (pdf_enable_v8) {
+ configs += [ "//v8:external_startup_data" ]
+ deps += [
+ "//v8",
+ "//v8:v8_libplatform",
+ ]
+ }
+ }
+}
+
template("pdfium_fuzzer") {
source_set(target_name) {
sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
deps = [
- "../..:pdfium",
+ "../../:pdfium",
]
if (defined(invoker.deps)) {
deps += invoker.deps
@@ -181,17 +210,10 @@ if (pdf_enable_xfa) {
]
}
- pdfium_fuzzer("pdfium_xfa_fuzzer_src") {
+ pdfium_public_fuzzer("pdfium_xfa_fuzzer_src") {
sources = [
- "pdfium_fuzzer_helper.cc",
- "pdfium_fuzzer_helper.h",
"pdfium_xfa_fuzzer.cc",
]
- deps = [
- "../../:test_support",
- "//v8",
- "//v8:v8_libplatform",
- ]
}
}
@@ -270,21 +292,8 @@ pdfium_fuzzer("pdf_xml_fuzzer_src") {
]
}
-pdfium_fuzzer("pdfium_fuzzer_src") {
+pdfium_public_fuzzer("pdfium_fuzzer_src") {
sources = [
"pdfium_fuzzer.cc",
- "pdfium_fuzzer_helper.cc",
- "pdfium_fuzzer_helper.h",
]
-
- deps = [
- "../../:test_support",
- ]
-
- if (pdf_enable_v8) {
- deps += [
- "//v8",
- "//v8:v8_libplatform",
- ]
- }
}