1# Copyright (c) 2022-2023 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/distributeddatamgr/pasteboard/pasteboard.gni")
16
17config("module_private_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "${pasteboard_innerkits_path}/include",
22    "//foundation/distributeddatamgr/pasteboard/framework/framework/include",
23    "//foundation/distributeddatamgr/pasteboard/framework/tlv",
24    "${pasteboard_root_path}/framework/framework/include/serializable",
25    "${pasteboard_service_path}/load/include",
26    "include",
27    "test/include",
28  ]
29}
30
31module_output_path = "pasteboard/pasteboard_service"
32
33ohos_unittest("PasteboardFrameworkTest") {
34  branch_protector_ret = "pac_ret"
35  sanitize = {
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39    blocklist = "./cfi_blocklist.txt"
40  }
41  resource_config_file = "//foundation/distributeddatamgr/pasteboard/framework/test/resource/ohos_test.xml"
42  module_out_path = module_output_path
43
44  sources = [
45    "${pasteboard_root_path}/framework/framework/serializable/serializable.cpp",
46    "${pasteboard_service_path}/load/src/config.cpp",
47    "src/convert_utils_test.cpp",
48    "src/dm_adapter_test.cpp",
49    "src/event_center_test.cpp",
50    "src/paste_data_entry_test.cpp",
51    "src/paste_data_record_test.cpp",
52    "src/paste_data_test.cpp",
53    "src/pasteboard_client_test.cpp",
54    "src/pasteboard_client_udmf_delay_test.cpp",
55    "src/pasteboard_multi_type_unified_data_delay_test.cpp",
56    "src/pasteboard_unified_data_test.cpp",
57    "src/pasteboard_utils_test.cpp",
58    "src/serializable_test.cpp",
59    "src/tlv_object_test.cpp",
60    "src/web_controller_test.cpp",
61  ]
62  configs = [
63    "//commonlibrary/c_utils/base:utils_config",
64    ":module_private_config",
65  ]
66  external_deps = [
67    "ability_base:base",
68    "ability_base:want",
69    "ability_base:zuri",
70    "app_file_service:remote_file_share_native",
71    "c_utils:utils",
72    "hilog:libhilog",
73    "image_framework:image_native",
74    "init:libbeget_proxy",
75    "init:libbegetutil",
76    "ipc:ipc_core",
77    "udmf:udmf_client",
78  ]
79
80  deps = [
81    "${pasteboard_framework_path}:pasteboard_framework",
82    "${pasteboard_innerkits_path}:pasteboard_client",
83    "//foundation/distributeddatamgr/pasteboard/framework/uri:pasteboard_uri",
84    "//third_party/googletest:gmock",
85    "//third_party/googletest:gtest_main",
86  ]
87
88  defines = []
89
90  if (pasteboard_device_info_manager_part_enabled) {
91    external_deps += [
92      "device_info_manager:distributed_device_profile_common",
93      "device_info_manager:distributed_device_profile_sdk",
94    ]
95    defines += [ "PB_DEVICE_INFO_MANAGER_ENABLE" ]
96  }
97
98  if (pasteboard_device_manager_part_enabled) {
99    external_deps += [ "device_manager:devicemanagersdk" ]
100    defines += [ "PB_DEVICE_MANAGER_ENABLE" ]
101  }
102
103  configs += [ "//third_party/cJSON:cJSON_config" ]
104
105  deps += [ "//third_party/cJSON:cjson" ]
106}
107