summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-15 23:48:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-15 23:48:29 +0000
commitf03f7810c30cb3d01517c0efc189d68e440c9162 (patch)
treef33e92d77b99b55bb2ae8dba6ba374cf3c6cb5f3 /core
parent1987bbfdbcc15e6954aa1340d1a55fda4a532914 (diff)
downloadpdfium-f03f7810c30cb3d01517c0efc189d68e440c9162.tar.xz
Split pdfium_unittests sources.
Move foo_unittest.cpp to the same BUILD.gn file as foo.cpp. Set up dependencies to make pdfium_unittests pass gn check. Change-Id: Id9f649d5d0c76fe4254f3887778516abb75fcbce Reviewed-on: https://pdfium-review.googlesource.com/c/43995 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fdrm/BUILD.gn11
-rw-r--r--core/fpdfapi/edit/BUILD.gn15
-rw-r--r--core/fpdfapi/font/BUILD.gn12
-rw-r--r--core/fpdfapi/page/BUILD.gn15
-rw-r--r--core/fpdfapi/parser/BUILD.gn32
-rw-r--r--core/fpdfdoc/BUILD.gn17
-rw-r--r--core/fpdftext/BUILD.gn11
-rw-r--r--core/fxcodec/BUILD.gn23
-rw-r--r--core/fxcrt/BUILD.gn49
-rw-r--r--core/fxge/BUILD.gn14
10 files changed, 199 insertions, 0 deletions
diff --git a/core/fdrm/BUILD.gn b/core/fdrm/BUILD.gn
index 7a083ffd63..ce70689879 100644
--- a/core/fdrm/BUILD.gn
+++ b/core/fdrm/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
jumbo_source_set("fdrm") {
sources = [
@@ -18,3 +19,13 @@ jumbo_source_set("fdrm") {
]
visibility = [ "../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "fx_crypt_unittest.cpp",
+ ]
+ deps = [
+ ":fdrm",
+ ]
+ pdfium_root_dir = "../../"
+}
diff --git a/core/fpdfapi/edit/BUILD.gn b/core/fpdfapi/edit/BUILD.gn
index de1a404c87..6c88522590 100644
--- a/core/fpdfapi/edit/BUILD.gn
+++ b/core/fpdfapi/edit/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../../pdfium.gni")
+import("../../../testing/test.gni")
jumbo_source_set("edit") {
sources = [
@@ -31,3 +32,17 @@ jumbo_source_set("edit") {
allow_circular_includes_from = [ "../parser" ]
visibility = [ "../../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_pagecontentgenerator_unittest.cpp",
+ ]
+ deps = [
+ ":edit",
+ "../",
+ "../font",
+ "../page",
+ "../parser",
+ ]
+ pdfium_root_dir = "../../../"
+}
diff --git a/core/fpdfapi/font/BUILD.gn b/core/fpdfapi/font/BUILD.gn
index a8f8619124..a6f9705ada 100644
--- a/core/fpdfapi/font/BUILD.gn
+++ b/core/fpdfapi/font/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../../pdfium.gni")
+import("../../../testing/test.gni")
jumbo_source_set("font") {
sources = [
@@ -54,3 +55,14 @@ jumbo_source_set("font") {
]
visibility = [ "../../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_cmapparser_unittest.cpp",
+ "cpdf_tounicodemap_unittest.cpp",
+ ]
+ deps = [
+ ":font",
+ ]
+ pdfium_root_dir = "../../../"
+}
diff --git a/core/fpdfapi/page/BUILD.gn b/core/fpdfapi/page/BUILD.gn
index 5df39f2068..9c57fce67a 100644
--- a/core/fpdfapi/page/BUILD.gn
+++ b/core/fpdfapi/page/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../../pdfium.gni")
+import("../../../testing/test.gni")
jumbo_source_set("page") {
sources = [
@@ -111,3 +112,17 @@ jumbo_source_set("page") {
}
visibility = [ "../../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_devicecs_unittest.cpp",
+ "cpdf_pageobjectholder_unittest.cpp",
+ "cpdf_psengine_unittest.cpp",
+ "cpdf_streamcontentparser_unittest.cpp",
+ "cpdf_streamparser_unittest.cpp",
+ ]
+ deps = [
+ ":page",
+ ]
+ pdfium_root_dir = "../../../"
+}
diff --git a/core/fpdfapi/parser/BUILD.gn b/core/fpdfapi/parser/BUILD.gn
index 64306dff1d..52de29dfc9 100644
--- a/core/fpdfapi/parser/BUILD.gn
+++ b/core/fpdfapi/parser/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../../pdfium.gni")
+import("../../../testing/test.gni")
jumbo_source_set("parser") {
sources = [
@@ -83,3 +84,34 @@ jumbo_source_set("parser") {
]
visibility = [ "../../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_array_unittest.cpp",
+ "cpdf_cross_ref_avail_unittest.cpp",
+ "cpdf_document_unittest.cpp",
+ "cpdf_hint_tables_unittest.cpp",
+ "cpdf_indirect_object_holder_unittest.cpp",
+ "cpdf_object_avail_unittest.cpp",
+ "cpdf_object_unittest.cpp",
+ "cpdf_object_walker_unittest.cpp",
+ "cpdf_page_object_avail_unittest.cpp",
+ "cpdf_parser_unittest.cpp",
+ "cpdf_read_validator_unittest.cpp",
+ "cpdf_simple_parser_unittest.cpp",
+ "cpdf_stream_acc_unittest.cpp",
+ "cpdf_syntax_parser_unittest.cpp",
+ "fpdf_parser_decode_unittest.cpp",
+ "fpdf_parser_utility_unittest.cpp",
+ ]
+ deps = [
+ ":parser",
+ "../",
+ ]
+ pdfium_root_dir = "../../../"
+
+ if (is_clang) {
+ # Suppress no override warning for overridden functions.
+ cflags = [ "-Wno-inconsistent-missing-override" ]
+ }
+}
diff --git a/core/fpdfdoc/BUILD.gn b/core/fpdfdoc/BUILD.gn
index 411d26a7cb..e243823ac4 100644
--- a/core/fpdfdoc/BUILD.gn
+++ b/core/fpdfdoc/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
jumbo_source_set("fpdfdoc") {
sources = [
@@ -99,3 +100,19 @@ jumbo_source_set("fpdfdoc") {
]
visibility = [ "../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_defaultappearance_unittest.cpp",
+ "cpdf_dest_unittest.cpp",
+ "cpdf_filespec_unittest.cpp",
+ "cpdf_formfield_unittest.cpp",
+ "cpdf_metadata_unittest.cpp",
+ "cpdf_nametree_unittest.cpp",
+ ]
+ deps = [
+ ":fpdfdoc",
+ "../fpdfapi/parser",
+ ]
+ pdfium_root_dir = "../../"
+}
diff --git a/core/fpdftext/BUILD.gn b/core/fpdftext/BUILD.gn
index 1319c62c7d..2192df6a72 100644
--- a/core/fpdftext/BUILD.gn
+++ b/core/fpdftext/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
jumbo_source_set("fpdftext") {
sources = [
@@ -25,3 +26,13 @@ jumbo_source_set("fpdftext") {
]
visibility = [ "../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "cpdf_linkextract_unittest.cpp",
+ ]
+ deps = [
+ ":fpdftext",
+ ]
+ pdfium_root_dir = "../../"
+}
diff --git a/core/fxcodec/BUILD.gn b/core/fxcodec/BUILD.gn
index 4c06d5540f..1c68956711 100644
--- a/core/fxcodec/BUILD.gn
+++ b/core/fxcodec/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
jumbo_source_set("fxcodec") {
sources = [
@@ -124,3 +125,25 @@ jumbo_source_set("fxcodec") {
}
visibility = [ "../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "codec/fx_codec_a85_unittest.cpp",
+ "codec/fx_codec_jpx_unittest.cpp",
+ "codec/fx_codec_rle_unittest.cpp",
+ "jbig2/JBig2_BitStream_unittest.cpp",
+ "jbig2/JBig2_Image_unittest.cpp",
+ ]
+ deps = [
+ ":fxcodec",
+ "../fpdfapi/parser",
+ ]
+ pdfium_root_dir = "../../"
+
+ if (pdf_enable_xfa && pdf_enable_xfa_gif) {
+ sources += [
+ "gif/cfx_gifcontext_unittest.cpp",
+ "gif/cfx_lzwdecompressor_unittest.cpp",
+ ]
+ }
+}
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn
index 3a3852069e..d489deabb9 100644
--- a/core/fxcrt/BUILD.gn
+++ b/core/fxcrt/BUILD.gn
@@ -4,6 +4,7 @@
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
jumbo_source_set("fxcrt") {
sources = [
@@ -144,3 +145,51 @@ if (pdf_enable_xfa) {
visibility = [ "../../*" ]
}
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "autorestorer_unittest.cpp",
+ "bytestring_unittest.cpp",
+ "cfx_bitstream_unittest.cpp",
+ "fx_bidi_unittest.cpp",
+ "fx_coordinates_unittest.cpp",
+ "fx_extension_unittest.cpp",
+ "fx_memory_unittest.cpp",
+ "fx_number_unittest.cpp",
+ "fx_random_unittest.cpp",
+ "fx_string_unittest.cpp",
+ "fx_system_unittest.cpp",
+ "maybe_owned_unittest.cpp",
+ "observable_unittest.cpp",
+ "pdfium_span_unittest.cpp",
+ "retain_ptr_unittest.cpp",
+ "shared_copy_on_write_unittest.cpp",
+ "string_pool_template_unittest.cpp",
+ "unowned_ptr_unittest.cpp",
+ "weak_ptr_unittest.cpp",
+ "widestring_unittest.cpp",
+ "xml/cfx_xmlchardata_unittest.cpp",
+ "xml/cfx_xmldocument_unittest.cpp",
+ "xml/cfx_xmlelement_unittest.cpp",
+ "xml/cfx_xmlinstruction_unittest.cpp",
+ "xml/cfx_xmlnode_unittest.cpp",
+ "xml/cfx_xmlparser_unittest.cpp",
+ "xml/cfx_xmltext_unittest.cpp",
+ ]
+ deps = []
+ pdfium_root_dir = "../../"
+
+ if (pdf_enable_xfa) {
+ sources += [
+ "cfx_seekablemultistream_unittest.cpp",
+ "css/cfx_cssdeclaration_unittest.cpp",
+ "css/cfx_cssstylesheet_unittest.cpp",
+ "css/cfx_cssvaluelistparser_unittest.cpp",
+ ]
+ deps += [
+ ":seekablemultistream",
+ "../fpdfapi/parser",
+ "css",
+ ]
+ }
+}
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 6168fa911b..03bfd4b320 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/freetype/freetype.gni")
import("//build/config/jumbo.gni")
import("../../pdfium.gni")
+import("../../testing/test.gni")
config("fxge_warnings") {
visibility = [ ":*" ]
@@ -175,3 +176,16 @@ jumbo_source_set("fxge") {
visibility = [ "../../*" ]
}
+
+pdfium_unittest_source_set("unittests") {
+ sources = [
+ "dib/cfx_dibitmap_unittest.cpp",
+ "dib/cstretchengine_unittest.cpp",
+ ]
+ deps = [
+ ":fxge",
+ "../fpdfapi/parser",
+ "../fpdfapi/render",
+ ]
+ pdfium_root_dir = "../../"
+}