1# Copyright (C) 2024 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 = "storage_distributed_file_manager/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/mock", 25 "${services_path}/distributedfiledaemon/include", 26 "${services_path}/distributedfiledaemon/include/ipc", 27 "//third_party/json/include", 28 ] 29} 30 31ohos_unittest("all_connect_manager_test") { 32 branch_protector_ret = "pac_ret" 33 sanitize = { 34 integer_overflow = true 35 cfi = true 36 cfi_cross_dso = true 37 debug = false 38 blocklist = "${distributedfile_path}/cfi_blocklist.txt" 39 } 40 41 module_out_path = module_output_path 42 43 include_dirs = [ 44 "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus", 45 "${distributedfile_path}/services/distributedfiledaemon/test/mock", 46 ] 47 48 sources = [ 49 "${services_path}/distributedfiledaemon/src/all_connect/all_connect_manager.cpp", 50 "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp", 51 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_receive_listener.cpp", 52 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_file_send_listener.cpp", 53 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_handler.cpp", 54 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_listener.cpp", 55 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp", 56 "${services_path}/distributedfiledaemon/test/mock/library_func_mock.cpp", 57 "all_connect_manager_test.cpp", 58 ] 59 60 configs = [ 61 ":module_private_config", 62 "${utils_path}:compiler_configs", 63 ] 64 65 deps = [ 66 "${utils_path}:libdistributedfileutils", 67 "//third_party/googletest:gmock_main", 68 "//third_party/googletest:gtest_main", 69 ] 70 71 external_deps = [ 72 "ability_base:zuri", 73 "access_token:libaccesstoken_sdk", 74 "app_file_service:sandbox_helper_native", 75 "c_utils:utils", 76 "device_manager:devicemanagersdk", 77 "dsoftbus:softbus_client", 78 "hilog:libhilog", 79 "hisysevent:libhisysevent", 80 "os_account:os_account_innerkits", 81 ] 82 83 defines = [ 84 "private=public", 85 "LOG_TAG=\"distributedfile_daemon\"", 86 ] 87} 88 89group("unittest") { 90 testonly = true 91 deps = [ ":all_connect_manager_test" ] 92} 93