summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/fuzzers/BUILD.gn253
-rw-r--r--testing/fuzzers/DEPS (renamed from testing/libfuzzer/DEPS)0
-rw-r--r--testing/fuzzers/pdf_bidi_fuzzer.cc (renamed from testing/libfuzzer/pdf_bidi_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_cfx_barcode_fuzzer.cc (renamed from testing/libfuzzer/pdf_cfx_barcode_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_cmap_fuzzer.cc (renamed from testing/libfuzzer/pdf_cmap_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_a85_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_a85_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_bmp_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_bmp_fuzzer.cc)2
-rw-r--r--testing/fuzzers/pdf_codec_fax_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_fax_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_gif_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_gif_fuzzer.cc)2
-rw-r--r--testing/fuzzers/pdf_codec_icc_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_icc_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_jbig2_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_jpeg_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_jpeg_fuzzer.cc)2
-rw-r--r--testing/fuzzers/pdf_codec_png_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_png_fuzzer.cc)2
-rw-r--r--testing/fuzzers/pdf_codec_rle_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_rle_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_codec_tiff_fuzzer.cc (renamed from testing/libfuzzer/pdf_codec_tiff_fuzzer.cc)2
-rw-r--r--testing/fuzzers/pdf_css_fuzzer.cc (renamed from testing/libfuzzer/pdf_css_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_fm2js_fuzzer.cc (renamed from testing/libfuzzer/pdf_fm2js_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_font_fuzzer.cc (renamed from testing/libfuzzer/pdf_font_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_formcalc_fuzzer.cc (renamed from testing/libfuzzer/pdf_formcalc_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_fuzzer_init.cc (renamed from testing/libfuzzer/pdf_fuzzer_init.cc)0
-rw-r--r--testing/fuzzers/pdf_hint_table_fuzzer.cc (renamed from testing/libfuzzer/pdf_hint_table_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_jpx_fuzzer.cc (renamed from testing/libfuzzer/pdf_jpx_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_lzw_fuzzer.cc (renamed from testing/libfuzzer/pdf_lzw_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_psengine_fuzzer.cc (renamed from testing/libfuzzer/pdf_psengine_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_streamparser_fuzzer.cc (renamed from testing/libfuzzer/pdf_streamparser_fuzzer.cc)0
-rw-r--r--testing/fuzzers/pdf_xml_fuzzer.cc (renamed from testing/libfuzzer/pdf_xml_fuzzer.cc)0
-rw-r--r--testing/fuzzers/unittest_main.cc (renamed from testing/libfuzzer/unittest_main.cc)0
-rw-r--r--testing/fuzzers/xfa_codec_fuzzer.h (renamed from testing/libfuzzer/xfa_codec_fuzzer.h)6
-rw-r--r--testing/libfuzzer/BUILD.gn249
29 files changed, 347 insertions, 171 deletions
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
new file mode 100644
index 0000000000..59211b1758
--- /dev/null
+++ b/testing/fuzzers/BUILD.gn
@@ -0,0 +1,253 @@
+# Copyright 2016 The PDFium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("../../pdfium.gni")
+
+config("fuzzer_config") {
+ configs = [ "../..:pdfium_core_config" ]
+
+ defines = [
+ "PNG_PREFIX",
+ "PNG_USE_READ_MACROS",
+ ]
+ include_dirs = [ "../.." ]
+ if (pdf_enable_v8) {
+ defines += [ "PDF_ENABLE_V8" ]
+ }
+ if (pdf_enable_xfa) {
+ defines += [ "PDF_ENABLE_XFA" ]
+ }
+}
+
+group("fuzzers") {
+ testonly = true
+ deps = [
+ ":pdf_cmap_fuzzer_src",
+ ":pdf_codec_a85_fuzzer_src",
+ ":pdf_codec_fax_fuzzer_src",
+ ":pdf_codec_icc_fuzzer_src",
+ ":pdf_codec_jbig2_fuzzer_src",
+ ":pdf_codec_rle_fuzzer_src",
+ ":pdf_font_fuzzer_src",
+ ":pdf_hint_table_fuzzer_src",
+ ":pdf_jpx_fuzzer_src",
+ ":pdf_psengine_fuzzer_src",
+ ":pdf_streamparser_fuzzer_src",
+ ":pdf_xml_fuzzer_src",
+ ]
+ if (pdf_enable_xfa) {
+ deps += [
+ ":pdf_bidi_fuzzer_src",
+ ":pdf_cfx_barcode_fuzzer_src",
+ ":pdf_codec_jpeg_fuzzer_src",
+ ":pdf_css_fuzzer_src",
+ ":pdf_fm2js_fuzzer_src",
+ ":pdf_formcalc_fuzzer_src",
+ ]
+ if (pdf_enable_xfa_bmp) {
+ deps += [ ":pdf_codec_bmp_fuzzer_src" ]
+ }
+ if (pdf_enable_xfa_gif) {
+ deps += [
+ ":pdf_codec_gif_fuzzer_src",
+ ":pdf_lzw_fuzzer_src",
+ ]
+ }
+ if (pdf_enable_xfa_png) {
+ deps += [ ":pdf_codec_png_fuzzer_src" ]
+ }
+ if (pdf_enable_xfa_tiff) {
+ deps += [ ":pdf_codec_tiff_fuzzer_src" ]
+ }
+ }
+}
+
+template("pdfium_fuzzer") {
+ source_set(target_name) {
+ sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
+ deps = [
+ "../..:pdfium",
+ ]
+ 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_xfa) {
+ pdfium_fuzzer("pdf_bidi_fuzzer_src") {
+ sources = [
+ "pdf_bidi_fuzzer.cc",
+ ]
+ }
+
+ pdfium_fuzzer("pdf_cfx_barcode_fuzzer_src") {
+ sources = [
+ "pdf_cfx_barcode_fuzzer.cc",
+ ]
+ }
+
+ if (pdf_enable_xfa_bmp) {
+ pdfium_fuzzer("pdf_codec_bmp_fuzzer_src") {
+ sources = [
+ "pdf_codec_bmp_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ deps = [
+ "../../:test_support",
+ ]
+ }
+ }
+
+ if (pdf_enable_xfa_gif) {
+ pdfium_fuzzer("pdf_codec_gif_fuzzer_src") {
+ sources = [
+ "pdf_codec_gif_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ deps = [
+ "../../:test_support",
+ ]
+ }
+
+ pdfium_fuzzer("pdf_lzw_fuzzer_src") {
+ sources = [
+ "pdf_lzw_fuzzer.cc",
+ ]
+ }
+ }
+
+ pdfium_fuzzer("pdf_codec_jpeg_fuzzer_src") {
+ sources = [
+ "pdf_codec_jpeg_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ deps = [
+ "../../:test_support",
+ ]
+ }
+
+ if (pdf_enable_xfa_png) {
+ pdfium_fuzzer("pdf_codec_png_fuzzer_src") {
+ sources = [
+ "pdf_codec_png_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ deps = [
+ "../../:test_support",
+ ]
+ }
+ }
+
+ if (pdf_enable_xfa_tiff) {
+ pdfium_fuzzer("pdf_codec_tiff_fuzzer_src") {
+ sources = [
+ "pdf_codec_tiff_fuzzer.cc",
+ "xfa_codec_fuzzer.h",
+ ]
+ deps = [
+ "../../:test_support",
+ ]
+ }
+ }
+
+ pdfium_fuzzer("pdf_css_fuzzer_src") {
+ sources = [
+ "pdf_css_fuzzer.cc",
+ ]
+ }
+
+ pdfium_fuzzer("pdf_fm2js_fuzzer_src") {
+ sources = [
+ "pdf_fm2js_fuzzer.cc",
+ ]
+ }
+
+ pdfium_fuzzer("pdf_formcalc_fuzzer_src") {
+ sources = [
+ "pdf_formcalc_fuzzer.cc",
+ ]
+ }
+}
+
+pdfium_fuzzer("pdf_cmap_fuzzer_src") {
+ sources = [
+ "pdf_cmap_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_codec_a85_fuzzer_src") {
+ sources = [
+ "pdf_codec_a85_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_codec_fax_fuzzer_src") {
+ sources = [
+ "pdf_codec_fax_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_codec_icc_fuzzer_src") {
+ deps = [
+ "../../third_party/:lcms2",
+ ]
+ sources = [
+ "pdf_codec_icc_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_codec_jbig2_fuzzer_src") {
+ sources = [
+ "pdf_codec_jbig2_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_codec_rle_fuzzer_src") {
+ sources = [
+ "pdf_codec_rle_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_font_fuzzer_src") {
+ sources = [
+ "pdf_font_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_hint_table_fuzzer_src") {
+ sources = [
+ "pdf_hint_table_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_jpx_fuzzer_src") {
+ sources = [
+ "pdf_jpx_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_psengine_fuzzer_src") {
+ sources = [
+ "pdf_psengine_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_streamparser_fuzzer_src") {
+ sources = [
+ "pdf_streamparser_fuzzer.cc",
+ ]
+}
+
+pdfium_fuzzer("pdf_xml_fuzzer_src") {
+ sources = [
+ "pdf_xml_fuzzer.cc",
+ ]
+}
diff --git a/testing/libfuzzer/DEPS b/testing/fuzzers/DEPS
index b1d034ed8c..b1d034ed8c 100644
--- a/testing/libfuzzer/DEPS
+++ b/testing/fuzzers/DEPS
diff --git a/testing/libfuzzer/pdf_bidi_fuzzer.cc b/testing/fuzzers/pdf_bidi_fuzzer.cc
index 8e52688a10..8e52688a10 100644
--- a/testing/libfuzzer/pdf_bidi_fuzzer.cc
+++ b/testing/fuzzers/pdf_bidi_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_cfx_barcode_fuzzer.cc b/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc
index aaeebf3ace..aaeebf3ace 100644
--- a/testing/libfuzzer/pdf_cfx_barcode_fuzzer.cc
+++ b/testing/fuzzers/pdf_cfx_barcode_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_cmap_fuzzer.cc b/testing/fuzzers/pdf_cmap_fuzzer.cc
index 0c0ff11f36..0c0ff11f36 100644
--- a/testing/libfuzzer/pdf_cmap_fuzzer.cc
+++ b/testing/fuzzers/pdf_cmap_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_a85_fuzzer.cc b/testing/fuzzers/pdf_codec_a85_fuzzer.cc
index 20bd792886..20bd792886 100644
--- a/testing/libfuzzer/pdf_codec_a85_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_a85_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_bmp_fuzzer.cc b/testing/fuzzers/pdf_codec_bmp_fuzzer.cc
index 6c80fb58b9..71f9150f5c 100644
--- a/testing/libfuzzer/pdf_codec_bmp_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_bmp_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/libfuzzer/xfa_codec_fuzzer.h"
+#include "testing/fuzzers/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_BMP);
diff --git a/testing/libfuzzer/pdf_codec_fax_fuzzer.cc b/testing/fuzzers/pdf_codec_fax_fuzzer.cc
index f6cc1e7200..f6cc1e7200 100644
--- a/testing/libfuzzer/pdf_codec_fax_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_fax_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_gif_fuzzer.cc b/testing/fuzzers/pdf_codec_gif_fuzzer.cc
index 613ed1e37d..69129e7068 100644
--- a/testing/libfuzzer/pdf_codec_gif_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_gif_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/libfuzzer/xfa_codec_fuzzer.h"
+#include "testing/fuzzers/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_GIF);
diff --git a/testing/libfuzzer/pdf_codec_icc_fuzzer.cc b/testing/fuzzers/pdf_codec_icc_fuzzer.cc
index 7021017953..7021017953 100644
--- a/testing/libfuzzer/pdf_codec_icc_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_icc_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
index 7b8e2aac33..7b8e2aac33 100644
--- a/testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_jpeg_fuzzer.cc b/testing/fuzzers/pdf_codec_jpeg_fuzzer.cc
index 862bfad535..eaa0889e3c 100644
--- a/testing/libfuzzer/pdf_codec_jpeg_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_jpeg_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/libfuzzer/xfa_codec_fuzzer.h"
+#include "testing/fuzzers/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_JPG);
diff --git a/testing/libfuzzer/pdf_codec_png_fuzzer.cc b/testing/fuzzers/pdf_codec_png_fuzzer.cc
index 94e9321fd7..61a65748fe 100644
--- a/testing/libfuzzer/pdf_codec_png_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_png_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/libfuzzer/xfa_codec_fuzzer.h"
+#include "testing/fuzzers/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_PNG);
diff --git a/testing/libfuzzer/pdf_codec_rle_fuzzer.cc b/testing/fuzzers/pdf_codec_rle_fuzzer.cc
index c86671e5f4..c86671e5f4 100644
--- a/testing/libfuzzer/pdf_codec_rle_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_rle_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc b/testing/fuzzers/pdf_codec_tiff_fuzzer.cc
index 8e28d0fd12..187c311fc7 100644
--- a/testing/libfuzzer/pdf_codec_tiff_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_tiff_fuzzer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/libfuzzer/xfa_codec_fuzzer.h"
+#include "testing/fuzzers/xfa_codec_fuzzer.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return XFACodecFuzzer::Fuzz(data, size, FXCODEC_IMAGE_TIFF);
diff --git a/testing/libfuzzer/pdf_css_fuzzer.cc b/testing/fuzzers/pdf_css_fuzzer.cc
index 4f2f410aa3..4f2f410aa3 100644
--- a/testing/libfuzzer/pdf_css_fuzzer.cc
+++ b/testing/fuzzers/pdf_css_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_fm2js_fuzzer.cc b/testing/fuzzers/pdf_fm2js_fuzzer.cc
index 2541dfbcc8..2541dfbcc8 100644
--- a/testing/libfuzzer/pdf_fm2js_fuzzer.cc
+++ b/testing/fuzzers/pdf_fm2js_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_font_fuzzer.cc b/testing/fuzzers/pdf_font_fuzzer.cc
index 7c596307f0..7c596307f0 100644
--- a/testing/libfuzzer/pdf_font_fuzzer.cc
+++ b/testing/fuzzers/pdf_font_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_formcalc_fuzzer.cc b/testing/fuzzers/pdf_formcalc_fuzzer.cc
index 08e22bb247..08e22bb247 100644
--- a/testing/libfuzzer/pdf_formcalc_fuzzer.cc
+++ b/testing/fuzzers/pdf_formcalc_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_fuzzer_init.cc b/testing/fuzzers/pdf_fuzzer_init.cc
index 4b9790c3f8..4b9790c3f8 100644
--- a/testing/libfuzzer/pdf_fuzzer_init.cc
+++ b/testing/fuzzers/pdf_fuzzer_init.cc
diff --git a/testing/libfuzzer/pdf_hint_table_fuzzer.cc b/testing/fuzzers/pdf_hint_table_fuzzer.cc
index 50ca5cd693..50ca5cd693 100644
--- a/testing/libfuzzer/pdf_hint_table_fuzzer.cc
+++ b/testing/fuzzers/pdf_hint_table_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_jpx_fuzzer.cc b/testing/fuzzers/pdf_jpx_fuzzer.cc
index da65bc2d9a..da65bc2d9a 100644
--- a/testing/libfuzzer/pdf_jpx_fuzzer.cc
+++ b/testing/fuzzers/pdf_jpx_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_lzw_fuzzer.cc b/testing/fuzzers/pdf_lzw_fuzzer.cc
index 7e10d2a1ee..7e10d2a1ee 100644
--- a/testing/libfuzzer/pdf_lzw_fuzzer.cc
+++ b/testing/fuzzers/pdf_lzw_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_psengine_fuzzer.cc b/testing/fuzzers/pdf_psengine_fuzzer.cc
index d72088d4e3..d72088d4e3 100644
--- a/testing/libfuzzer/pdf_psengine_fuzzer.cc
+++ b/testing/fuzzers/pdf_psengine_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_streamparser_fuzzer.cc b/testing/fuzzers/pdf_streamparser_fuzzer.cc
index 4d9a368916..4d9a368916 100644
--- a/testing/libfuzzer/pdf_streamparser_fuzzer.cc
+++ b/testing/fuzzers/pdf_streamparser_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/fuzzers/pdf_xml_fuzzer.cc
index a3c399f78d..a3c399f78d 100644
--- a/testing/libfuzzer/pdf_xml_fuzzer.cc
+++ b/testing/fuzzers/pdf_xml_fuzzer.cc
diff --git a/testing/libfuzzer/unittest_main.cc b/testing/fuzzers/unittest_main.cc
index f6b29e483f..f6b29e483f 100644
--- a/testing/libfuzzer/unittest_main.cc
+++ b/testing/fuzzers/unittest_main.cc
diff --git a/testing/libfuzzer/xfa_codec_fuzzer.h b/testing/fuzzers/xfa_codec_fuzzer.h
index bcc3a5c7fe..bfc069a31d 100644
--- a/testing/libfuzzer/xfa_codec_fuzzer.h
+++ b/testing/fuzzers/xfa_codec_fuzzer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef TESTING_LIBFUZZER_XFA_CODEC_FUZZER_H_
-#define TESTING_LIBFUZZER_XFA_CODEC_FUZZER_H_
+#ifndef TESTING_FUZZERS_XFA_CODEC_FUZZER_H_
+#define TESTING_FUZZERS_XFA_CODEC_FUZZER_H_
#include <memory>
@@ -84,4 +84,4 @@ class XFACodecFuzzer {
}
};
-#endif // TESTING_LIBFUZZER_XFA_CODEC_FUZZER_H_
+#endif // TESTING_FUZZERS_XFA_CODEC_FUZZER_H_
diff --git a/testing/libfuzzer/BUILD.gn b/testing/libfuzzer/BUILD.gn
index 912c537835..2d67f0bedb 100644
--- a/testing/libfuzzer/BUILD.gn
+++ b/testing/libfuzzer/BUILD.gn
@@ -1,253 +1,176 @@
-# Copyright 2016 The PDFium Authors. All rights reserved.
+# Copyright 2018 The PDFium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../pdfium.gni")
-config("libfuzzer_config") {
- configs = [ "../..:pdfium_core_config" ]
-
- defines = [
- "PNG_PREFIX",
- "PNG_USE_READ_MACROS",
- ]
- include_dirs = [ "../.." ]
- if (pdf_enable_v8) {
- defines += [ "PDF_ENABLE_V8" ]
- }
- if (pdf_enable_xfa) {
- defines += [ "PDF_ENABLE_XFA" ]
- }
-}
-
-group("libfuzzer") {
- testonly = true
- deps = [
- ":pdf_cmap_fuzzer",
- ":pdf_codec_a85_fuzzer",
- ":pdf_codec_fax_fuzzer",
- ":pdf_codec_icc_fuzzer",
- ":pdf_codec_jbig2_fuzzer",
- ":pdf_codec_rle_fuzzer",
- ":pdf_font_fuzzer",
- ":pdf_hint_table_fuzzer",
- ":pdf_jpx_fuzzer",
- ":pdf_psengine_fuzzer",
- ":pdf_streamparser_fuzzer",
- ":pdf_xml_fuzzer",
- ]
- if (pdf_enable_xfa) {
- deps += [
- ":pdf_bidi_fuzzer",
- ":pdf_cfx_barcode_fuzzer",
- ":pdf_codec_jpeg_fuzzer",
- ":pdf_css_fuzzer",
- ":pdf_fm2js_fuzzer",
- ":pdf_formcalc_fuzzer",
- ]
- if (pdf_enable_xfa_bmp) {
- deps += [ ":pdf_codec_bmp_fuzzer" ]
- }
- if (pdf_enable_xfa_gif) {
- deps += [
- ":pdf_codec_gif_fuzzer",
- ":pdf_lzw_fuzzer",
- ]
- }
- if (pdf_enable_xfa_png) {
- deps += [ ":pdf_codec_png_fuzzer" ]
- }
- if (pdf_enable_xfa_tiff) {
- deps += [ ":pdf_codec_tiff_fuzzer" ]
- }
- }
-}
-
-template("pdfium_fuzzer") {
- source_set(target_name) {
- sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
+if (pdf_enable_xfa) {
+ group("pdf_bidi_fuzzer") {
deps = [
- "../..:pdfium",
+ "../fuzzers/:pdf_bidi_fuzzer_src",
]
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
testonly = true
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [
- "//build/config/compiler:no_chromium_code",
- ":libfuzzer_config",
- ]
- }
-}
-
-if (pdf_enable_xfa) {
- pdfium_fuzzer("pdf_bidi_fuzzer") {
- sources = [
- "pdf_bidi_fuzzer.cc",
- ]
}
- pdfium_fuzzer("pdf_cfx_barcode_fuzzer") {
- sources = [
- "pdf_cfx_barcode_fuzzer.cc",
+ group("pdf_cfx_barcode_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_cfx_barcode_fuzzer_src",
]
+ testonly = true
}
if (pdf_enable_xfa_bmp) {
- pdfium_fuzzer("pdf_codec_bmp_fuzzer") {
- sources = [
- "pdf_codec_bmp_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ group("pdf_codec_bmp_fuzzer") {
deps = [
- "../../:test_support",
+ "../fuzzers/:pdf_codec_bmp_fuzzer_src",
]
+ testonly = true
}
}
if (pdf_enable_xfa_gif) {
- pdfium_fuzzer("pdf_codec_gif_fuzzer") {
- sources = [
- "pdf_codec_gif_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ group("pdf_codec_gif_fuzzer") {
deps = [
- "../../:test_support",
+ "../fuzzers/:pdf_codec_gif_fuzzer_src",
]
+ testonly = true
}
- pdfium_fuzzer("pdf_lzw_fuzzer") {
- sources = [
- "pdf_lzw_fuzzer.cc",
+ group("pdf_lzw_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_lzw_fuzzer_src",
]
+ testonly = true
}
}
- pdfium_fuzzer("pdf_codec_jpeg_fuzzer") {
- sources = [
- "pdf_codec_jpeg_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ group("pdf_codec_jpeg_fuzzer") {
deps = [
- "../../:test_support",
+ "../fuzzers/:pdf_codec_jpeg_fuzzer_src",
]
+ testonly = true
}
if (pdf_enable_xfa_png) {
- pdfium_fuzzer("pdf_codec_png_fuzzer") {
- sources = [
- "pdf_codec_png_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ group("pdf_codec_png_fuzzer") {
deps = [
- "../../:test_support",
+ "../fuzzers/:pdf_codec_png_fuzzer_src",
]
+ testonly = true
}
}
if (pdf_enable_xfa_tiff) {
- pdfium_fuzzer("pdf_codec_tiff_fuzzer") {
- sources = [
- "pdf_codec_tiff_fuzzer.cc",
- "xfa_codec_fuzzer.h",
- ]
+ group("pdf_codec_tiff_fuzzer") {
deps = [
- "../../:test_support",
+ "../fuzzers/:pdf_codec_tiff_fuzzer_src",
]
+ testonly = true
}
}
- pdfium_fuzzer("pdf_css_fuzzer") {
- sources = [
- "pdf_css_fuzzer.cc",
+ group("pdf_css_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_css_fuzzer_src",
]
+ testonly = true
}
- pdfium_fuzzer("pdf_fm2js_fuzzer") {
- sources = [
- "pdf_fm2js_fuzzer.cc",
+ group("pdf_fm2js_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_fm2js_fuzzer_src",
]
+ testonly = true
}
- pdfium_fuzzer("pdf_formcalc_fuzzer") {
- sources = [
- "pdf_formcalc_fuzzer.cc",
+ group("pdf_formcalc_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_formcalc_fuzzer_src",
]
+ testonly = true
}
}
-pdfium_fuzzer("pdf_cmap_fuzzer") {
- sources = [
- "pdf_cmap_fuzzer.cc",
+group("pdf_cmap_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_cmap_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_codec_a85_fuzzer") {
- sources = [
- "pdf_codec_a85_fuzzer.cc",
+group("pdf_codec_a85_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_codec_a85_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_codec_fax_fuzzer") {
- sources = [
- "pdf_codec_fax_fuzzer.cc",
+group("pdf_codec_fax_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_codec_fax_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_codec_icc_fuzzer") {
+group("pdf_codec_icc_fuzzer") {
deps = [
- "../../third_party/:lcms2",
- ]
- sources = [
- "pdf_codec_icc_fuzzer.cc",
+ "../fuzzers/:pdf_codec_icc_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_codec_jbig2_fuzzer") {
- sources = [
- "pdf_codec_jbig2_fuzzer.cc",
+group("pdf_codec_jbig2_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_codec_jbig2_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_codec_rle_fuzzer") {
- sources = [
- "pdf_codec_rle_fuzzer.cc",
+group("pdf_codec_rle_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_codec_rle_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_font_fuzzer") {
- sources = [
- "pdf_font_fuzzer.cc",
+group("pdf_font_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_font_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_hint_table_fuzzer") {
- sources = [
- "pdf_hint_table_fuzzer.cc",
+group("pdf_hint_table_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_hint_table_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_jpx_fuzzer") {
- sources = [
- "pdf_jpx_fuzzer.cc",
+group("pdf_jpx_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_jpx_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_psengine_fuzzer") {
- sources = [
- "pdf_psengine_fuzzer.cc",
+group("pdf_psengine_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_psengine_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_streamparser_fuzzer") {
- sources = [
- "pdf_streamparser_fuzzer.cc",
+group("pdf_streamparser_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_streamparser_fuzzer_src",
]
+ testonly = true
}
-pdfium_fuzzer("pdf_xml_fuzzer") {
- sources = [
- "pdf_xml_fuzzer.cc",
+group("pdf_xml_fuzzer") {
+ deps = [
+ "../fuzzers/:pdf_xml_fuzzer_src",
]
+ testonly = true
}