• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//base/notification/distributed_notification_service/notification.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17
18module_output_path =
19    "${component_name}/distributed_notification_service/moduletest"
20
21config("public_ans_config") {
22  include_dirs = [
23    "${core_path}/common/include",
24    "${services_path}/ans/include",
25    "${core_path}/include",
26  ]
27}
28
29ohos_moduletest("ans_innerkits_module_publish_test") {
30  sanitize = {
31    integer_overflow = true
32    ubsan = true
33    boundary_sanitize = true
34    cfi = true
35    cfi_cross_dso = true
36    debug = false
37  }
38
39  module_out_path = module_output_path
40  include_dirs = [
41    "include",
42    "${core_path}/include",
43    "${inner_api_path}",
44    "${core_path}/common/include",
45    "${core_path}/include",
46    "${component_path}/services/ans/include",
47    "${inner_api_path}",
48    "${core_path}/common/include",
49    "${core_path}/include",
50    "${inner_api_path}",
51    "${frameworks_path}/test/moduletest/mock/include",
52  ]
53
54  sources = [
55    "${test_path}/mock/mock_tokenid_kit.cpp",
56    "ans_innerkits_module_publish_test.cpp",
57    "mock/mock_accesstoken_kit.cpp",
58    "mock/mock_bundle_manager.cpp",
59    "mock/mock_bundle_manager_helper.cpp",
60    "mock/mock_ipc.cpp",
61    "mock/remote_native_token.cpp",
62  ]
63
64  deps = [
65    "${frameworks_module_ans_path}:ans_innerkits",
66    "${services_path}/ans:libans",
67  ]
68
69  defines = []
70  if (distributed_notification_supported) {
71    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
72    deps += [ "${services_path}/distributed:libans_distributed" ]
73  }
74
75  external_deps = [
76    "ability_base:base",
77    "ability_base:want",
78    "ability_base:zuri",
79    "ability_runtime:ability_context_native",
80    "ability_runtime:abilitykit_native",
81    "ability_runtime:app_context",
82    "ability_runtime:appkit_native",
83    "ability_runtime:wantagent_innerkits",
84    "access_token:libaccesstoken_sdk",
85    "access_token:libnativetoken",
86    "access_token:libtoken_setproc",
87    "bundle_framework:appexecfwk_base",
88    "bundle_framework:appexecfwk_core",
89    "c_utils:utils",
90    "common_event_service:cesfwk_innerkits",
91    "eventhandler:libeventhandler",
92    "ffrt:libffrt",
93    "googletest:gtest_main",
94    "hilog:libhilog",
95    "image_framework:image_native",
96    "ipc:ipc_core",
97    "json:nlohmann_json_static",
98    "kv_store:distributeddata_inner",
99    "relational_store:native_rdb",
100    "safwk:system_ability_fwk",
101    "samgr:samgr_proxy",
102    "selinux_adapter:librestorecon",
103  ]
104
105  subsystem_name = "${subsystem_name}"
106  part_name = "${component_name}"
107}
108
109ohos_moduletest("ans_innerkits_module_slot_test") {
110  module_out_path = module_output_path
111  include_dirs = [
112    "include",
113    "${core_path}/include",
114    "${inner_api_path}",
115    "${frameworks_path}/ans/core/common/include",
116    "${frameworks_path}/ans/core/include",
117    "${component_path}/services/ans/include",
118    "${inner_api_path}",
119    "${core_path}/common/include",
120    "${core_path}/include",
121    "${inner_api_path}",
122    "${frameworks_path}/test/moduletest/mock/include",
123  ]
124
125  sources = [
126    "${test_path}/mock/mock_tokenid_kit.cpp",
127    "ans_innerkits_module_slot_test.cpp",
128    "mock/distributed_kv_data_manager.cpp",
129    "mock/mock_accesstoken_kit.cpp",
130    "mock/mock_bundle_manager.cpp",
131    "mock/mock_bundle_manager_helper.cpp",
132    "mock/mock_ipc.cpp",
133    "mock/mock_single_kv_store.cpp",
134    "mock/remote_native_token.cpp",
135  ]
136
137  deps = [
138    "${frameworks_module_ans_path}:ans_innerkits",
139    "${services_path}/ans:libans",
140  ]
141
142  defines = []
143  if (distributed_notification_supported) {
144    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
145    deps += [ "${services_path}/distributed:libans_distributed" ]
146  }
147
148  external_deps = [
149    "ability_base:want",
150    "ability_base:zuri",
151    "ability_runtime:wantagent_innerkits",
152    "access_token:libaccesstoken_sdk",
153    "access_token:libnativetoken",
154    "access_token:libtoken_setproc",
155    "bundle_framework:appexecfwk_base",
156    "bundle_framework:appexecfwk_core",
157    "c_utils:utils",
158    "common_event_service:cesfwk_innerkits",
159    "eventhandler:libeventhandler",
160    "ffrt:libffrt",
161    "googletest:gtest_main",
162    "hilog:libhilog",
163    "image_framework:image_native",
164    "ipc:ipc_core",
165    "json:nlohmann_json_static",
166    "kv_store:distributeddata_inner",
167    "relational_store:native_rdb",
168    "safwk:system_ability_fwk",
169    "samgr:samgr_proxy",
170    "selinux_adapter:librestorecon",
171  ]
172
173  subsystem_name = "${subsystem_name}"
174  part_name = "${component_name}"
175}
176
177ohos_moduletest("ans_innerkits_module_setting_test") {
178  sanitize = {
179    integer_overflow = true
180    ubsan = true
181    boundary_sanitize = true
182    cfi = true
183    cfi_cross_dso = true
184    debug = false
185  }
186
187  module_out_path = module_output_path
188  include_dirs = [
189    "include",
190    "${core_path}/include",
191    "${inner_api_path}",
192    "${frameworks_path}/ans/core/common/include",
193    "${frameworks_path}/ans/core/include",
194    "${component_path}/services/ans/include",
195    "${inner_api_path}",
196    "${core_path}/common/include",
197    "${core_path}/include",
198    "${inner_api_path}",
199    "${frameworks_path}/test/moduletest/mock/include",
200  ]
201
202  sources = [
203    "ans_innerkits_module_setting_test.cpp",
204    "mock/distributed_kv_data_manager.cpp",
205    "mock/mock_bundle_manager_helper.cpp",
206    "mock/mock_ipc.cpp",
207    "mock/mock_single_kv_store.cpp",
208    "mock/remote_native_token.cpp",
209  ]
210
211  deps = [
212    "${frameworks_module_ans_path}:ans_innerkits",
213    "${services_path}/ans:libans",
214  ]
215
216  defines = []
217  if (distributed_notification_supported) {
218    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
219    deps += [ "${services_path}/distributed:libans_distributed" ]
220  }
221
222  external_deps = [
223    "ability_base:want",
224    "ability_base:zuri",
225    "ability_runtime:wantagent_innerkits",
226    "access_token:libaccesstoken_sdk",
227    "access_token:libnativetoken",
228    "access_token:libtoken_setproc",
229    "bundle_framework:appexecfwk_base",
230    "bundle_framework:appexecfwk_core",
231    "c_utils:utils",
232    "common_event_service:cesfwk_innerkits",
233    "eventhandler:libeventhandler",
234    "ffrt:libffrt",
235    "googletest:gtest_main",
236    "hilog:libhilog",
237    "image_framework:image_native",
238    "ipc:ipc_core",
239    "json:nlohmann_json_static",
240    "kv_store:distributeddata_inner",
241    "relational_store:native_rdb",
242    "safwk:system_ability_fwk",
243    "samgr:samgr_proxy",
244    "selinux_adapter:librestorecon",
245  ]
246
247  subsystem_name = "${subsystem_name}"
248  part_name = "${component_name}"
249}
250
251group("moduletest") {
252  testonly = true
253  deps = []
254
255  deps += [
256    ":ans_innerkits_module_publish_test",
257    ":ans_innerkits_module_setting_test",
258    ":ans_innerkits_module_slot_test",
259  ]
260}
261