1# Copyright (c) 2021-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("../../../../dsoftbus.gni")
16
17module_output_path = "dsoftbus/connection"
18dsoftbus_root_path = "../../../.."
19softbus_adapter_common = "${dsoftbus_root_path}/adapter/common"
20
21config("softbus_connection_br_test_config") {
22  include_dirs = [
23    "$dsoftbus_root_path/core/common/include",
24    "$dsoftbus_root_path/core/adapter/br/include",
25    "$softbus_adapter_common/include",
26    "$dsoftbus_root_path/interfaces/kits/common",
27    "$dsoftbus_root_path/core/connection/interface",
28    "$dsoftbus_root_path/core/connection/manager",
29    "$dsoftbus_root_path/core/connection/tcp/include",
30    "$dsoftbus_root_path/core/connection/br/include",
31    "$dsoftbus_root_path/core/connection/br/src",
32    "$dsoftbus_root_path/interfaces/kits/common",
33    "$dsoftbus_root_path/interfaces/kits/discovery",
34    "$dsoftbus_root_path/interfaces/kits/bus_center",
35    "$softbus_adapter_common/net/bluetooth/include",
36    "$dsoftbus_root_path/core/common/include",
37    "$dsoftbus_root_path/core/common/softbus_property",
38    "$dsoftbus_root_path/core/connection/ble/include",
39    "$dsoftbus_root_path/core/discovery/interface",
40    "$dsoftbus_root_path/core/discovery/manager/include",
41    "$dsoftbus_root_path/core/authentication/interface",
42    "$dsoftbus_root_path/core/bus_center/interface",
43    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
44    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
45    "//foundation/communication/bluetooth/interfaces/inner_api/include",
46    "$dsoftbus_root_path/core/bus_center/service/include",
47    "//third_party/googletest/googletest/include",
48    "//third_party/googletest/googletest/src",
49    "//third_party/bounds_checking_function/include",
50  ]
51}
52
53ohos_unittest("BrConnTest") {
54  module_out_path = module_output_path
55  public_configs = [ ":softbus_connection_br_test_config" ]
56  deps = [
57    "$dsoftbus_root_path/adapter:softbus_adapter",
58    "$dsoftbus_root_path/core/common:softbus_utils",
59    "$dsoftbus_root_path/core/frame:softbus_server",
60    "//third_party/bounds_checking_function:libsec_shared",
61    "//third_party/googletest:gmock",
62    "//third_party/googletest:gtest_main",
63  ]
64
65  external_deps = [
66    "c_utils:utils",
67    "hilog:libhilog",
68  ]
69  sources = [
70    "connection_br_connection_test.cpp",
71    "connection_br_mock.cpp",
72  ]
73}
74
75ohos_unittest("ConnectionBrTest") {
76  module_out_path = module_output_path
77  public_configs = [ ":softbus_connection_br_test_config" ]
78  deps = [
79    "$dsoftbus_root_path/adapter:softbus_adapter",
80    "$dsoftbus_root_path/core/common:softbus_utils",
81    "$dsoftbus_root_path/core/frame:softbus_server",
82    "//third_party/bounds_checking_function:libsec_shared",
83    "//third_party/googletest:gmock",
84    "//third_party/googletest:gtest_main",
85  ]
86
87  external_deps = [
88    "c_utils:utils",
89    "hilog:libhilog",
90  ]
91  sources = [
92    "connection_br_mock.cpp",
93    "connection_br_test.cpp",
94  ]
95}
96
97ohos_unittest("BrConnectionTest") {
98  module_out_path = module_output_path
99
100  include_dirs = [
101    #"$dsoftbus_root_path/adapter/common/include",
102    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
103    "$dsoftbus_root_path/core/adapter/br/include",
104    "$dsoftbus_root_path/core/authentication/interface",
105    "$dsoftbus_root_path/core/bus_center/service/include",
106    "$dsoftbus_root_path/core/bus_center/interface",
107    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
108    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
109    "$dsoftbus_root_path/core/connection/br/include",
110    "$dsoftbus_root_path/core/connection/ble/include",
111    "$dsoftbus_root_path/core/connection/common/include",
112    "$dsoftbus_root_path/tests/core/connection/br",
113    "//foundation/communication/bluetooth/interfaces/inner_api/include/c_header",
114    "//foundation/communication/bluetooth/interfaces/inner_api/include",
115  ]
116
117  deps = [
118    "$dsoftbus_root_path/adapter:softbus_adapter",
119    "$dsoftbus_root_path/core/common:softbus_utils",
120    "//third_party/bounds_checking_function:libsec_shared",
121    "//third_party/googletest:gmock",
122    "//third_party/googletest:gtest_main",
123  ]
124
125  external_deps = [
126    "c_utils:utils",
127    "hilog:libhilog",
128  ]
129  sources = [
130    "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_connection.c",
131    "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_manager.c",
132    "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_trans.c",
133    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
134    "br_connection_test.cpp",
135    "br_mock.cpp",
136  ]
137}
138
139group("unittest") {
140  testonly = true
141  deps = [ ":BrConnectionTest" ]
142}
143