• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/ohos.gni")
15import("//build/ohos_var.gni")
16import("//build/test.gni")
17import("//foundation/deviceprofile/device_info_manager/deviceprofile.gni")
18
19module_output_path = "device_info_manager/deviceprofiletest"
20
21device_profile_configs =
22    [ "${device_profile_service}:device_info_manager_config" ]
23
24device_profile_deps = [
25  "${device_profile_common}:distributed_device_profile_common",
26  "${device_profile_innerkits}:distributed_device_profile_sdk",
27  "${device_profile_service}:distributed_device_profile_svr",
28  "//third_party/googletest:gtest_main",
29]
30
31device_profile_external_deps = [
32  "access_token:libaccesstoken_sdk",
33  "access_token:libnativetoken",
34  "access_token:libtoken_setproc",
35  "c_utils:utils",
36  "device_auth:deviceauth_sdk",
37  "device_manager:devicemanagersdk",
38  "dmsfwk:common_sdk",
39  "eventhandler:libeventhandler",
40  "hilog:libhilog",
41  "hisysevent:libhisysevent",
42  "hitrace:hitrace_meter",
43  "init:libbegetutil",
44  "ipc:ipc_core",
45  "kv_store:distributeddata_inner",
46  "relational_store:native_rdb",
47  "safwk:system_ability_fwk",
48  "samgr:samgr_proxy",
49  "syscap_codec:syscap_interface_shared",
50]
51
52ohos_unittest("rdb_adapter_new_test") {
53  module_out_path = module_output_path
54  sources = [ "unittest/rdb_adapter_test.cpp" ]
55  configs = device_profile_configs
56  deps = device_profile_deps
57  external_deps = device_profile_external_deps
58  part_name = "device_info_manager"
59  subsystem_name = "deviceprofile"
60}
61
62ohos_unittest("TrustProfileManagerTest") {
63  module_out_path = module_output_path
64  sources = [ "unittest/trust_profile_manager_test.cpp" ]
65  configs = device_profile_configs
66  deps = device_profile_deps
67  external_deps = device_profile_external_deps
68  part_name = "device_info_manager"
69  subsystem_name = "deviceprofile"
70}
71
72ohos_unittest("distributed_device_profile_client_kv_new_test") {
73  module_out_path = module_output_path
74  sources = [ "unittest/distributed_device_profile_client_kv_test.cpp" ]
75  configs = device_profile_configs
76  deps = device_profile_deps
77  external_deps = device_profile_external_deps
78  part_name = "device_info_manager"
79  subsystem_name = "deviceprofile"
80}
81
82ohos_unittest("device_profile_manager_new_test") {
83  module_out_path = module_output_path
84  sources = [ "unittest/device_profile_manager_test.cpp" ]
85  configs = device_profile_configs
86  deps = device_profile_deps
87  external_deps = device_profile_external_deps
88  part_name = "device_info_manager"
89  subsystem_name = "deviceprofile"
90}
91
92ohos_unittest("ClientRdbTest") {
93  module_out_path = module_output_path
94  sources = [ "unittest/distributed_device_profile_client_rdb_test.cpp" ]
95  configs = device_profile_configs
96  deps = device_profile_deps
97  external_deps = device_profile_external_deps
98  part_name = "device_info_manager"
99  subsystem_name = "deviceprofile"
100}
101
102ohos_unittest("dp_dumper_new_test") {
103  module_out_path = module_output_path
104  sources = [ "unittest/dp_dumper_test.cpp" ]
105  configs = device_profile_configs
106  deps = device_profile_deps
107  external_deps = device_profile_external_deps
108  part_name = "device_info_manager"
109  subsystem_name = "deviceprofile"
110}
111
112ohos_unittest("profile_cache_new_test") {
113  module_out_path = module_output_path
114  sources = [ "unittest/profile_cache_test.cpp" ]
115  configs = device_profile_configs
116  deps = device_profile_deps
117  external_deps = device_profile_external_deps
118  part_name = "device_info_manager"
119  subsystem_name = "deviceprofile"
120}
121
122ohos_unittest("profile_utils_new_test") {
123  module_out_path = module_output_path
124  sources = [ "unittest/profile_utils_test.cpp" ]
125  configs = device_profile_configs
126  deps = device_profile_deps
127  external_deps = device_profile_external_deps
128  part_name = "device_info_manager"
129  subsystem_name = "deviceprofile"
130}
131
132ohos_unittest("kv_adapter_new_test") {
133  module_out_path = module_output_path
134  sources = [ "unittest/kv_adapter_test.cpp" ]
135  configs = device_profile_configs
136  deps = device_profile_deps
137  external_deps = device_profile_external_deps
138  part_name = "device_info_manager"
139  subsystem_name = "deviceprofile"
140}
141
142ohos_unittest("event_handler_factory_new_test") {
143  module_out_path = module_output_path
144  sources = [ "unittest/event_handler_factory_test.cpp" ]
145  configs = device_profile_configs
146  deps = device_profile_deps
147  external_deps = device_profile_external_deps
148  part_name = "device_info_manager"
149  subsystem_name = "deviceprofile"
150}
151
152ohos_unittest("sync_options_new_test") {
153  module_out_path = module_output_path
154  sources = [ "unittest/sync_options_test.cpp" ]
155  configs = device_profile_configs
156  deps = device_profile_deps
157  external_deps = device_profile_external_deps
158  part_name = "device_info_manager"
159  subsystem_name = "deviceprofile"
160}
161
162ohos_unittest("DPSubscribeInfoTest") {
163  module_out_path = module_output_path
164  sources = [ "unittest/dp_subscribe_info_test.cpp" ]
165  configs = device_profile_configs
166  deps = device_profile_deps
167  external_deps = device_profile_external_deps
168  part_name = "device_info_manager"
169  subsystem_name = "deviceprofile"
170}
171
172ohos_unittest("PermissionManagerTest") {
173  module_out_path = module_output_path
174  sources = [ "unittest/permission_manager_test.cpp" ]
175  configs = device_profile_configs
176  deps = device_profile_deps
177  external_deps = device_profile_external_deps
178  part_name = "device_info_manager"
179  subsystem_name = "deviceprofile"
180}
181
182ohos_unittest("IpcUtilsTest") {
183  module_out_path = module_output_path
184  sources = [ "unittest/ipc_utils_test.cpp" ]
185  configs = device_profile_configs
186  deps = device_profile_deps
187  external_deps = device_profile_external_deps
188  part_name = "device_info_manager"
189  subsystem_name = "deviceprofile"
190}
191
192ohos_unittest("content_sensor_manager_test") {
193  module_out_path = module_output_path
194  sources = [ "unittest/content_sensor_manager_test.cpp" ]
195  configs = device_profile_configs
196  deps = device_profile_deps
197  external_deps = device_profile_external_deps
198  part_name = "device_info_manager"
199  subsystem_name = "deviceprofile"
200}
201
202ohos_unittest("kv_data_change_listener_test") {
203  module_out_path = module_output_path
204  sources = [ "unittest/kv_data_change_listener_test.cpp" ]
205  configs = device_profile_configs
206  deps = device_profile_deps
207  external_deps = device_profile_external_deps
208  part_name = "device_info_manager"
209  subsystem_name = "deviceprofile"
210}
211
212ohos_unittest("kv_store_death_recipient_test") {
213  module_out_path = module_output_path
214  sources = [ "unittest/kv_store_death_recipient_test.cpp" ]
215  configs = device_profile_configs
216  deps = device_profile_deps
217  external_deps = device_profile_external_deps
218  part_name = "device_info_manager"
219  subsystem_name = "deviceprofile"
220}
221
222ohos_unittest("kv_sync_completed_listener_test") {
223  module_out_path = module_output_path
224  sources = [ "unittest/kv_sync_completed_listener_test.cpp" ]
225  configs = device_profile_configs
226  deps = device_profile_deps
227  external_deps = device_profile_external_deps
228  part_name = "device_info_manager"
229  subsystem_name = "deviceprofile"
230}
231
232ohos_unittest("sync_subscriber_death_recipient_test") {
233  module_out_path = module_output_path
234  sources = [ "unittest/sync_subscriber_death_recipient_test.cpp" ]
235  configs = device_profile_configs
236  deps = device_profile_deps
237  external_deps = device_profile_external_deps
238  part_name = "device_info_manager"
239  subsystem_name = "deviceprofile"
240}
241
242ohos_unittest("dp_content_sensor_test") {
243  module_out_path = module_output_path
244  sources = [ "unittest/dp_content_sensor_test.cpp" ]
245  configs = device_profile_configs
246  deps = device_profile_deps
247  external_deps = device_profile_external_deps
248  part_name = "device_info_manager"
249  subsystem_name = "deviceprofile"
250}
251
252ohos_unittest("ProfileChangeListenerProxyTest") {
253  module_out_path = module_output_path
254  sources = [ "unittest/profile_change_listener_proxy_test.cpp" ]
255  configs = device_profile_configs
256  deps = device_profile_deps
257  external_deps = device_profile_external_deps
258  part_name = "device_info_manager"
259  subsystem_name = "deviceprofile"
260}
261
262ohos_unittest("device_profile_locd_callback_test") {
263  module_out_path = module_output_path
264  sources = [ "unittest/device_profile_locd_callback_test.cpp" ]
265  configs = device_profile_configs
266  deps = device_profile_deps
267  external_deps = device_profile_external_deps
268  part_name = "device_info_manager"
269  subsystem_name = "deviceprofile"
270}
271
272ohos_unittest("subscribe_profile_manager_test") {
273  module_out_path = module_output_path
274  sources = [ "unittest/subscribe_profile_manager_test.cpp" ]
275  configs = device_profile_configs
276  deps = device_profile_deps
277  external_deps = device_profile_external_deps
278  part_name = "device_info_manager"
279  subsystem_name = "deviceprofile"
280}
281
282ohos_unittest("sync_completed_callback_test") {
283  module_out_path = module_output_path
284  sources = [ "unittest/sync_completed_callback_test.cpp" ]
285  configs = device_profile_configs
286  deps = device_profile_deps
287  external_deps = device_profile_external_deps
288  part_name = "device_info_manager"
289  subsystem_name = "deviceprofile"
290}
291
292ohos_unittest("dp_profile_service_new_test") {
293  module_out_path = module_output_path
294  sources = [ "unittest/dp_profile_service_test.cpp" ]
295  configs = device_profile_configs
296  deps = device_profile_deps
297  external_deps = device_profile_external_deps
298  part_name = "device_info_manager"
299  subsystem_name = "deviceprofile"
300}
301
302group("unittest") {
303  testonly = true
304  deps = [
305    ":ClientRdbTest",
306    ":DPSubscribeInfoTest",
307    ":IpcUtilsTest",
308    ":PermissionManagerTest",
309    ":ProfileChangeListenerProxyTest",
310    ":TrustProfileManagerTest",
311    ":content_sensor_manager_test",
312    ":device_profile_locd_callback_test",
313    ":device_profile_manager_new_test",
314    ":distributed_device_profile_client_kv_new_test",
315    ":dp_content_sensor_test",
316    ":dp_dumper_new_test",
317    ":dp_profile_service_new_test",
318    ":event_handler_factory_new_test",
319    ":kv_adapter_new_test",
320    ":kv_data_change_listener_test",
321    ":kv_store_death_recipient_test",
322    ":kv_sync_completed_listener_test",
323    ":profile_cache_new_test",
324    ":profile_utils_new_test",
325    ":rdb_adapter_new_test",
326    ":subscribe_profile_manager_test",
327    ":sync_completed_callback_test",
328    ":sync_options_new_test",
329    ":sync_subscriber_death_recipient_test",
330  ]
331}
332