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