1# Copyright (c) 2021-2022 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 18group("ans_unit_test") { 19 testonly = true 20 deps = [] 21 22 if (distributed_notification_supported) { 23 deps += [ ":ans_distributed_unit_test" ] 24 } 25} 26 27ohos_unittest("ans_distributed_unit_test") { 28 module_out_path = "${component_name}/unittest" 29 include_dirs = [ 30 "/${services_path}/distributed/include", 31 "//commonlibrary/c_utils/base/include", 32 ] 33 34 sources = [ 35 "${services_path}/distributed/src/distributed_database.cpp", 36 "${services_path}/distributed/src/distributed_database_callback.cpp", 37 "${services_path}/distributed/src/distributed_device_callback.cpp", 38 "${services_path}/distributed/src/distributed_flow_control.cpp", 39 "${services_path}/distributed/src/distributed_notification_manager.cpp", 40 "${services_path}/distributed/src/distributed_preferences.cpp", 41 "${services_path}/distributed/src/distributed_preferences_database.cpp", 42 "${services_path}/distributed/src/distributed_preferences_info.cpp", 43 "${services_path}/distributed/src/distributed_screen_status_manager.cpp", 44 "${services_path}/distributed/test/unittest/distributed_database_test.cpp", 45 "${services_path}/distributed/test/unittest/distributed_notification_manager_test.cpp", 46 "${services_path}/distributed/test/unittest/distributed_preferences_test.cpp", 47 "${services_path}/distributed/test/unittest/distributed_screen_status_manager_test.cpp", 48 "${services_path}/distributed/test/unittest/mock/mock_blob.cpp", 49 "${services_path}/distributed/test/unittest/mock/mock_change_notification.cpp", 50 "${services_path}/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp", 51 "${services_path}/distributed/test/unittest/mock/mock_event_handler.cpp", 52 "${services_path}/distributed/test/unittest/mock/mock_single_kv_store.cpp", 53 ] 54 55 configs = [ 56 "${services_path}/distributed/:ans_distributed_config", 57 "${core_path}:public_ans_core_config", 58 "${frameworks_module_ans_path}:ans_innerkits_public_config", 59 ] 60 61 deps = [ 62 "${core_path}:ans_core", 63 "//third_party/googletest:gtest_main", 64 ] 65 66 external_deps = [ 67 "ability_base:base", 68 "ability_base:want", 69 "ability_base:zuri", 70 "bundle_framework:appexecfwk_base", 71 "c_utils:utils", 72 "eventhandler:libeventhandler", 73 "hitrace_native:hitrace_meter", 74 "hitrace_native:libhitracechain", 75 "hiviewdfx_hilog_native:libhilog", 76 "ipc:ipc_core", 77 "kv_store:distributeddata_inner", 78 "multimedia_image_framework:image_native", 79 "relational_store:native_rdb", 80 ] 81 82 subsystem_name = "${subsystem_name}" 83 part_name = "${component_name}" 84} 85