• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15import("//foundation/graphic/graphic_2d/frameworks/text/config.gni")
16import("//foundation/graphic/graphic_2d/graphic_config.gni")
17
18ohos_unittest("rosen_text_skia_txt_test") {
19  module_out_path = text_ut_out_path
20  configs = [ "$rosen_text_root/adapter/skia:skia_libtxt_config" ]
21  sources = [
22    "asset_font_manager_test.cpp",
23    "drawing_painter_impl_test.cpp",
24    "font_collection_test.cpp",
25    "font_mgr_test.cpp",
26    "paint_record_test.cpp",
27    "paragraph_builder_test.cpp",
28    "paragraph_style_test.cpp",
29    "paragraph_test.cpp",
30    "run_test.cpp",
31    "text_bundle_config_parser_test.cpp",
32    "text_line_base_test.cpp",
33    "text_style_test.cpp",
34    "typeface_font_asset_provider_test.cpp",
35  ]
36
37  include_dirs = [
38    "$rosen_text_root",
39    "$rosen_text_root/adapter/skia",
40    "$rosen_text_root/adapter/skia/impl",
41    "$rosen_text_root/adapter/skia/txt",
42    "$rosen_root/modules/render_service_base/include",
43    "$rosen_root/modules/2d_graphics/include/recording",
44    "$rosen_root/modules/2d_graphics/include/text",
45  ]
46
47  cflags_cc = [
48    "-std=c++17",
49    "-Dprivate=public",
50    "-Dprotected=public",
51  ]
52
53  deps = [
54    "$rosen_root/modules/2d_graphics:2d_graphics",
55    "$rosen_text_root:rosen_text",
56  ]
57
58  external_deps = [
59    "hilog:libhilog",
60    "icu:shared_icuuc",
61  ]
62
63  if (platform_is_ohos) {
64    external_deps += [
65      "bundle_framework:appexecfwk_base",
66      "bundle_framework:appexecfwk_core",
67      "c_utils:utils",
68      "samgr:samgr_proxy",
69    ]
70    if (graphic_2d_feature_upgrade_skia) {
71      external_deps += [ "skia:skia_paragraph_ohos_new" ]
72    } else {
73      external_deps += [ "skia:skia_paragraph_ohos" ]
74    }
75    defines = [ "ENABLE_OHOS_ENHANCE" ]
76  }
77
78  part_name = "graphic_2d"
79  subsystem_name = "graphic"
80}
81
82group("unittest") {
83  testonly = true
84
85  deps = [ ":rosen_text_skia_txt_test" ]
86}
87