# Copyright (c) 2021-2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/notification/distributed_notification_service/notification.gni") import("//build/ohos.gni") import("//build/test.gni") group("ans_unit_test") { testonly = true deps = [] if (distributed_notification_supported) { deps += [ ":ans_distributed_unit_test" ] } } ohos_unittest("ans_distributed_unit_test") { module_out_path = "${component_name}/unittest" include_dirs = [ "/${services_path}/distributed/include", "//commonlibrary/c_utils/base/include", ] sources = [ "${services_path}/distributed/src/distributed_database.cpp", "${services_path}/distributed/src/distributed_database_callback.cpp", "${services_path}/distributed/src/distributed_device_callback.cpp", "${services_path}/distributed/src/distributed_flow_control.cpp", "${services_path}/distributed/src/distributed_notification_manager.cpp", "${services_path}/distributed/src/distributed_preferences.cpp", "${services_path}/distributed/src/distributed_preferences_database.cpp", "${services_path}/distributed/src/distributed_preferences_info.cpp", "${services_path}/distributed/src/distributed_screen_status_manager.cpp", "${services_path}/distributed/test/unittest/distributed_database_test.cpp", "${services_path}/distributed/test/unittest/distributed_notification_manager_test.cpp", "${services_path}/distributed/test/unittest/distributed_preferences_test.cpp", "${services_path}/distributed/test/unittest/distributed_screen_status_manager_test.cpp", "${services_path}/distributed/test/unittest/mock/mock_blob.cpp", "${services_path}/distributed/test/unittest/mock/mock_change_notification.cpp", "${services_path}/distributed/test/unittest/mock/mock_distributed_kv_data_manager.cpp", "${services_path}/distributed/test/unittest/mock/mock_event_handler.cpp", "${services_path}/distributed/test/unittest/mock/mock_single_kv_store.cpp", ] configs = [ "${services_path}/distributed/:ans_distributed_config", "${core_path}:public_ans_core_config", "${frameworks_module_ans_path}:ans_innerkits_public_config", ] deps = [ "${core_path}:ans_core", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", "hitrace_native:hitrace_meter", "hitrace_native:libhitracechain", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", "multimedia_image_framework:image_native", "relational_store:native_rdb", ] subsystem_name = "${subsystem_name}" part_name = "${component_name}" }