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/unittest" 20 21group("ans_unit_test") { 22 testonly = true 23 deps = [] 24 25 if (distributed_notification_supported) { 26 deps += [ 27 ":ans_distributed_unit_test", 28 ":distributed_database_branch_test", 29 ":distributed_database_callback_test", 30 ":distributed_device_callback_test", 31 ":distributed_flow_control_test", 32 ":distributed_preferences_branch_test", 33 ":distributed_preferences_database_test", 34 ":distributed_screen_status_manager_branch_test", 35 ] 36 } 37} 38 39ohos_unittest("distributed_base_test") { 40 module_out_path = module_output_path 41 include_dirs = [ 42 "/${interfaces_path}/inner_api", 43 "/${services_path}/ans/include", 44 "/${services_path}/distributed/include", 45 "/${services_path}/distributed/include/base", 46 "/${services_path}/distributed/include/helper", 47 "/${services_path}/distributed/include/soft_bus", 48 "/${services_path}/distributed/include/tlv_box", 49 ] 50 51 sources = [ 52 "/${frameworks_path}/ans/src/notification_helper.cpp", 53 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 54 "/${services_path}/ans/src/common/notification_config_parse.cpp", 55 "/${services_path}/distributed/src/base/distributed_client.cpp", 56 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 57 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 58 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 59 "/${services_path}/distributed/src/base/distributed_server.cpp", 60 "/${services_path}/distributed/src/base/distributed_socket.cpp", 61 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 62 "/${services_path}/distributed/src/helper/analytics_util.cpp", 63 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 64 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 65 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 66 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 67 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 68 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 69 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 70 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 71 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 72 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 73 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 74 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 75 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 76 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 77 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 78 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 79 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 80 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 81 "/${services_path}/distributed/src/tlv_box/remove_all_distributed_box.cpp", 82 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 83 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 84 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 85 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 86 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 87 "distributed_base_test/distributed_softbus_socket_test.cpp", 88 "mock/mock_softbus_socket.cpp", 89 ] 90 91 configs = [ 92 "${services_path}/distributed/:ans_distributed_config", 93 "${frameworks_module_ans_path}:ans_innerkits_public_config", 94 ] 95 96 defines = [] 97 if (distributed_notification_service_feature_phone_collaboration) { 98 defines += [ "DISTRIBUTED_FEATURE_MASTER" ] 99 } 100 101 deps = [ 102 "${frameworks_module_ans_path}:ans_innerkits", 103 ] 104 105 external_deps = [ 106 "ability_base:base", 107 "ability_base:want", 108 "ability_base:zuri", 109 "ability_runtime:ability_manager", 110 "ability_runtime:runtime", 111 "ability_runtime:uri_permission_mgr", 112 "bundle_framework:appexecfwk_base", 113 "bundle_framework:appexecfwk_core", 114 "c_utils:utils", 115 "device_manager:devicemanagersdk", 116 "dsoftbus:softbus_client", 117 "eventhandler:libeventhandler", 118 "ffrt:libffrt", 119 "googletest:gmock_main", 120 "googletest:gtest_main", 121 "hilog:libhilog", 122 "hitrace:hitrace_meter", 123 "hitrace:libhitracechain", 124 "image_framework:image_native", 125 "ipc:ipc_core", 126 "kv_store:distributeddata_inner", 127 "os_account:os_account_innerkits", 128 "power_manager:powermgr_client", 129 "relational_store:native_rdb", 130 "relational_store:native_rdb", 131 "samgr:samgr_proxy", 132 "time_service:time_client", 133 "zlib:libz", 134 ] 135 136 defines = [] 137 if (screenlock_mgr_enable) { 138 external_deps += [ "screenlock_mgr:screenlock_client" ] 139 defines += [ "SCREENLOCK_MGR_ENABLE" ] 140 } 141 142 subsystem_name = "${subsystem_name}" 143 part_name = "${component_name}" 144} 145 146ohos_unittest("distributed_device_service_test") { 147 module_out_path = module_output_path 148 include_dirs = [ 149 "/${interfaces_path}/inner_api", 150 "/${services_path}/ans/include", 151 "/${services_path}/distributed/include", 152 "/${services_path}/distributed/include/base", 153 "/${services_path}/distributed/include/helper", 154 "/${services_path}/distributed/include/soft_bus", 155 "/${services_path}/distributed/include/tlv_box", 156 ] 157 158 sources = [ 159 "/${frameworks_path}/ans/src/notification_helper.cpp", 160 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 161 "/${services_path}/ans/src/common/notification_config_parse.cpp", 162 "/${services_path}/distributed/src/base/distributed_client.cpp", 163 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 164 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 165 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 166 "/${services_path}/distributed/src/base/distributed_server.cpp", 167 "/${services_path}/distributed/src/base/distributed_socket.cpp", 168 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 169 "/${services_path}/distributed/src/helper/analytics_util.cpp", 170 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 171 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 172 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 173 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 174 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 175 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 176 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 177 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 178 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 179 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 180 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 181 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 182 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 183 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 184 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 185 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 186 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 187 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 188 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 189 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 190 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 191 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 192 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 193 "distributed_device_service_test/distributed_device_service_test.cpp" 194 ] 195 196 configs = [ 197 "${services_path}/distributed/:ans_distributed_config", 198 "${frameworks_module_ans_path}:ans_innerkits_public_config", 199 ] 200 201 defines = [] 202 if (distributed_notification_service_feature_phone_collaboration) { 203 defines += [ "DISTRIBUTED_FEATURE_MASTER" ] 204 } 205 206 deps = [ 207 "${frameworks_module_ans_path}:ans_innerkits", 208 ] 209 210 external_deps = [ 211 "ability_base:base", 212 "ability_base:want", 213 "ability_base:zuri", 214 "ability_runtime:ability_manager", 215 "ability_runtime:runtime", 216 "ability_runtime:uri_permission_mgr", 217 "bundle_framework:appexecfwk_base", 218 "bundle_framework:appexecfwk_core", 219 "c_utils:utils", 220 "device_manager:devicemanagersdk", 221 "dsoftbus:softbus_client", 222 "eventhandler:libeventhandler", 223 "ffrt:libffrt", 224 "googletest:gmock_main", 225 "googletest:gtest_main", 226 "hilog:libhilog", 227 "hitrace:hitrace_meter", 228 "hitrace:libhitracechain", 229 "image_framework:image_native", 230 "ipc:ipc_core", 231 "kv_store:distributeddata_inner", 232 "os_account:os_account_innerkits", 233 "power_manager:powermgr_client", 234 "relational_store:native_rdb", 235 "relational_store:native_rdb", 236 "samgr:samgr_proxy", 237 "time_service:time_client", 238 "zlib:libz", 239 ] 240 241 defines = [] 242 if (screenlock_mgr_enable) { 243 external_deps += [ "screenlock_mgr:screenlock_client" ] 244 defines += [ "SCREENLOCK_MGR_ENABLE" ] 245 } 246 247 subsystem_name = "${subsystem_name}" 248 part_name = "${component_name}" 249} 250 251ohos_unittest("ans_distributed_unit_test") { 252 module_out_path = module_output_path 253 include_dirs = [ "/${services_path}/distributed/include" ] 254 255 sources = [ 256 "${services_path}/distributed/src/distributed_database.cpp", 257 "${services_path}/distributed/src/distributed_database_callback.cpp", 258 "${services_path}/distributed/src/distributed_device_callback.cpp", 259 "${services_path}/distributed/src/distributed_flow_control.cpp", 260 "${services_path}/distributed/src/distributed_notification_manager.cpp", 261 "${services_path}/distributed/src/distributed_preferences.cpp", 262 "${services_path}/distributed/src/distributed_preferences_database.cpp", 263 "${services_path}/distributed/src/distributed_preferences_info.cpp", 264 "${services_path}/distributed/src/distributed_screen_status_manager.cpp", 265 "${services_path}/distributed/test/unittest/distributed_database_test.cpp", 266 "${services_path}/distributed/test/unittest/distributed_notification_manager_test.cpp", 267 "${services_path}/distributed/test/unittest/distributed_preferences_test.cpp", 268 "${services_path}/distributed/test/unittest/distributed_screen_status_manager_test.cpp", 269 "${services_path}/distributed/test/unittest/mock/mock_blob.cpp", 270 "${services_path}/distributed/test/unittest/mock/mock_change_notification.cpp", 271 "${services_path}/distributed/test/unittest/mock/mock_device_manager_impl.cpp", 272 "${services_path}/distributed/test/unittest/mock/mock_event_handler.cpp", 273 "${services_path}/distributed/test/unittest/mock/mock_single_kv_store.cpp", 274 ] 275 276 configs = [ 277 "${services_path}/distributed/:ans_distributed_config", 278 "${frameworks_module_ans_path}:ans_innerkits_public_config", 279 ] 280 281 deps = [ "${frameworks_module_ans_path}:ans_innerkits" ] 282 283 external_deps = [ 284 "ability_base:base", 285 "ability_base:want", 286 "ability_base:zuri", 287 "bundle_framework:appexecfwk_base", 288 "c_utils:utils", 289 "device_manager:devicemanagersdk", 290 "eventhandler:libeventhandler", 291 "ffrt:libffrt", 292 "googletest:gtest_main", 293 "hilog:libhilog", 294 "hitrace:hitrace_meter", 295 "hitrace:libhitracechain", 296 "image_framework:image_native", 297 "ipc:ipc_core", 298 "kv_store:distributeddata_inner", 299 ] 300 301 subsystem_name = "${subsystem_name}" 302 part_name = "${component_name}" 303} 304 305ohos_unittest("distributed_preferences_database_test") { 306 module_out_path = module_output_path 307 include_dirs = [ 308 "/${services_path}/distributed/include", 309 "${services_path}/distributed/test/unittest/mock", 310 ] 311 312 sources = [ 313 "distributed_preferences_database_test/distributed_preferences_database_test.cpp", 314 "distributed_preferences_database_test/mock_distributed_flow_control.cpp", 315 "distributed_preferences_database_test/mock_distributed_kv_data_manager.cpp", 316 "distributed_preferences_database_test/mock_single_kv_store.cpp", 317 ] 318 319 configs = [ 320 "${services_path}/distributed/:ans_distributed_config", 321 "${frameworks_module_ans_path}:ans_innerkits_public_config", 322 ] 323 324 deps = [ 325 "${frameworks_module_ans_path}:ans_innerkits", 326 "${services_path}/distributed:libans_distributed", 327 ] 328 329 external_deps = [ 330 "ability_base:base", 331 "ability_base:want", 332 "ability_base:zuri", 333 "bundle_framework:appexecfwk_base", 334 "c_utils:utils", 335 "device_manager:devicemanagersdk", 336 "eventhandler:libeventhandler", 337 "ffrt:libffrt", 338 "googletest:gtest_main", 339 "hilog:libhilog", 340 "hitrace:hitrace_meter", 341 "hitrace:libhitracechain", 342 "image_framework:image_native", 343 "ipc:ipc_core", 344 "kv_store:distributeddata_inner", 345 ] 346 347 subsystem_name = "${subsystem_name}" 348 part_name = "${component_name}" 349} 350 351ohos_unittest("distributed_screen_status_manager_branch_test") { 352 module_out_path = module_output_path 353 include_dirs = [ 354 "/${services_path}/distributed/include", 355 "${services_path}/distributed/test/unittest/mock", 356 ] 357 358 sources = [ 359 "distributed_database_branch_test/mock_device_manager_impl.cpp", 360 "distributed_screen_status_manager_branch_test/distributed_screen_status_manager_branch_test.cpp", 361 "distributed_screen_status_manager_branch_test/mock_distributed_flow_control.cpp", 362 "distributed_screen_status_manager_branch_test/mock_distributed_kv_data_manager.cpp", 363 "distributed_screen_status_manager_branch_test/mock_single_kv_store.cpp", 364 ] 365 366 configs = [ 367 "${services_path}/distributed/:ans_distributed_config", 368 "${frameworks_module_ans_path}:ans_innerkits_public_config", 369 ] 370 371 deps = [ 372 "${frameworks_module_ans_path}:ans_innerkits", 373 "${services_path}/distributed:libans_distributed", 374 ] 375 376 external_deps = [ 377 "ability_base:base", 378 "ability_base:want", 379 "ability_base:zuri", 380 "bundle_framework:appexecfwk_base", 381 "c_utils:utils", 382 "device_manager:devicemanagersdk", 383 "eventhandler:libeventhandler", 384 "ffrt:libffrt", 385 "googletest:gtest_main", 386 "hilog:libhilog", 387 "hitrace:hitrace_meter", 388 "hitrace:libhitracechain", 389 "image_framework:image_native", 390 "ipc:ipc_core", 391 "kv_store:distributeddata_inner", 392 ] 393 394 subsystem_name = "${subsystem_name}" 395 part_name = "${component_name}" 396} 397 398ohos_unittest("distributed_database_branch_test") { 399 module_out_path = module_output_path 400 include_dirs = [ 401 "/${services_path}/distributed/include", 402 "${services_path}/distributed/test/unittest/mock", 403 ] 404 405 sources = [ 406 "distributed_database_branch_test/distributed_database_branch_test.cpp", 407 "distributed_database_branch_test/mock_device_manager_impl.cpp", 408 "distributed_database_branch_test/mock_distributed_flow_control.cpp", 409 "distributed_database_branch_test/mock_distributed_kv_data_manager.cpp", 410 "distributed_database_branch_test/mock_single_kv_store.cpp", 411 ] 412 413 configs = [ 414 "${services_path}/distributed/:ans_distributed_config", 415 "${frameworks_module_ans_path}:ans_innerkits_public_config", 416 ] 417 418 deps = [ 419 "${frameworks_module_ans_path}:ans_innerkits", 420 "${services_path}/distributed:libans_distributed", 421 ] 422 423 external_deps = [ 424 "ability_base:base", 425 "ability_base:want", 426 "ability_base:zuri", 427 "bundle_framework:appexecfwk_base", 428 "c_utils:utils", 429 "device_manager:devicemanagersdk", 430 "eventhandler:libeventhandler", 431 "ffrt:libffrt", 432 "googletest:gtest_main", 433 "hilog:libhilog", 434 "hitrace:hitrace_meter", 435 "hitrace:libhitracechain", 436 "image_framework:image_native", 437 "ipc:ipc_core", 438 "kv_store:distributeddata_inner", 439 ] 440 441 subsystem_name = "${subsystem_name}" 442 part_name = "${component_name}" 443} 444 445ohos_unittest("distributed_preferences_branch_test") { 446 module_out_path = module_output_path 447 include_dirs = [ "/${services_path}/distributed/include" ] 448 449 sources = [ 450 "distributed_preferences_branch_test/distributed_preferences_branch_test.cpp", 451 "distributed_preferences_branch_test/mock_distributed_preferences_database.cpp", 452 ] 453 454 configs = [ 455 "${services_path}/distributed/:ans_distributed_config", 456 "${frameworks_module_ans_path}:ans_innerkits_public_config", 457 ] 458 459 deps = [ 460 "${frameworks_module_ans_path}:ans_innerkits", 461 "${services_path}/distributed:libans_distributed", 462 ] 463 464 external_deps = [ 465 "ability_base:base", 466 "ability_base:want", 467 "ability_base:zuri", 468 "bundle_framework:appexecfwk_base", 469 "c_utils:utils", 470 "device_manager:devicemanagersdk", 471 "eventhandler:libeventhandler", 472 "ffrt:libffrt", 473 "googletest:gtest_main", 474 "hilog:libhilog", 475 "hitrace:hitrace_meter", 476 "hitrace:libhitracechain", 477 "image_framework:image_native", 478 "ipc:ipc_core", 479 "kv_store:distributeddata_inner", 480 ] 481 482 subsystem_name = "${subsystem_name}" 483 part_name = "${component_name}" 484} 485 486ohos_unittest("distributed_device_callback_test") { 487 module_out_path = module_output_path 488 include_dirs = [ "/${services_path}/distributed/include" ] 489 490 sources = [ "distributed_device_callback_test.cpp" ] 491 492 configs = [ 493 "${services_path}/distributed/:ans_distributed_config", 494 "${frameworks_module_ans_path}:ans_innerkits_public_config", 495 ] 496 497 deps = [ 498 "${frameworks_module_ans_path}:ans_innerkits", 499 "${services_path}/distributed:libans_distributed", 500 ] 501 502 external_deps = [ 503 "ability_base:base", 504 "ability_base:want", 505 "ability_base:zuri", 506 "bundle_framework:appexecfwk_base", 507 "c_utils:utils", 508 "device_manager:devicemanagersdk", 509 "eventhandler:libeventhandler", 510 "ffrt:libffrt", 511 "googletest:gtest_main", 512 "hilog:libhilog", 513 "hitrace:hitrace_meter", 514 "hitrace:libhitracechain", 515 "image_framework:image_native", 516 "ipc:ipc_core", 517 "kv_store:distributeddata_inner", 518 ] 519 520 subsystem_name = "${subsystem_name}" 521 part_name = "${component_name}" 522} 523 524ohos_unittest("distributed_database_callback_test") { 525 module_out_path = module_output_path 526 include_dirs = [ "/${services_path}/distributed/include" ] 527 528 sources = [ "distributed_database_callback_test.cpp" ] 529 530 configs = [ 531 "${services_path}/distributed/:ans_distributed_config", 532 "${frameworks_module_ans_path}:ans_innerkits_public_config", 533 ] 534 535 deps = [ 536 "${frameworks_module_ans_path}:ans_innerkits", 537 "${services_path}/distributed:libans_distributed", 538 ] 539 540 external_deps = [ 541 "ability_base:base", 542 "ability_base:want", 543 "ability_base:zuri", 544 "bundle_framework:appexecfwk_base", 545 "c_utils:utils", 546 "eventhandler:libeventhandler", 547 "ffrt:libffrt", 548 "googletest:gtest_main", 549 "hilog:libhilog", 550 "hitrace:hitrace_meter", 551 "hitrace:libhitracechain", 552 "image_framework:image_native", 553 "ipc:ipc_core", 554 "kv_store:distributeddata_inner", 555 ] 556 557 subsystem_name = "${subsystem_name}" 558 part_name = "${component_name}" 559} 560 561ohos_unittest("distributed_flow_control_test") { 562 module_out_path = module_output_path 563 include_dirs = [ "/${services_path}/distributed/include" ] 564 565 sources = [ "distributed_flow_control_test.cpp" ] 566 567 configs = [ 568 "${services_path}/distributed/:ans_distributed_config", 569 "${frameworks_module_ans_path}:ans_innerkits_public_config", 570 ] 571 572 deps = [ 573 "${frameworks_module_ans_path}:ans_innerkits", 574 "${services_path}/distributed:libans_distributed", 575 ] 576 577 external_deps = [ 578 "ability_base:base", 579 "ability_base:want", 580 "ability_base:zuri", 581 "bundle_framework:appexecfwk_base", 582 "c_utils:utils", 583 "eventhandler:libeventhandler", 584 "ffrt:libffrt", 585 "googletest:gtest_main", 586 "hilog:libhilog", 587 "hitrace:hitrace_meter", 588 "hitrace:libhitracechain", 589 "image_framework:image_native", 590 "ipc:ipc_core", 591 "kv_store:distributeddata_inner", 592 ] 593 594 subsystem_name = "${subsystem_name}" 595 part_name = "${component_name}" 596} 597 598ohos_unittest("distributed_notification_manager_branch_test") { 599 module_out_path = module_output_path 600 include_dirs = [ "/${services_path}/distributed/include" ] 601 602 sources = [ 603 "distributed_notification_manager_branch_test/distributed_notification_manager_branch_test.cpp", 604 "distributed_notification_manager_branch_test/mock_distributed_database.cpp", 605 ] 606 607 configs = [ 608 "${services_path}/distributed/:ans_distributed_config", 609 "${frameworks_module_ans_path}:ans_innerkits_public_config", 610 ] 611 612 deps = [ 613 "${frameworks_module_ans_path}:ans_innerkits", 614 "${services_path}/distributed:libans_distributed", 615 ] 616 617 external_deps = [ 618 "ability_base:base", 619 "ability_base:want", 620 "ability_base:zuri", 621 "bundle_framework:appexecfwk_base", 622 "c_utils:utils", 623 "device_manager:devicemanagersdk", 624 "eventhandler:libeventhandler", 625 "ffrt:libffrt", 626 "googletest:gtest_main", 627 "hilog:libhilog", 628 "hitrace:hitrace_meter", 629 "hitrace:libhitracechain", 630 "image_framework:image_native", 631 "ipc:ipc_core", 632 "kv_store:distributeddata_inner", 633 ] 634 635 subsystem_name = "${subsystem_name}" 636 part_name = "${component_name}" 637} 638 639ohos_unittest("distributed_service_test") { 640 module_out_path = module_output_path 641 include_dirs = [ 642 "/${services_path}/distributed/include", 643 "/${services_path}/distributed/include/base", 644 "/${services_path}/distributed/include/soft_bus", 645 "/${services_path}/distributed/include/tlv_box", 646 "/${services_path}/distributed/include/helper", 647 "/${services_path}/ans/include", 648 ] 649 650 sources = [ 651 "/${frameworks_path}/ans/src/notification_helper.cpp", 652 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 653 "/${services_path}/ans/src/common/notification_config_parse.cpp", 654 "/${services_path}/distributed/src/base/distributed_client.cpp", 655 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 656 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 657 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 658 "/${services_path}/distributed/src/base/distributed_server.cpp", 659 "/${services_path}/distributed/src/base/distributed_socket.cpp", 660 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 661 "/${services_path}/distributed/src/helper/analytics_util.cpp", 662 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 663 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 664 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 665 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 666 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 667 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 668 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 669 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 670 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 671 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 672 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 673 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 674 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 675 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 676 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 677 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 678 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 679 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 680 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 681 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 682 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 683 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 684 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 685 "distributed_service_test.cpp", 686 ] 687 688 configs = [ 689 "${services_path}/distributed/:ans_distributed_config", 690 "${frameworks_module_ans_path}:ans_innerkits_public_config", 691 ] 692 693 deps = [ 694 "${frameworks_module_ans_path}:ans_innerkits", 695 "${services_path}/distributed:libans_distributed", 696 ] 697 698 external_deps = [ 699 "ability_base:base", 700 "ability_base:want", 701 "ability_base:zuri", 702 "ability_runtime:ability_manager", 703 "ability_runtime:runtime", 704 "ability_runtime:uri_permission_mgr", 705 "bundle_framework:appexecfwk_base", 706 "bundle_framework:appexecfwk_core", 707 "c_utils:utils", 708 "device_manager:devicemanagersdk", 709 "dsoftbus:softbus_client", 710 "eventhandler:libeventhandler", 711 "ffrt:libffrt", 712 "googletest:gmock_main", 713 "googletest:gtest_main", 714 "hilog:libhilog", 715 "hitrace:hitrace_meter", 716 "hitrace:libhitracechain", 717 "image_framework:image_native", 718 "ipc:ipc_core", 719 "kv_store:distributeddata_inner", 720 "os_account:os_account_innerkits", 721 "power_manager:powermgr_client", 722 "relational_store:native_rdb", 723 "relational_store:native_rdb", 724 "samgr:samgr_proxy", 725 "time_service:time_client", 726 "zlib:libz", 727 ] 728 729 defines = [] 730 if (screenlock_mgr_enable) { 731 external_deps += [ "screenlock_mgr:screenlock_client" ] 732 defines += [ "SCREENLOCK_MGR_ENABLE" ] 733 } 734 735 subsystem_name = "${subsystem_name}" 736 part_name = "${component_name}" 737} 738ohos_unittest("distributed_subscriber_test") { 739 module_out_path = module_output_path 740 include_dirs = [ 741 "/${services_path}/distributed/include", 742 "/${services_path}/distributed/include/base", 743 "/${services_path}/distributed/include/soft_bus", 744 "/${services_path}/distributed/include/tlv_box", 745 "/${services_path}/distributed/include/helper", 746 "/${services_path}/ans/include", 747 "/${interfaces_path}/inner_api", 748 ] 749 750 sources = [ 751 "/${frameworks_path}/ans/src/notification_helper.cpp", 752 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 753 "/${services_path}/ans/src/common/notification_config_parse.cpp", 754 "/${services_path}/distributed/src/base/distributed_client.cpp", 755 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 756 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 757 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 758 "/${services_path}/distributed/src/base/distributed_server.cpp", 759 "/${services_path}/distributed/src/base/distributed_socket.cpp", 760 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 761 "/${services_path}/distributed/src/helper/analytics_util.cpp", 762 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 763 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 764 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 765 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 766 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 767 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 768 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 769 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 770 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 771 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 772 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 773 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 774 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 775 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 776 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 777 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 778 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 779 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 780 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 781 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 782 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 783 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 784 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 785 "distributed_subscriber_test.cpp", 786 ] 787 788 configs = [ 789 "${services_path}/distributed/:ans_distributed_config", 790 "${frameworks_module_ans_path}:ans_innerkits_public_config", 791 ] 792 793 deps = [ 794 "${frameworks_module_ans_path}:ans_innerkits", 795 "${services_path}/distributed:libans_distributed", 796 ] 797 798 external_deps = [ 799 "ability_base:base", 800 "ability_base:want", 801 "ability_base:zuri", 802 "ability_runtime:ability_manager", 803 "ability_runtime:runtime", 804 "ability_runtime:uri_permission_mgr", 805 "bundle_framework:appexecfwk_base", 806 "bundle_framework:appexecfwk_core", 807 "c_utils:utils", 808 "device_manager:devicemanagersdk", 809 "dsoftbus:softbus_client", 810 "eventhandler:libeventhandler", 811 "ffrt:libffrt", 812 "googletest:gmock_main", 813 "googletest:gtest_main", 814 "hilog:libhilog", 815 "hitrace:hitrace_meter", 816 "hitrace:libhitracechain", 817 "image_framework:image_native", 818 "ipc:ipc_core", 819 "kv_store:distributeddata_inner", 820 "os_account:os_account_innerkits", 821 "power_manager:powermgr_client", 822 "relational_store:native_rdb", 823 "relational_store:native_rdb", 824 "samgr:samgr_proxy", 825 "time_service:time_client", 826 "zlib:libz", 827 ] 828 829 defines = [] 830 if (screenlock_mgr_enable) { 831 external_deps += [ "screenlock_mgr:screenlock_client" ] 832 defines += [ "SCREENLOCK_MGR_ENABLE" ] 833 } 834 835 subsystem_name = "${subsystem_name}" 836 part_name = "${component_name}" 837} 838 839ohos_unittest("distributed_library_test") { 840 module_out_path = module_output_path 841 include_dirs = [ "/${services_path}/distributed/include/base" ] 842 843 sources = [ 844 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 845 "distributed_library_test/distributed_liveview_all_scenarios_extension_wrapper_unit_test.cpp", 846 ] 847 848 deps = [ "${frameworks_module_ans_path}:ans_innerkits" ] 849 850 external_deps = [ 851 "ability_base:zuri", 852 "ability_runtime:ability_manager", 853 "ability_runtime:runtime", 854 "ability_runtime:uri_permission_mgr", 855 "bundle_framework:appexecfwk_base", 856 "bundle_framework:appexecfwk_core", 857 "c_utils:utils", 858 "device_manager:devicemanagersdk", 859 "dsoftbus:softbus_client", 860 "ffrt:libffrt", 861 "hilog:libhilog", 862 "ipc:ipc_core", 863 "kv_store:distributeddata_inner", 864 "os_account:os_account_innerkits", 865 "power_manager:powermgr_client", 866 "relational_store:native_rdb", 867 "samgr:samgr_proxy", 868 "time_service:time_client", 869 "zlib:libz", 870 ] 871 872 defines = [] 873 if (screenlock_mgr_enable) { 874 external_deps += [ "screenlock_mgr:screenlock_client" ] 875 defines += [ "SCREENLOCK_MGR_ENABLE" ] 876 } 877 subsystem_name = "${subsystem_name}" 878 part_name = "${component_name}" 879} 880 881ohos_unittest("distributed_tlvbox_test") { 882 module_out_path = module_output_path 883 include_dirs = [ 884 "/${interfaces_path}/inner_api", 885 "/${services_path}/ans/include", 886 "/${services_path}/distributed/include", 887 "/${services_path}/distributed/include/base", 888 "/${services_path}/distributed/include/helper", 889 "/${services_path}/distributed/include/soft_bus", 890 "/${services_path}/distributed/include/tlv_box", 891 ] 892 893 sources = [ 894 "/${frameworks_path}/ans/src/notification_helper.cpp", 895 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 896 "/${services_path}/ans/src/common/notification_config_parse.cpp", 897 "/${services_path}/distributed/src/base/distributed_client.cpp", 898 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 899 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 900 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 901 "/${services_path}/distributed/src/base/distributed_server.cpp", 902 "/${services_path}/distributed/src/base/distributed_socket.cpp", 903 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 904 "/${services_path}/distributed/src/helper/analytics_util.cpp", 905 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 906 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 907 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 908 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 909 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 910 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 911 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 912 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 913 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 914 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 915 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 916 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 917 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 918 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 919 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 920 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 921 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 922 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 923 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 924 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 925 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 926 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 927 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 928 "distributed_tlv_box_test/tlv_box_test.cpp" 929 ] 930 931 configs = [ 932 "${services_path}/distributed/:ans_distributed_config", 933 "${frameworks_module_ans_path}:ans_innerkits_public_config", 934 ] 935 936 defines = [] 937 if (distributed_notification_service_feature_phone_collaboration) { 938 defines += [ "DISTRIBUTED_FEATURE_MASTER" ] 939 } 940 941 deps = [ 942 "${frameworks_module_ans_path}:ans_innerkits", 943 ] 944 945 external_deps = [ 946 "ability_base:base", 947 "ability_base:want", 948 "ability_base:zuri", 949 "ability_runtime:ability_manager", 950 "ability_runtime:runtime", 951 "ability_runtime:uri_permission_mgr", 952 "bundle_framework:appexecfwk_base", 953 "bundle_framework:appexecfwk_core", 954 "c_utils:utils", 955 "device_manager:devicemanagersdk", 956 "dsoftbus:softbus_client", 957 "eventhandler:libeventhandler", 958 "ffrt:libffrt", 959 "googletest:gmock_main", 960 "googletest:gtest_main", 961 "hilog:libhilog", 962 "hitrace:hitrace_meter", 963 "hitrace:libhitracechain", 964 "image_framework:image_native", 965 "ipc:ipc_core", 966 "kv_store:distributeddata_inner", 967 "os_account:os_account_innerkits", 968 "power_manager:powermgr_client", 969 "relational_store:native_rdb", 970 "relational_store:native_rdb", 971 "samgr:samgr_proxy", 972 "time_service:time_client", 973 "zlib:libz", 974 ] 975 976 defines = [] 977 if (screenlock_mgr_enable) { 978 external_deps += [ "screenlock_mgr:screenlock_client" ] 979 defines += [ "SCREENLOCK_MGR_ENABLE" ] 980 } 981 982 subsystem_name = "${subsystem_name}" 983 part_name = "${component_name}" 984} 985 986ohos_unittest("distributed_helper_test") { 987 module_out_path = module_output_path 988 include_dirs = [ 989 "/${interfaces_path}/inner_api", 990 "/${services_path}/ans/include", 991 "/${services_path}/distributed/include", 992 "/${services_path}/distributed/include/base", 993 "/${services_path}/distributed/include/helper", 994 "/${services_path}/distributed/include/soft_bus", 995 "/${services_path}/distributed/include/tlv_box", 996 ] 997 998 sources = [ 999 "/${frameworks_path}/ans/src/notification_helper.cpp", 1000 "/${frameworks_path}/ans/src/notification_subscribe_info.cpp", 1001 "/${services_path}/ans/src/common/notification_config_parse.cpp", 1002 "/${services_path}/distributed/src/base/distributed_client.cpp", 1003 "/${services_path}/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp", 1004 "/${services_path}/distributed/src/base/distributed_local_config.cpp", 1005 "/${services_path}/distributed/src/base/distributed_send_adapter.cpp", 1006 "/${services_path}/distributed/src/base/distributed_server.cpp", 1007 "/${services_path}/distributed/src/base/distributed_socket.cpp", 1008 "/${services_path}/distributed/src/helper/ability_manager_helper.cpp", 1009 "/${services_path}/distributed/src/helper/analytics_util.cpp", 1010 "/${services_path}/distributed/src/helper/bundle_resource_helper.cpp", 1011 "/${services_path}/distributed/src/helper/distributed_operation_connection.cpp", 1012 "/${services_path}/distributed/src/helper/distributed_operation_helper.cpp", 1013 "/${services_path}/distributed/src/helper/distributed_preference.cpp", 1014 "/${services_path}/distributed/src/helper/distributed_rdb_helper.cpp", 1015 "/${services_path}/distributed/src/soft_bus/distributed_bundle_service.cpp", 1016 "/${services_path}/distributed/src/soft_bus/distributed_device_service.cpp", 1017 "/${services_path}/distributed/src/soft_bus/distributed_observer_service.cpp", 1018 "/${services_path}/distributed/src/soft_bus/distributed_operation_service.cpp", 1019 "/${services_path}/distributed/src/soft_bus/distributed_publish_service_v2.cpp", 1020 "/${services_path}/distributed/src/soft_bus/distributed_service.cpp", 1021 "/${services_path}/distributed/src/soft_bus/distributed_subscribe_service_v2.cpp", 1022 "/${services_path}/distributed/src/soft_bus/distributed_subscriber.cpp", 1023 "/${services_path}/distributed/src/tlv_box/batch_remove_box.cpp", 1024 "/${services_path}/distributed/src/tlv_box/box_base.cpp", 1025 "/${services_path}/distributed/src/tlv_box/bundle_icon_box.cpp", 1026 "/${services_path}/distributed/src/tlv_box/match_box.cpp", 1027 "/${services_path}/distributed/src/tlv_box/notification_sync_box.cpp", 1028 "/${services_path}/distributed/src/tlv_box/remove_box.cpp", 1029 "/${services_path}/distributed/src/tlv_box/request_box.cpp", 1030 "/${services_path}/distributed/src/tlv_box/response_box.cpp", 1031 "/${services_path}/distributed/src/tlv_box/state_box.cpp", 1032 "/${services_path}/distributed/src/tlv_box/tlv_box.cpp", 1033 "distributed_helper_test/distributed_notification_analytics_util_test.cpp" 1034 ] 1035 1036 configs = [ 1037 "${services_path}/distributed/:ans_distributed_config", 1038 "${frameworks_module_ans_path}:ans_innerkits_public_config", 1039 ] 1040 1041 defines = [] 1042 if (distributed_notification_service_feature_phone_collaboration) { 1043 defines += [ "DISTRIBUTED_FEATURE_MASTER" ] 1044 } 1045 1046 deps = [ 1047 "${frameworks_module_ans_path}:ans_innerkits", 1048 ] 1049 1050 external_deps = [ 1051 "ability_base:base", 1052 "ability_base:want", 1053 "ability_base:zuri", 1054 "ability_runtime:ability_manager", 1055 "ability_runtime:runtime", 1056 "ability_runtime:uri_permission_mgr", 1057 "bundle_framework:appexecfwk_base", 1058 "bundle_framework:appexecfwk_core", 1059 "c_utils:utils", 1060 "device_manager:devicemanagersdk", 1061 "dsoftbus:softbus_client", 1062 "eventhandler:libeventhandler", 1063 "ffrt:libffrt", 1064 "googletest:gmock_main", 1065 "googletest:gtest_main", 1066 "hilog:libhilog", 1067 "hitrace:hitrace_meter", 1068 "hitrace:libhitracechain", 1069 "image_framework:image_native", 1070 "ipc:ipc_core", 1071 "kv_store:distributeddata_inner", 1072 "os_account:os_account_innerkits", 1073 "power_manager:powermgr_client", 1074 "relational_store:native_rdb", 1075 "relational_store:native_rdb", 1076 "samgr:samgr_proxy", 1077 "time_service:time_client", 1078 "zlib:libz", 1079 ] 1080 1081 defines = [] 1082 if (screenlock_mgr_enable) { 1083 external_deps += [ "screenlock_mgr:screenlock_client" ] 1084 defines += [ "SCREENLOCK_MGR_ENABLE" ] 1085 } 1086 1087 subsystem_name = "${subsystem_name}" 1088 part_name = "${component_name}" 1089} 1090