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("../../../../dsoftbus.gni") 16 17module_output_path = "dsoftbus/soft_bus/connection" 18 19ohos_unittest("ConnClientConnectionTest") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = true 24 } 25 module_out_path = module_output_path 26 sources = [ "client_connection_test.cpp" ] 27 28 include_dirs = [ 29 "$dsoftbus_root_path/sdk/connection/service/include", 30 "$dsoftbus_root_path/interfaces/kits/connection", 31 "$dsoftbus_root_path/sdk/connection/ipc/include", 32 ] 33 34 deps = [ 35 "$dsoftbus_dfx_path:softbus_dfx", 36 "$dsoftbus_root_path/core/common:softbus_utils", 37 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 38 ] 39 external_deps = [ 40 "access_token:libaccesstoken_sdk", 41 "access_token:libnativetoken", 42 "access_token:libtoken_setproc", 43 "c_utils:utils", 44 "dsoftbus:softbus_client", 45 "hilog:libhilog", 46 "selinux_adapter:librestorecon", 47 ] 48} 49 50ohos_unittest("ConnClientConnectionMockTest") { 51 module_out_path = module_output_path 52 sources = [ 53 "$dsoftbus_root_path/sdk/connection/service/src/general_client_connection.c", 54 "$dsoftbus_root_path/tests/sdk/connection/mock/src/client_connection_mock_test.cpp", 55 "client_connection_test_mock.cpp", 56 ] 57 58 include_dirs = [ 59 "$dsoftbus_root_path/sdk/connection/service/include", 60 "$dsoftbus_root_path/interfaces/kits/connection", 61 "$dsoftbus_root_path/tests/sdk/connection/mock/include", 62 "$dsoftbus_root_path/sdk/connection/ipc/include", 63 "$dsoftbus_root_path/sdk/connection/ipc/$os_type/include", 64 "$dsoftbus_root_path/core/common/include", 65 "$dsoftbus_root_path/core/frame/$os_type/init/include", 66 "$dsoftbus_root_path/sdk/frame/common/include", 67 ] 68 69 deps = [ 70 "$dsoftbus_dfx_path:softbus_dfx", 71 "$dsoftbus_root_path/core/common:softbus_utils", 72 "$dsoftbus_root_path/core/frame:softbus_server", 73 "$dsoftbus_root_path/adapter:softbus_adapter", 74 ] 75 external_deps = [ 76 "c_utils:utils", 77 "googletest:gmock", 78 "googletest:gtest_main", 79 "hilog:libhilog", 80 ] 81} 82 83group("unittest") { 84 testonly = true 85 deps = [ 86 ":ConnClientConnectionMockTest", 87 ":ConnClientConnectionTest", 88 ] 89} 90