• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-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/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/device_info_manager"
20
21config("device_profile_test_config") {
22  cflags = [
23    "-Dprivate=public",
24    "-Dprotected=public",
25  ]
26  if (device_info_manager_common) {
27    cflags += [ "-DDEVICE_PROFILE_STATIC_DISABLE" ]
28  }
29}
30
31device_profile_configs = [
32  "${device_profile_service}:device_info_manager_config",
33  ":device_profile_test_config",
34]
35
36device_profile_deps = [
37  "${device_profile_common}:distributed_device_profile_common",
38  "${device_profile_innerkits}:distributed_device_profile_sdk",
39  "${device_profile_service}:distributed_device_profile_svr",
40]
41
42device_profile_external_deps = [
43  "access_token:libaccesstoken_sdk",
44  "access_token:libnativetoken",
45  "access_token:libtoken_setproc",
46  "cJSON:cjson",
47  "c_utils:utils",
48  "common_event_service:cesfwk_innerkits",
49  "config_policy:configpolicy_util",
50  "device_auth:deviceauth_sdk",
51  "device_manager:devicemanagersdk",
52  "dmsfwk:common_sdk",
53  "eventhandler:libeventhandler",
54  "hilog:libhilog",
55  "hisysevent:libhisysevent",
56  "hitrace:hitrace_meter",
57  "init:libbegetutil",
58  "ipc:ipc_core",
59  "kv_store:distributeddata_inner",
60  "relational_store:native_rdb",
61  "safwk:system_ability_fwk",
62  "samgr:samgr_proxy",
63  "selinux_adapter:librestorecon",
64  "syscap_codec:syscap_interface_shared",
65]
66
67ohos_unittest("rdb_adapter_new_test") {
68  module_out_path = module_output_path
69  sources = [ "unittest/rdb_adapter_test.cpp" ]
70  configs = device_profile_configs
71  deps = device_profile_deps
72  external_deps = device_profile_external_deps
73  part_name = "device_info_manager"
74  subsystem_name = "deviceprofile"
75}
76
77ohos_unittest("TrustProfileManagerTest") {
78  module_out_path = module_output_path
79  sources = [ "unittest/trust_profile_manager_test.cpp" ]
80  configs = device_profile_configs
81  deps = device_profile_deps
82  external_deps = device_profile_external_deps
83  part_name = "device_info_manager"
84  subsystem_name = "deviceprofile"
85}
86
87ohos_unittest("distributed_device_profile_client_kv_new_test") {
88  module_out_path = module_output_path
89  sources = [ "unittest/distributed_device_profile_client_kv_test.cpp" ]
90  configs = device_profile_configs
91  deps = device_profile_deps
92  external_deps = device_profile_external_deps
93  part_name = "device_info_manager"
94  subsystem_name = "deviceprofile"
95}
96
97ohos_unittest("device_profile_manager_new_test") {
98  module_out_path = module_output_path
99  sources = [ "unittest/device_profile_manager_test.cpp" ]
100  configs = device_profile_configs
101  deps = device_profile_deps
102  external_deps = device_profile_external_deps
103  part_name = "device_info_manager"
104  subsystem_name = "deviceprofile"
105}
106
107ohos_unittest("ClientRdbTest") {
108  module_out_path = module_output_path
109  sources = [ "unittest/distributed_device_profile_client_rdb_test.cpp" ]
110  configs = device_profile_configs
111  deps = device_profile_deps
112  external_deps = device_profile_external_deps
113  part_name = "device_info_manager"
114  subsystem_name = "deviceprofile"
115}
116
117ohos_unittest("dp_dumper_new_test") {
118  module_out_path = module_output_path
119  sources = [ "unittest/dp_dumper_test.cpp" ]
120  configs = device_profile_configs
121  deps = device_profile_deps
122  external_deps = device_profile_external_deps
123  part_name = "device_info_manager"
124  subsystem_name = "deviceprofile"
125}
126
127ohos_unittest("profile_cache_new_test") {
128  module_out_path = module_output_path
129  sources = [ "unittest/profile_cache_test.cpp" ]
130  configs = device_profile_configs
131  deps = device_profile_deps
132  external_deps = device_profile_external_deps
133  part_name = "device_info_manager"
134  subsystem_name = "deviceprofile"
135}
136
137ohos_unittest("profile_utils_new_test") {
138  module_out_path = module_output_path
139  sources = [ "unittest/profile_utils_test.cpp" ]
140  configs = device_profile_configs
141  deps = device_profile_deps
142  external_deps = device_profile_external_deps
143  part_name = "device_info_manager"
144  subsystem_name = "deviceprofile"
145}
146
147ohos_unittest("kv_adapter_new_test") {
148  module_out_path = module_output_path
149  sources = [ "unittest/kv_adapter_test.cpp" ]
150  configs = device_profile_configs
151  deps = device_profile_deps
152  external_deps = device_profile_external_deps
153  part_name = "device_info_manager"
154  subsystem_name = "deviceprofile"
155}
156
157ohos_unittest("event_handler_factory_new_test") {
158  module_out_path = module_output_path
159  sources = [ "unittest/event_handler_factory_test.cpp" ]
160  configs = device_profile_configs
161  deps = device_profile_deps
162  external_deps = device_profile_external_deps
163  part_name = "device_info_manager"
164  subsystem_name = "deviceprofile"
165}
166
167ohos_unittest("sync_options_new_test") {
168  module_out_path = module_output_path
169  sources = [ "unittest/sync_options_test.cpp" ]
170  configs = device_profile_configs
171  deps = device_profile_deps
172  external_deps = device_profile_external_deps
173  part_name = "device_info_manager"
174  subsystem_name = "deviceprofile"
175}
176
177ohos_unittest("DPSubscribeInfoTest") {
178  module_out_path = module_output_path
179  sources = [ "unittest/dp_subscribe_info_test.cpp" ]
180  configs = device_profile_configs
181  deps = device_profile_deps
182  external_deps = device_profile_external_deps
183  part_name = "device_info_manager"
184  subsystem_name = "deviceprofile"
185}
186
187ohos_unittest("PermissionManagerTest") {
188  module_out_path = module_output_path
189  sources = [ "unittest/permission_manager_test.cpp" ]
190  configs = device_profile_configs
191  deps = device_profile_deps
192  external_deps = device_profile_external_deps
193  part_name = "device_info_manager"
194  subsystem_name = "deviceprofile"
195}
196
197ohos_unittest("IpcUtilsTest") {
198  module_out_path = module_output_path
199  sources = [ "unittest/ipc_utils_test.cpp" ]
200  configs = device_profile_configs
201  deps = device_profile_deps
202  external_deps = device_profile_external_deps
203  part_name = "device_info_manager"
204  subsystem_name = "deviceprofile"
205}
206
207ohos_unittest("content_sensor_manager_test") {
208  module_out_path = module_output_path
209  sources = [ "unittest/content_sensor_manager_test.cpp" ]
210  configs = device_profile_configs
211  deps = device_profile_deps
212  external_deps = device_profile_external_deps
213  part_name = "device_info_manager"
214  subsystem_name = "deviceprofile"
215}
216
217ohos_unittest("content_sensor_pasteboard_info_test") {
218  module_out_path = module_output_path
219  sources = [ "unittest/content_sensor_pasteboard_info_test.cpp" ]
220  configs = device_profile_configs
221  deps = device_profile_deps
222  external_deps = device_profile_external_deps
223  part_name = "device_info_manager"
224  subsystem_name = "deviceprofile"
225}
226
227ohos_unittest("kv_store_death_recipient_test") {
228  module_out_path = module_output_path
229  sources = [ "unittest/kv_store_death_recipient_test.cpp" ]
230  configs = device_profile_configs
231  deps = device_profile_deps
232  external_deps = device_profile_external_deps
233  part_name = "device_info_manager"
234  subsystem_name = "deviceprofile"
235}
236
237ohos_unittest("kv_sync_completed_listener_test") {
238  module_out_path = module_output_path
239  sources = [ "unittest/kv_sync_completed_listener_test.cpp" ]
240  configs = device_profile_configs
241  deps = device_profile_deps
242  external_deps = device_profile_external_deps
243  part_name = "device_info_manager"
244  subsystem_name = "deviceprofile"
245}
246
247ohos_unittest("sync_subscriber_death_recipient_test") {
248  module_out_path = module_output_path
249  sources = [ "unittest/sync_subscriber_death_recipient_test.cpp" ]
250  configs = device_profile_configs
251  deps = device_profile_deps
252  external_deps = device_profile_external_deps
253  part_name = "device_info_manager"
254  subsystem_name = "deviceprofile"
255}
256
257ohos_unittest("dp_content_sensor_test") {
258  module_out_path = module_output_path
259  sources = [ "unittest/dp_content_sensor_test.cpp" ]
260  configs = device_profile_configs
261  deps = device_profile_deps
262  external_deps = device_profile_external_deps
263  part_name = "device_info_manager"
264  subsystem_name = "deviceprofile"
265}
266
267ohos_unittest("ProfileChangeListenerProxyTest") {
268  module_out_path = module_output_path
269  sources = [ "unittest/profile_change_listener_proxy_test.cpp" ]
270  configs = device_profile_configs
271  deps = device_profile_deps
272  external_deps = device_profile_external_deps
273  part_name = "device_info_manager"
274  subsystem_name = "deviceprofile"
275}
276
277ohos_unittest("device_profile_locd_callback_test") {
278  module_out_path = module_output_path
279  sources = [ "unittest/device_profile_locd_callback_test.cpp" ]
280  configs = device_profile_configs
281  deps = device_profile_deps
282  external_deps = device_profile_external_deps
283  part_name = "device_info_manager"
284  subsystem_name = "deviceprofile"
285}
286
287ohos_unittest("subscribe_profile_manager_test") {
288  module_out_path = module_output_path
289  sources = [ "unittest/subscribe_profile_manager_test.cpp" ]
290  configs = device_profile_configs
291  deps = device_profile_deps
292  external_deps = device_profile_external_deps
293  part_name = "device_info_manager"
294  subsystem_name = "deviceprofile"
295}
296
297ohos_unittest("sync_completed_callback_test") {
298  module_out_path = module_output_path
299  sources = [ "unittest/sync_completed_callback_test.cpp" ]
300  configs = device_profile_configs
301  deps = device_profile_deps
302  external_deps = device_profile_external_deps
303  part_name = "device_info_manager"
304  subsystem_name = "deviceprofile"
305}
306
307ohos_unittest("dp_profile_service_new_test") {
308  module_out_path = module_output_path
309  sources = [ "unittest/dp_profile_service_test.cpp" ]
310  configs = device_profile_configs
311  deps = device_profile_deps
312  external_deps = device_profile_external_deps
313  part_name = "device_info_manager"
314  subsystem_name = "deviceprofile"
315}
316
317ohos_unittest("dp_dm_adapter_test") {
318  module_out_path = module_output_path
319  sources = [ "unittest/dm_adapter_test.cpp" ]
320  configs = device_profile_configs
321  deps = device_profile_deps
322  external_deps = device_profile_external_deps
323  part_name = "device_info_manager"
324  subsystem_name = "deviceprofile"
325}
326
327ohos_unittest("distributed_device_profile_stub_new_test") {
328  module_out_path = module_output_path
329  sources = [ "unittest/distributed_device_profile_stub_new_test.cpp" ]
330  configs = device_profile_configs
331  deps = device_profile_deps
332  external_deps = device_profile_external_deps
333  part_name = "device_info_manager"
334  subsystem_name = "deviceprofile"
335  cflags = [
336    "-Dprivate=public",
337    "-Dprotected=public",
338  ]
339}
340
341ohos_unittest("content_sensor_manager_utils_test") {
342  module_out_path = module_output_path
343  sources = [ "unittest/content_sensor_manager_utils_test.cpp" ]
344  configs = device_profile_configs
345  deps = device_profile_deps
346  external_deps = device_profile_external_deps
347  part_name = "device_info_manager"
348  subsystem_name = "deviceprofile"
349}
350
351ohos_unittest("static_capability_collector_test") {
352  module_out_path = module_output_path
353  sources = [ "unittest/static_capability_collector_test.cpp" ]
354  configs = device_profile_configs
355  deps = device_profile_deps
356  external_deps = device_profile_external_deps
357  part_name = "device_info_manager"
358  subsystem_name = "deviceprofile"
359}
360
361ohos_unittest("static_capability_loader_test") {
362  module_out_path = module_output_path
363  sources = [ "unittest/static_capability_loader_test.cpp" ]
364  configs = device_profile_configs
365  deps = device_profile_deps
366  external_deps = device_profile_external_deps
367  part_name = "device_info_manager"
368  subsystem_name = "deviceprofile"
369}
370
371ohos_unittest("switch_adapter_test") {
372  module_out_path = module_output_path
373  sources = [ "unittest/switch_adapter_test.cpp" ]
374  configs = device_profile_configs
375  deps = device_profile_deps
376  external_deps = device_profile_external_deps
377  part_name = "device_info_manager"
378  subsystem_name = "deviceprofile"
379}
380
381ohos_unittest("profile_control_utils_test") {
382  module_out_path = module_output_path
383  sources = [ "unittest/profile_control_utils_test.cpp" ]
384  configs = device_profile_configs
385  deps = device_profile_deps
386  external_deps = device_profile_external_deps
387  part_name = "device_info_manager"
388  subsystem_name = "deviceprofile"
389}
390
391ohos_unittest("static_profile_manager_test") {
392  module_out_path = module_output_path
393  sources = [ "unittest/static_profile_manager_test.cpp" ]
394  configs = device_profile_configs
395  deps = device_profile_deps
396  external_deps = device_profile_external_deps
397  part_name = "device_info_manager"
398  subsystem_name = "deviceprofile"
399}
400
401ohos_unittest("switch_profile_manager_test") {
402  module_out_path = module_output_path
403  sources = [ "unittest/switch_profile_manager_test.cpp" ]
404  configs = device_profile_configs
405  deps = device_profile_deps
406  external_deps = device_profile_external_deps
407  part_name = "device_info_manager"
408  subsystem_name = "deviceprofile"
409}
410
411ohos_unittest("trust_Device_Profile_test") {
412  module_out_path = module_output_path
413  sources = [ "unittest/trust_device_profile_test.cpp" ]
414  configs = device_profile_configs
415  deps = device_profile_deps
416  external_deps = device_profile_external_deps
417  part_name = "device_info_manager"
418  subsystem_name = "deviceprofile"
419}
420
421ohos_unittest("multi_user_manager_test") {
422  module_out_path = module_output_path
423  sources = [ "unittest/multi_user_manager_test.cpp" ]
424  configs = device_profile_configs
425  deps = device_profile_deps
426  external_deps = device_profile_external_deps
427  part_name = "device_info_manager"
428  subsystem_name = "deviceprofile"
429}
430
431ohos_unittest("dp_account_common_event_test") {
432  module_out_path = module_output_path
433  sources = [ "unittest/dp_account_common_event_test.cpp" ]
434  configs = device_profile_configs
435  deps = device_profile_deps
436  external_deps = device_profile_external_deps
437  part_name = "device_info_manager"
438  subsystem_name = "deviceprofile"
439}
440
441ohos_unittest("session_key_manager_test") {
442  module_out_path = module_output_path
443  sources = [ "unittest/session_key_manager_test.cpp" ]
444  configs = device_profile_configs
445  deps = device_profile_deps
446  external_deps = device_profile_external_deps
447  part_name = "device_info_manager"
448  subsystem_name = "deviceprofile"
449}
450
451ohos_unittest("profile_data_manager_test") {
452  module_out_path = module_output_path
453  sources = [ "unittest/profile_data_manager_test.cpp" ]
454  configs = device_profile_configs
455  deps = device_profile_deps
456  external_deps = device_profile_external_deps
457  part_name = "device_info_manager"
458  subsystem_name = "deviceprofile"
459}
460
461ohos_unittest("local_service_info_manager_test") {
462  module_out_path = module_output_path
463  sources = [ "unittest/local_service_info_manager_test.cpp" ]
464  configs = device_profile_configs
465  deps = device_profile_deps
466  external_deps = device_profile_external_deps
467  part_name = "device_info_manager"
468  subsystem_name = "deviceprofile"
469}
470
471ohos_unittest("device_profile_dao_test") {
472  module_out_path = module_output_path
473  sources = [ "unittest/device_profile_dao_test.cpp" ]
474  configs = device_profile_configs
475  deps = device_profile_deps
476  external_deps = device_profile_external_deps
477  part_name = "device_info_manager"
478  subsystem_name = "deviceprofile"
479}
480
481ohos_unittest("product_info_dao_test") {
482  module_out_path = module_output_path
483  sources = [ "unittest/product_info_dao_test.cpp" ]
484  configs = device_profile_configs
485  deps = device_profile_deps
486  external_deps = device_profile_external_deps
487  part_name = "device_info_manager"
488  subsystem_name = "deviceprofile"
489}
490
491ohos_unittest("business_event_adapter_test") {
492  module_out_path = module_output_path
493  sources = [ "unittest/business_event_adapter_test.cpp" ]
494  configs = device_profile_configs
495  deps = device_profile_deps
496  external_deps = device_profile_external_deps
497  part_name = "device_info_manager"
498  subsystem_name = "deviceprofile"
499}
500
501ohos_unittest("business_event_manager_test") {
502  module_out_path = module_output_path
503  sources = [ "unittest/business_event_manager_test.cpp" ]
504  configs = device_profile_configs
505  deps = device_profile_deps
506  external_deps = device_profile_external_deps
507  part_name = "device_info_manager"
508  subsystem_name = "deviceprofile"
509}
510
511group("unittest") {
512  testonly = true
513  deps = [
514    ":ClientRdbTest",
515    ":DPSubscribeInfoTest",
516    ":IpcUtilsTest",
517    ":PermissionManagerTest",
518    ":ProfileChangeListenerProxyTest",
519    ":TrustProfileManagerTest",
520    ":content_sensor_manager_test",
521    ":content_sensor_manager_utils_test",
522    ":content_sensor_pasteboard_info_test",
523    ":device_profile_dao_test",
524    ":device_profile_locd_callback_test",
525    ":device_profile_manager_new_test",
526    ":distributed_device_profile_client_kv_new_test",
527    ":distributed_device_profile_stub_new_test",
528    ":dp_account_common_event_test",
529    ":dp_content_sensor_test",
530    ":dp_dm_adapter_test",
531    ":dp_dumper_new_test",
532    ":dp_profile_service_new_test",
533    ":event_handler_factory_new_test",
534    ":kv_adapter_new_test",
535    ":kv_store_death_recipient_test",
536    ":kv_sync_completed_listener_test",
537    ":local_service_info_manager_test",
538    ":multi_user_manager_test",
539    ":product_info_dao_test",
540    ":profile_cache_new_test",
541    ":profile_control_utils_test",
542    ":profile_data_manager_test",
543    ":profile_utils_new_test",
544    ":rdb_adapter_new_test",
545    ":session_key_manager_test",
546    ":static_capability_collector_test",
547    ":static_capability_loader_test",
548    ":static_profile_manager_test",
549    ":subscribe_profile_manager_test",
550    ":switch_adapter_test",
551    ":sync_completed_callback_test",
552    ":sync_options_new_test",
553    ":sync_subscriber_death_recipient_test",
554    ":trust_Device_Profile_test",
555    ":business_event_manager_test",
556    ":business_event_adapter_test",
557  ]
558  if (device_info_manager_supported_switch && !device_info_manager_common) {
559    deps += [ ":switch_profile_manager_test" ]
560  }
561}
562