1# Copyright (C) 2024-2025 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/test.gni") 15import("//foundation/filemanagement/dfs_service/distributedfile.gni") 16 17module_output_path = "dfs_service/dfs_service_daemon/distributedfiledaemon" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 24 "${distributedfile_path}/test", 25 "${services_path}/distributedfiledaemon/include", 26 "${services_path}/distributedfiledaemon/include/ipc", 27 ] 28} 29 30ohos_unittest("daemon_test") { 31 branch_protector_ret = "pac_ret" 32 sanitize = { 33 integer_overflow = true 34 cfi = true 35 cfi_cross_dso = true 36 debug = false 37 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 38 } 39 40 module_out_path = module_output_path 41 42 include_dirs = [ 43 "${distributedfile_path}/services/distributedfiledaemon/include/device", 44 "${distributedfile_path}/services/distributedfiledaemon/include/channel_manager", 45 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 46 "${distributedfile_path}/services/distributedfiledaemon/test/mock/include", 47 "${distributedfile_path}/test/mock/", 48 ] 49 50 sources = [ 51 "${distributedfile_path}/test/mock/device_manager_impl_mock.cpp", 52 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 53 "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp", 54 "${services_path}/distributedfiledaemon/test/mock/channel_manager_mock.cpp", 55 "${services_path}/distributedfiledaemon/test/mock/connection_detector_mock.cpp", 56 "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp", 57 "${services_path}/distributedfiledaemon/test/mock/softbus_handler_asset_mock.cpp", 58 "${services_path}/distributedfiledaemon/test/mock/softbus_handler_mock.cpp", 59 "${services_path}/distributedfiledaemon/test/mock/softbus_session_listener_mock.cpp", 60 "${services_path}/distributedfiledaemon/test/mock/system_ability_manager_client_mock.cpp", 61 "daemon_test.cpp", 62 ] 63 64 configs = [ 65 ":module_private_config", 66 "${utils_path}:compiler_configs", 67 ] 68 69 deps = [ 70 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 71 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 72 "${utils_path}:libdistributedfileutils", 73 ] 74 75 external_deps = [ 76 "ability_base:zuri", 77 "ability_runtime:abilitykit_native", 78 "access_token:libaccesstoken_sdk", 79 "app_file_service:remote_file_share_native", 80 "app_file_service:sandbox_helper_native", 81 "c_utils:utils", 82 "common_event_service:cesfwk_innerkits", 83 "dataclassification:data_transit_mgr", 84 "device_auth:deviceauth_sdk", 85 "device_manager:devicemanagersdk", 86 "dsoftbus:softbus_client", 87 "eventhandler:libeventhandler", 88 "googletest:gmock_main", 89 "googletest:gtest_main", 90 "hilog:libhilog", 91 "hisysevent:libhisysevent", 92 "ipc:ipc_single", 93 "os_account:os_account_innerkits", 94 "safwk:system_ability_fwk", 95 "samgr:samgr_proxy", 96 "storage_service:storage_manager_sa_proxy", 97 "zlib:shared_libz", 98 ] 99 100 defines = [ 101 "private=public", 102 "LOG_TAG=\"distributedfile_daemon\"", 103 ] 104 105 if (support_same_account) { 106 defines += [ "SUPPORT_SAME_ACCOUNT" ] 107 } 108} 109 110group("unittest") { 111 testonly = true 112 deps = [ ":daemon_test" ] 113} 114