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 17dsoftbus_root_path = "../../../.." 18module_output_path = "dsoftbus/connection/general" 19 20ohos_unittest("GeneralConnectionTest") { 21 module_out_path = module_output_path 22 include_dirs = [ 23 "$dsoftbus_root_path/core/connection/general", 24 "$dsoftbus_root_path/core/connection/interface", 25 "$dsoftbus_root_path/core/common/include", 26 "$dsoftbus_root_path/interfaces/kits/common", 27 "$dsoftbus_root_path/dfx/interface/include", 28 "$dsoftbus_root_path/adapter/common/include", 29 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 30 "$dsoftbus_root_path/core/connection/ble/include", 31 "$dsoftbus_root_path/core/connection/manager", 32 "$dsoftbus_root_path/core/bus_center/interface", 33 "$dsoftbus_root_path/interfaces/kits/bus_center", 34 "$dsoftbus_root_path/core/discovery/manager/include", 35 "$dsoftbus_root_path/core/discovery/interface", 36 "$dsoftbus_root_path/core/connection/ipc/include", 37 "$dsoftbus_root_path/interfaces/kits/connection", 38 "$dsoftbus_root_path/core/connection/br/include", 39 "$dsoftbus_root_path/core/adapter/br/include", 40 "$dsoftbus_root_path/core/connection/tcp/include", 41 "$dsoftbus_root_path/core/connection/sle/include", 42 "$dsoftbus_root_path/core/frame/init/include", 43 "$dsoftbus_root_path/core/connection/proxy", 44 "$dsoftbus_root_path/adapter/common/include", 45 ] 46 47 deps = [ 48 "$dsoftbus_root_path/adapter:softbus_adapter", 49 "$dsoftbus_root_path/core/common:softbus_utils", 50 "$dsoftbus_root_path/core/frame:softbus_server", 51 "$dsoftbus_root_path/dfx:softbus_dfx", 52 ] 53 54 external_deps = [ 55 "bluetooth:btframework", 56 "bounds_checking_function:libsec_shared", 57 "c_utils:utils", 58 "googletest:gmock_main", 59 "hilog:libhilog", 60 ] 61 sources = [ 62 "$dsoftbus_root_path/core/connection/general/softbus_conn_general_connection.c", 63 "$dsoftbus_root_path/core/connection/general/softbus_conn_general_negotiation.c", 64 "$dsoftbus_root_path/core/connection/manager/softbus_conn_ipc.c", 65 "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c", 66 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func.c", 67 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func_pack.c", 68 "general_connection_mock.cpp", 69 "softbus_conn_general_connection_test.cpp", 70 ] 71 72 if (dsoftbus_feature_conn_br) { 73 sources += [ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common.c" ] 74 } else { 75 sources += [ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common_virtual.c" ] 76 } 77} 78 79ohos_unittest("GeneralNegotiationTest") { 80 module_out_path = module_output_path 81 include_dirs = [ 82 "$dsoftbus_root_path/core/connection/general", 83 "$dsoftbus_root_path/core/connection/interface", 84 "$dsoftbus_root_path/core/common/include", 85 "$dsoftbus_root_path/interfaces/kits/common", 86 "$dsoftbus_root_path/dfx/interface/include", 87 "$dsoftbus_root_path/adapter/common/include", 88 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 89 "$dsoftbus_root_path/core/connection/ble/include", 90 "$dsoftbus_root_path/core/connection/manager", 91 "$dsoftbus_root_path/core/bus_center/interface", 92 "$dsoftbus_root_path/interfaces/kits/bus_center", 93 "$dsoftbus_root_path/core/discovery/manager/include", 94 "$dsoftbus_root_path/core/discovery/interface", 95 "$dsoftbus_root_path/core/connection/ipc/include", 96 "$dsoftbus_root_path/interfaces/kits/connection", 97 "$dsoftbus_root_path/core/connection/br/include", 98 "$dsoftbus_root_path/core/adapter/br/include", 99 "$dsoftbus_root_path/core/connection/tcp/include", 100 "$dsoftbus_root_path/core/connection/sle/include", 101 "$dsoftbus_root_path/core/connection/proxy", 102 ] 103 104 deps = [ 105 "$dsoftbus_root_path/adapter:softbus_adapter", 106 "$dsoftbus_root_path/core/common:softbus_utils", 107 ] 108 109 external_deps = [ 110 "bluetooth:btframework", 111 "bounds_checking_function:libsec_shared", 112 "c_utils:utils", 113 "googletest:gmock_main", 114 "hilog:libhilog", 115 ] 116 sources = [ 117 "$dsoftbus_root_path/core/connection/general/softbus_conn_general_negotiation.c", 118 "$dsoftbus_root_path/core/connection/manager/softbus_conn_ipc.c", 119 "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c", 120 "general_negotiation_mock.cpp", 121 "softbus_conn_general_negotiation_test.cpp", 122 ] 123 124 if (dsoftbus_feature_conn_br) { 125 sources += [ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common.c" ] 126 } else { 127 sources += [ "$dsoftbus_root_path/adapter/common/net/bluetooth/common/softbus_adapter_bt_common_virtual.c" ] 128 } 129} 130