diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-15 23:51:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-15 23:51:28 +0000 |
commit | 1929d6e1d44ed9bd692c930d5cf79fb2bd80f1e6 (patch) | |
tree | eb99fda121d93741b79d65cf22bf90100093d90a | |
parent | a996ff444d4bf57a78d59dde59b280ca0542962a (diff) | |
download | pdfium-1929d6e1d44ed9bd692c930d5cf79fb2bd80f1e6.tar.xz |
Split pdfium_embeddertests sources.chromium/3582
Move foo_embeddertest.cpp to the same BUILD.gn file as foo.cpp.
Set up dependencies to make pdfium_embeddertests pass gn check.
Change-Id: If1fe67c261960c35c344c1047950cd7fdb32c4a1
Reviewed-on: https://pdfium-review.googlesource.com/c/43997
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | .gn | 1 | ||||
-rw-r--r-- | BUILD.gn | 94 | ||||
-rw-r--r-- | core/fpdfapi/edit/BUILD.gn | 7 | ||||
-rw-r--r-- | core/fpdfapi/page/BUILD.gn | 9 | ||||
-rw-r--r-- | core/fpdfapi/parser/BUILD.gn | 12 | ||||
-rw-r--r-- | core/fpdfapi/render/BUILD.gn | 9 | ||||
-rw-r--r-- | core/fxcodec/BUILD.gn | 7 | ||||
-rw-r--r-- | core/fxge/BUILD.gn | 17 | ||||
-rw-r--r-- | fpdfsdk/BUILD.gn | 31 | ||||
-rw-r--r-- | fpdfsdk/pwl/BUILD.gn | 14 | ||||
-rw-r--r-- | fxjs/BUILD.gn | 17 | ||||
-rw-r--r-- | testing/BUILD.gn | 45 | ||||
-rw-r--r-- | testing/test.gni | 21 | ||||
-rw-r--r-- | xfa/fwl/BUILD.gn | 7 | ||||
-rw-r--r-- | xfa/fxfa/parser/BUILD.gn | 7 |
15 files changed, 239 insertions, 59 deletions
@@ -18,6 +18,7 @@ default_args = { check_targets = [ ":pdfium", + ":pdfium_embeddertests", ":pdfium_unittests", "//core/*", "//fpdfsdk/*", @@ -214,7 +214,7 @@ group("pdfium_unittest_deps") { testonly = true public_deps = [ "core/fxcrt", - "testing/:test_support", + "testing:test_support", "//testing/gmock", "//testing/gtest", ] @@ -246,7 +246,7 @@ test("pdfium_unittests") { "core/fxge", "core/fxge:unittests", "fpdfsdk:unittests", - "testing/:test_support", + "testing:test_support", "//testing/gmock", "//testing/gtest", ] @@ -278,53 +278,40 @@ test("pdfium_unittests") { } } +group("pdfium_embeddertest_deps") { + testonly = true + public_deps = [ + ":pdfium_public_headers", + "core/fxcrt", + "testing:embedder_test_support", + "testing:test_support", + "//testing/gmock", + "//testing/gtest", + ] + visibility += [ + "core/*", + "fpdfsdk/*", + "fxjs/*", + "xfa/*", + ] +} + test("pdfium_embeddertests") { testonly = true sources = [ - "core/fpdfapi/edit/cpdf_creator_embeddertest.cpp", - "core/fpdfapi/page/cpdf_docpagedata_embeddertest.cpp", - "core/fpdfapi/page/cpdf_function_embeddertest.cpp", - "core/fpdfapi/page/cpdf_stitchfunc_embeddertest.cpp", - "core/fpdfapi/parser/cpdf_parser_embeddertest.cpp", - "core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp", - "core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp", - "core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp", - "core/fpdfapi/render/fpdf_render_pattern_embeddertest.cpp", - "core/fxcodec/codec/fx_codec_embeddertest.cpp", - "core/fxge/fx_ge_text_embeddertest.cpp", - "fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp", - "fpdfsdk/fpdf_annot_embeddertest.cpp", - "fpdfsdk/fpdf_attachment_embeddertest.cpp", - "fpdfsdk/fpdf_dataavail_embeddertest.cpp", - "fpdfsdk/fpdf_doc_embeddertest.cpp", - "fpdfsdk/fpdf_edit_embeddertest.cpp", - "fpdfsdk/fpdf_editpath_embeddertest.cpp", - "fpdfsdk/fpdf_ext_embeddertest.cpp", - "fpdfsdk/fpdf_flatten_embeddertest.cpp", - "fpdfsdk/fpdf_formfill_embeddertest.cpp", - "fpdfsdk/fpdf_ppo_embeddertest.cpp", - "fpdfsdk/fpdf_save_embeddertest.cpp", - "fpdfsdk/fpdf_structtree_embeddertest.cpp", - "fpdfsdk/fpdf_text_embeddertest.cpp", - "fpdfsdk/fpdf_transformpage_embeddertest.cpp", - "fpdfsdk/fpdf_view_c_api_test.c", - "fpdfsdk/fpdf_view_c_api_test.h", - "fpdfsdk/fpdf_view_embeddertest.cpp", - "fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp", - "fpdfsdk/pwl/cpwl_edit_embeddertest.cpp", - "testing/embedder_test.cpp", - "testing/embedder_test.h", "testing/embedder_test_main.cpp", - "testing/embedder_test_mock_delegate.h", - "testing/embedder_test_timer_handling_delegate.h", - "testing/fake_file_access.cpp", - "testing/fake_file_access.h", - "testing/range_set.cpp", - "testing/range_set.h", ] deps = [ ":pdfium", - "testing/:test_support", + "core/fpdfapi/edit:embeddertests", + "core/fpdfapi/page:embeddertests", + "core/fpdfapi/parser:embeddertests", + "core/fpdfapi/render:embeddertests", + "core/fxcodec:embeddertests", + "core/fxge:embeddertests", + "fpdfsdk:embeddertests", + "fpdfsdk/pwl:embeddertests", + "testing:test_support", "testing/image_diff", "//testing/gmock", "//testing/gtest", @@ -338,30 +325,19 @@ test("pdfium_embeddertests") { } if (pdf_enable_v8) { - sources += [ - "fxjs/cfxjs_engine_embeddertest.cpp", - "fxjs/cjs_publicmethods_embeddertest.cpp", - "testing/js_embedder_test.cpp", - "testing/js_embedder_test.h", + deps += [ + "fxjs:embeddertests", + "//v8", ] - deps += [ "fxjs" ] configs += [ "//v8:external_startup_data" ] } if (pdf_enable_xfa) { - sources += [ - "fxjs/cfxjse_formcalc_context_embeddertest.cpp", - "testing/xfa_js_embedder_test.cpp", - "testing/xfa_js_embedder_test.h", - "xfa/fwl/cfwl_edit_embeddertest.cpp", - "xfa/fxfa/parser/cxfa_document_parser_embeddertest.cpp", + deps += [ + "xfa/fwl:embeddertests", + "xfa/fxfa/parser:embeddertests", ] } - - if (pdf_use_skia || pdf_use_skia_paths) { - sources += [ "core/fxge/skia/fx_skia_device_embeddertest.cpp" ] - deps += [ "//skia" ] - } } if (pdf_is_standalone) { diff --git a/core/fpdfapi/edit/BUILD.gn b/core/fpdfapi/edit/BUILD.gn index 6c88522590..ff127a9a7e 100644 --- a/core/fpdfapi/edit/BUILD.gn +++ b/core/fpdfapi/edit/BUILD.gn @@ -46,3 +46,10 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../../../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cpdf_creator_embeddertest.cpp", + ] + pdfium_root_dir = "../../../" +} diff --git a/core/fpdfapi/page/BUILD.gn b/core/fpdfapi/page/BUILD.gn index 9c57fce67a..7855dc12e9 100644 --- a/core/fpdfapi/page/BUILD.gn +++ b/core/fpdfapi/page/BUILD.gn @@ -126,3 +126,12 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../../../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cpdf_docpagedata_embeddertest.cpp", + "cpdf_function_embeddertest.cpp", + "cpdf_stitchfunc_embeddertest.cpp", + ] + pdfium_root_dir = "../../../" +} diff --git a/core/fpdfapi/parser/BUILD.gn b/core/fpdfapi/parser/BUILD.gn index 52de29dfc9..45035b3d0e 100644 --- a/core/fpdfapi/parser/BUILD.gn +++ b/core/fpdfapi/parser/BUILD.gn @@ -115,3 +115,15 @@ pdfium_unittest_source_set("unittests") { cflags = [ "-Wno-inconsistent-missing-override" ] } } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cpdf_parser_embeddertest.cpp", + "cpdf_security_handler_embeddertest.cpp", + "fpdf_parser_decode_embeddertest.cpp", + ] + deps = [ + ":parser", + ] + pdfium_root_dir = "../../../" +} diff --git a/core/fpdfapi/render/BUILD.gn b/core/fpdfapi/render/BUILD.gn index 042f04d179..1166907755 100644 --- a/core/fpdfapi/render/BUILD.gn +++ b/core/fpdfapi/render/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/jumbo.gni") import("../../../pdfium.gni") +import("../../../testing/test.gni") jumbo_source_set("render") { sources = [ @@ -61,3 +62,11 @@ jumbo_source_set("render") { ] visibility = [ "../../../*" ] } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "fpdf_render_loadimage_embeddertest.cpp", + "fpdf_render_pattern_embeddertest.cpp", + ] + pdfium_root_dir = "../../../" +} diff --git a/core/fxcodec/BUILD.gn b/core/fxcodec/BUILD.gn index 1c68956711..e09b7a61cd 100644 --- a/core/fxcodec/BUILD.gn +++ b/core/fxcodec/BUILD.gn @@ -147,3 +147,10 @@ pdfium_unittest_source_set("unittests") { ] } } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "codec/fx_codec_embeddertest.cpp", + ] + pdfium_root_dir = "../../" +} diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn index 03bfd4b320..6475dc35d5 100644 --- a/core/fxge/BUILD.gn +++ b/core/fxge/BUILD.gn @@ -189,3 +189,20 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "fx_ge_text_embeddertest.cpp", + ] + deps = [] + pdfium_root_dir = "../../" + + if (pdf_use_skia || pdf_use_skia_paths) { + sources += [ "skia/fx_skia_device_embeddertest.cpp" ] + deps += [ + ":fxge", + "../../fpdfsdk", + "//skia", + ] + } +} diff --git a/fpdfsdk/BUILD.gn b/fpdfsdk/BUILD.gn index 3799d35107..1759ccf767 100644 --- a/fpdfsdk/BUILD.gn +++ b/fpdfsdk/BUILD.gn @@ -105,3 +105,34 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cpdfsdk_annotiterator_embeddertest.cpp", + "fpdf_annot_embeddertest.cpp", + "fpdf_attachment_embeddertest.cpp", + "fpdf_dataavail_embeddertest.cpp", + "fpdf_doc_embeddertest.cpp", + "fpdf_edit_embeddertest.cpp", + "fpdf_editpath_embeddertest.cpp", + "fpdf_ext_embeddertest.cpp", + "fpdf_flatten_embeddertest.cpp", + "fpdf_formfill_embeddertest.cpp", + "fpdf_ppo_embeddertest.cpp", + "fpdf_save_embeddertest.cpp", + "fpdf_structtree_embeddertest.cpp", + "fpdf_text_embeddertest.cpp", + "fpdf_transformpage_embeddertest.cpp", + "fpdf_view_c_api_test.c", + "fpdf_view_c_api_test.h", + "fpdf_view_embeddertest.cpp", + ] + deps = [ + ":fpdfsdk", + "../core/fpdfapi/font", + "../core/fpdfapi/page", + "../core/fpdfapi/parser", + "../core/fxge", + ] + pdfium_root_dir = "../" +} diff --git a/fpdfsdk/pwl/BUILD.gn b/fpdfsdk/pwl/BUILD.gn index c600647452..39c3410bdb 100644 --- a/fpdfsdk/pwl/BUILD.gn +++ b/fpdfsdk/pwl/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/jumbo.gni") import("../../pdfium.gni") +import("../../testing/test.gni") jumbo_source_set("pwl") { sources = [ @@ -54,3 +55,16 @@ jumbo_source_set("pwl") { ] visibility = [ "../../*" ] } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cpwl_combo_box_embeddertest.cpp", + "cpwl_edit_embeddertest.cpp", + ] + deps = [ + ":pwl", + "../:fpdfsdk", + "../formfiller", + ] + pdfium_root_dir = "../../" +} diff --git a/fxjs/BUILD.gn b/fxjs/BUILD.gn index 09595e36fe..2022d3b735 100644 --- a/fxjs/BUILD.gn +++ b/fxjs/BUILD.gn @@ -462,4 +462,21 @@ if (pdf_enable_v8) { ] pdfium_root_dir = "../" } + + pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cfxjs_engine_embeddertest.cpp", + "cjs_publicmethods_embeddertest.cpp", + ] + configs = [ "//v8:external_startup_data" ] + deps = [ + ":fxjs", + ] + pdfium_root_dir = "../" + + if (pdf_enable_xfa) { + sources += [ "cfxjse_formcalc_context_embeddertest.cpp" ] + deps += [ "..///xfa/fxfa" ] + } + } } diff --git a/testing/BUILD.gn b/testing/BUILD.gn index c231e2207f..8494fc38ef 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -41,3 +41,48 @@ jumbo_source_set("test_support") { configs += [ "//v8:external_startup_data" ] } } + +jumbo_source_set("embedder_test_support") { + testonly = true + sources = [ + "embedder_test.cpp", + "embedder_test.h", + "embedder_test_mock_delegate.h", + "embedder_test_timer_handling_delegate.h", + "fake_file_access.cpp", + "fake_file_access.h", + "range_set.cpp", + "range_set.h", + ] + + deps = [ + ":test_support", + "../:pdfium", + "../core/fdrm", + "//testing/gmock", + "//testing/gtest", + ] + configs += [ "../:pdfium_core_config" ] + visibility = [ "../*" ] + + if (pdf_enable_v8) { + sources += [ + "js_embedder_test.cpp", + "js_embedder_test.h", + ] + deps += [ "../fxjs" ] + } + + if (pdf_enable_xfa) { + sources += [ + "xfa_js_embedder_test.cpp", + "xfa_js_embedder_test.h", + ] + deps += [ + "../fpdfsdk", + "../fpdfsdk/fpdfxfa", + "../xfa/fxfa", + "../xfa/fxfa/parser", + ] + } +} diff --git a/testing/test.gni b/testing/test.gni index 0bfac4666c..9b72dc8ac0 100644 --- a/testing/test.gni +++ b/testing/test.gni @@ -284,3 +284,24 @@ template("pdfium_unittest_source_set") { forward_variables_from(invoker, [ "cflags" ]) } } + +template("pdfium_embeddertest_source_set") { + source_set(target_name) { + _pdfium_root_dir = rebase_path(invoker.pdfium_root_dir, ".") + + testonly = true + sources = invoker.sources + configs += [ _pdfium_root_dir + ":pdfium_core_config" ] + if (defined(invoker.configs)) { + configs += invoker.configs + } + deps = [ + _pdfium_root_dir + ":pdfium_embeddertest_deps", + ] + if (defined(invoker.deps)) { + deps += invoker.deps + } + visibility = [ _pdfium_root_dir + ":*" ] + forward_variables_from(invoker, [ "cflags" ]) + } +} diff --git a/xfa/fwl/BUILD.gn b/xfa/fwl/BUILD.gn index f6ca14111c..55586eafc1 100644 --- a/xfa/fwl/BUILD.gn +++ b/xfa/fwl/BUILD.gn @@ -147,3 +147,10 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cfwl_edit_embeddertest.cpp", + ] + pdfium_root_dir = "../../" +} diff --git a/xfa/fxfa/parser/BUILD.gn b/xfa/fxfa/parser/BUILD.gn index 8575a019f4..8d9dc06317 100644 --- a/xfa/fxfa/parser/BUILD.gn +++ b/xfa/fxfa/parser/BUILD.gn @@ -735,3 +735,10 @@ pdfium_unittest_source_set("unittests") { ] pdfium_root_dir = "../../../" } + +pdfium_embeddertest_source_set("embeddertests") { + sources = [ + "cxfa_document_parser_embeddertest.cpp", + ] + pdfium_root_dir = "../../../" +} |