1# Copyright (C) 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/mock", 25 "${services_path}/distributedfiledaemon/include", 26 "${services_path}/distributedfiledaemon/include/ipc", 27 ] 28} 29 30ohos_unittest("connect_count_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/network/softbus", 44 "${distributedfile_path}/services/distributedfiledaemon/test/mock", 45 ] 46 47 sources = [ 48 "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp", 49 "connect_count_test.cpp", 50 ] 51 52 configs = [ 53 ":module_private_config", 54 "${utils_path}:compiler_configs", 55 ] 56 57 deps = [ "${utils_path}:libdistributedfileutils" ] 58 59 external_deps = [ 60 "c_utils:utils", 61 "googletest:gmock_main", 62 "googletest:gtest_main", 63 "hilog:libhilog", 64 "ipc:ipc_core", 65 "json:nlohmann_json_static", 66 ] 67 68 defines = [ 69 "private=public", 70 "LOG_TAG=\"distributedfile_daemon\"", 71 ] 72} 73 74group("unittest") { 75 testonly = true 76 deps = [ ":connect_count_test" ] 77} 78