• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024-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("../../../../core/authentication/authentication.gni")
16import("../../../../dsoftbus.gni")
17
18module_output_path = "dsoftbus/soft_bus/bus_center"
19dsoftbus_root_path = "../../../.."
20
21ohos_unittest("BusCenterDecisionTest") {
22  module_out_path = module_output_path
23  sources = [
24    "unittest/bus_center_decision_center_deps_mock.cpp",
25    "unittest/bus_center_decision_center_test.cpp",
26  ]
27
28  include_dirs = [
29    "$dsoftbus_dfx_path/interface/include",
30    "$dsoftbus_dfx_path/interface/include/form",
31    "$dsoftbus_dfx_path/interface/include/legacy",
32    "$dsoftbus_root_path/adapter/common/bus_center/include",
33    "$dsoftbus_root_path/adapter/common/bus_center/wlan",
34    "$dsoftbus_root_path/adapter/common/include",
35    "$dsoftbus_root_path/core/authentication/interface",
36    "$dsoftbus_root_path/core/bus_center/interface",
37    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
38    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
39    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
40    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
41    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
42    "$dsoftbus_root_path/core/bus_center/service/include",
43    "$dsoftbus_root_path/core/bus_center/service/unittest",
44    "$dsoftbus_root_path/core/bus_center/utils/include",
45    "$dsoftbus_root_path/core/common/include",
46    "$dsoftbus_root_path/core/connection/interface",
47    "$dsoftbus_root_path/core/discovery/interface",
48    "$dsoftbus_root_path/core/discovery/manager/include",
49    "$dsoftbus_root_path/core/frame/init/include",
50    "$dsoftbus_root_path/interfaces/kits/authentication",
51    "$dsoftbus_root_path/interfaces/kits/bus_center",
52    "$dsoftbus_root_path/interfaces/kits/connect",
53    "$dsoftbus_root_path/interfaces/kits/disc",
54    "$dsoftbus_root_path/interfaces/kits/lnn",
55  ]
56
57  deps = [
58    "$dsoftbus_root_path/adapter:softbus_adapter",
59    "$dsoftbus_root_path/core/common:softbus_utils",
60    "$dsoftbus_root_path/core/frame:softbus_server",
61    "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
62  ]
63
64  if (is_standard_system) {
65    external_deps = [
66      "bounds_checking_function:libsec_shared",
67      "c_utils:utils",
68      "dsoftbus:softbus_client",
69      "googletest:gmock_main",
70      "googletest:gtest_main",
71      "hilog:libhilog",
72    ]
73  } else {
74    external_deps = [
75      "bounds_checking_function:libsec_shared",
76      "c_utils:utils",
77      "dsoftbus:softbus_client",
78      "googletest:gmock_main",
79      "googletest:gtest_main",
80      "hilog:libhilog",
81    ]
82  }
83}
84
85ohos_unittest("BusCenterEventTest") {
86  module_out_path = module_output_path
87  sources = [
88    "$dsoftbus_root_path/core/bus_center/service/src/bus_center_event.c",
89    "unittest/bus_center_event_deps_mock.cpp",
90    "unittest/bus_center_event_test.cpp",
91  ]
92
93  include_dirs = [
94    "$dsoftbus_dfx_path/interface/include",
95    "$dsoftbus_dfx_path/interface/include/form",
96    "$dsoftbus_dfx_path/interface/include/legacy",
97    "$dsoftbus_root_path/adapter/common/bus_center/include",
98    "$dsoftbus_root_path/adapter/common/include",
99    "$dsoftbus_root_path/core/adapter/bus_center/include",
100    "$dsoftbus_root_path/core/authentication/interface",
101    "$dsoftbus_root_path/core/bus_center/interface",
102    "$dsoftbus_root_path/core/bus_center/ipc/include/",
103    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
104    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include",
105    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
106    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
107    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
108    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
109    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
110    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include/",
111    "$dsoftbus_root_path/core/bus_center/service/include",
112    "$dsoftbus_root_path/core/bus_center/service/unittest",
113    "$dsoftbus_root_path/core/bus_center/utils/include",
114    "$dsoftbus_root_path/core/common/include",
115    "$dsoftbus_root_path/core/connection/interface",
116    "$dsoftbus_root_path/core/discovery/interface",
117    "$dsoftbus_root_path/core/discovery/manager/include",
118    "$dsoftbus_root_path/core/transmission/trans_channel/qos/interface/",
119    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
120    "$dsoftbus_root_path/interfaces/inner_kits/transport",
121    "$dsoftbus_root_path/interfaces/kits/bus_center",
122    "$dsoftbus_root_path/interfaces/kits/discovery",
123  ]
124
125  deps = [
126    "$dsoftbus_root_path/adapter:softbus_adapter",
127    "$dsoftbus_root_path/core/common:softbus_utils",
128    "$dsoftbus_root_path/core/frame:softbus_server",
129    "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
130  ]
131
132  bus_center_event_test_external_deps = [
133    "c_utils:utils",
134    "hilog:libhilog",
135  ]
136
137  if (is_standard_system) {
138    bus_center_event_test_external_deps += [
139      "bounds_checking_function:libsec_shared",
140      "googletest:gmock_main",
141      "googletest:gtest_main",
142      "huks:libhukssdk",
143    ]
144  }
145  external_deps = bus_center_event_test_external_deps
146}
147
148ohos_unittest("BusCenterManagerTest") {
149  module_out_path = module_output_path
150  sources = [
151    "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c",
152    "$dsoftbus_root_path/core/frame/init/src/g_enhance_auth_func.c",
153    "unittest/bus_center_manager_deps_mock.cpp",
154    "unittest/bus_center_manager_test.cpp",
155    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func_pack.c",
156    "$dsoftbus_root_path/core/frame/init/src/g_enhance_lnn_func.c",
157  ]
158
159  include_dirs = [
160    "$dsoftbus_dfx_path/interface/include",
161    "$dsoftbus_dfx_path/interface/include/form",
162    "$dsoftbus_dfx_path/interface/include/legacy",
163    "$dsoftbus_root_path/adapter/common/bus_center/include",
164    "$dsoftbus_root_path/adapter/common/bus_center/wlan",
165    "$dsoftbus_root_path/adapter/common/include",
166    "$dsoftbus_root_path/core/adapter/bus_center/include",
167    "$dsoftbus_root_path/core/authentication/include",
168    "$dsoftbus_root_path/core/authentication/interface",
169    "$dsoftbus_root_path/core/bus_center/interface",
170    "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include",
171    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
172    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include",
173    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
174    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
175    "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include",
176    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
177    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
178    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
179    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
180    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
181    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
182    "$dsoftbus_root_path/core/bus_center/monitor/include",
183    "$dsoftbus_root_path/core/bus_center/service/include",
184    "$dsoftbus_root_path/core/bus_center/service/unittest",
185    "$dsoftbus_root_path/core/bus_center/utils/include",
186    "$dsoftbus_root_path/core/common/include",
187    "$dsoftbus_root_path/core/connection/interface",
188    "$dsoftbus_root_path/core/discovery/interface",
189    "$dsoftbus_root_path/core/discovery/manager/include",
190    "$dsoftbus_root_path/core/frame/init/include",
191    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
192    "$dsoftbus_root_path/interfaces/inner_kits/transport",
193    "$dsoftbus_root_path/interfaces/kits/authentication",
194    "$dsoftbus_root_path/interfaces/kits/bus_center",
195    "$dsoftbus_root_path/interfaces/kits/connect",
196    "$dsoftbus_root_path/interfaces/kits/disc",
197    "$dsoftbus_root_path/interfaces/kits/discovery",
198    "$dsoftbus_root_path/interfaces/kits/lnn",
199    "$dsoftbus_root_path/tests/interface/enhance",
200  ]
201
202  deps = [
203    "$dsoftbus_root_path/adapter:softbus_adapter",
204    "$dsoftbus_root_path/core/common:softbus_utils",
205    "$dsoftbus_root_path/core/frame:softbus_server",
206    "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
207  ]
208
209  bus_center_manager_test_external_deps = [
210    "c_utils:utils",
211    "hilog:libhilog",
212  ]
213
214  if (is_standard_system) {
215    bus_center_manager_test_external_deps += [
216      "bounds_checking_function:libsec_shared",
217      "googletest:gmock_main",
218      "googletest:gtest_main",
219      "huks:libhukssdk",
220    ]
221  }
222  external_deps = bus_center_manager_test_external_deps
223}
224group("unittest") {
225  testonly = true
226
227  deps = [
228    ":BusCenterDecisionTest",
229    ":BusCenterEventTest",
230    ":BusCenterManagerTest",
231  ]
232}
233