• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/LNN"
18
19ohos_unittest("HeartBeatMediumTest") {
20  module_out_path = module_output_path
21  sources = [
22    "$dsoftbus_root_path/core/authentication/src/auth_interface.c",
23    "$dsoftbus_root_path/core/authentication/src/virtual/auth_device_common_key_virtual.c",
24    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c",
25    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c",
26    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_cipherkey_manager_virtual.c",
27    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_device_info_recovery_virtual.c",
28    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c",
29    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
30    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
31    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_test.cpp",
32    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp",
33  ]
34
35  include_dirs = [
36    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
37    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
38    "$dsoftbus_root_path/core/connection/p2p/common/include",
39    "$dsoftbus_root_path/core/connection/p2p/interface",
40    "$dsoftbus_root_path/core/bus_center/service/include",
41    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
42    "$dsoftbus_root_path/core/authentication/include",
43    "$dsoftbus_root_path/core/authentication/interface",
44    "$dsoftbus_root_path/core/discovery/interface",
45    "$dsoftbus_root_path/core/discovery/manager/include",
46    "$dsoftbus_root_path/core/core/discovery/manager/include",
47    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
48    "$dsoftbus_root_path/core/bus_center/interface",
49    "$dsoftbus_root_path/core/common/include",
50    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
51    "$dsoftbus_root_path/core/bus_center/utils/include",
52    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
53    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
54    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
55    "$dsoftbus_root_path/core/adapter/bus_center/include",
56    "$dsoftbus_root_path/adapter/common/include",
57    "$dsoftbus_root_path/core/common/include",
58    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
59    "$dsoftbus_root_path/core/connection/wifi_direct",
60    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
61    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
62    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
63    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
64    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
65  ]
66
67  deps = [
68    "$dsoftbus_root_path/adapter:softbus_adapter",
69    "$dsoftbus_root_path/core/common:softbus_utils",
70    "//third_party/googletest:gmock",
71    "//third_party/googletest:gtest_main",
72  ]
73
74  if (is_standard_system) {
75    external_deps = [
76      "device_auth:deviceauth_sdk",
77      "hilog:libhilog",
78    ]
79  } else {
80    external_deps = [
81      "hilog:libhilog",
82      "huks:libhukssdk",
83    ]
84  }
85  external_deps += [
86    "c_utils:utils",
87    "ipc:ipc_core",
88  ]
89}
90
91ohos_unittest("HeartBeatFSMTest") {
92  module_out_path = module_output_path
93  sources = [
94    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c",
95    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c",
96    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c",
97    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c",
98    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c",
99    "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager_virtual.c",
100    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp",
101    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp",
102    "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp",
103    "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_fsm_test.cpp",
104    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp",
105  ]
106
107  include_dirs = [
108    "$dsoftbus_root_path/core/connection/interface",
109    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
110    "$dsoftbus_root_path/tests/core/bus_center/mock_common/include",
111    "$dsoftbus_root_path/core/connection/p2p/common/include",
112    "$dsoftbus_root_path/core/connection/p2p/interface",
113    "$dsoftbus_root_path/core/bus_center/service/include",
114    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
115    "$dsoftbus_root_path/core/authentication/include",
116    "$dsoftbus_root_path/core/authentication/interface",
117    "$dsoftbus_root_path/core/discovery/interface",
118    "$dsoftbus_root_path/core/discovery/manager/include",
119    "$dsoftbus_root_path/core/core/discovery/manager/include",
120    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src",
121    "$dsoftbus_root_path/core/bus_center/interface",
122    "$dsoftbus_root_path/core/common/include",
123    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
124    "$dsoftbus_root_path/core/bus_center/utils/include",
125    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
126    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
127    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
128    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
129    "$dsoftbus_root_path/core/adapter/bus_center/include",
130    "$dsoftbus_root_path/adapter/common/include",
131    "$dsoftbus_root_path/core/common/include",
132    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
133    "$dsoftbus_root_path/core/connection/wifi_direct",
134  ]
135
136  deps = [
137    "$dsoftbus_root_path/adapter:softbus_adapter",
138    "$dsoftbus_root_path/core/common:softbus_utils",
139    "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core",
140    "//third_party/googletest:gmock",
141    "//third_party/googletest:gtest_main",
142  ]
143
144  if (is_standard_system) {
145    external_deps = [
146      "c_utils:utils",
147      "device_auth:deviceauth_sdk",
148      "hilog:libhilog",
149    ]
150  } else {
151    external_deps = [
152      "c_utils:utils",
153      "hilog:libhilog",
154      "huks:libhukssdk",
155    ]
156  }
157}
158
159ohos_unittest("ClientProxyTest") {
160  module_out_path = "dsoftbus/bus_center"
161  sources = [
162    "$dsoftbus_root_path/tests/core/bus_center/test/ipc/client_proxy_test.cpp",
163  ]
164
165  include_dirs = [
166    "$dsoftbus_root_path/adapter/common/include",
167    "$dsoftbus_root_path/core/bus_center/ipc/standard/include",
168    "$dsoftbus_root_path/sdk/frame/standard/include",
169    "$dsoftbus_root_path/interfaces/kits/discovery",
170    "$dsoftbus_root_path/interfaces/kits/transport",
171    "$dsoftbus_root_path/core/frame/standard/init/include",
172    "$dsoftbus_root_path/core/frame/standard/client_manager/include",
173    "$dsoftbus_root_path/core/common/include",
174    "$dsoftbus_root_path/core/frame/common/include",
175    "../../transmission/ipc/samgr/interfaces/innerkits/samgr_proxy/include",
176    "//foundation/window/window_manager/previewer/mock",
177    "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include",
178    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
179    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include/",
180  ]
181
182  deps = [
183    "$dsoftbus_root_path/adapter:softbus_adapter",
184    "$dsoftbus_root_path/core/common:softbus_utils",
185    "$dsoftbus_root_path/core/frame:softbus_server",
186    "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core",
187    "//third_party/googletest:gmock",
188    "//third_party/googletest:gtest_main",
189  ]
190
191  if (is_standard_system) {
192    external_deps = [
193      "c_utils:utils",
194      "device_auth:deviceauth_sdk",
195      "hilog:libhilog",
196      "samgr:samgr_proxy",
197    ]
198  } else {
199    external_deps = [
200      "c_utils:utils",
201      "hilog:libhilog",
202      "huks:libhukssdk",
203      "samgr:samgr_proxy",
204    ]
205  }
206}
207
208ohos_unittest("BusCenterIpcTest") {
209  module_out_path = module_output_path
210  sources = [
211    "$dsoftbus_root_path/tests/core/bus_center/test/ipc/bus_center_ipc_test.cpp",
212    "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_ipc_mock.cpp",
213  ]
214
215  include_dirs = [
216    "$dsoftbus_root_path/core/common/include",
217    "$dsoftbus_root_path/tests/core/bus_center/test/mock/include",
218    "$dsoftbus_root_path/core/bus_center/service/include",
219    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
220    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
221    "$dsoftbus_root_path/core/authentication/interface",
222    "$dsoftbus_root_path/core/discovery/manager/include",
223    "$dsoftbus_root_path/core/bus_center/ipc/include",
224    "$dsoftbus_root_path/core/bus_center/ipc/standard/include",
225    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
226    "$dsoftbus_root_path/core/discovery/interface",
227    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include",
228    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
229    "$dsoftbus_root_path/core/bus_center/interface",
230    "$dsoftbus_root_path/core/bus_center/ipc/standard/src",
231    "$dsoftbus_root_path/core/bus_center/utils/include",
232    "$dsoftbus_root_path/core/bus_center/ipc/standard/include",
233    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
234  ]
235
236  deps = [
237    "$dsoftbus_root_path/adapter:softbus_adapter",
238    "$dsoftbus_root_path/core/common:softbus_utils",
239    "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core",
240    "//third_party/googletest:gmock",
241    "//third_party/googletest:gtest_main",
242  ]
243
244  if (is_standard_system) {
245    external_deps = [
246      "c_utils:utils",
247      "device_auth:deviceauth_sdk",
248      "hilog:libhilog",
249    ]
250  } else {
251    external_deps = [
252      "c_utils:utils",
253      "hilog:libhilog",
254      "huks:libhukssdk",
255    ]
256  }
257}
258
259group("unittest") {
260  testonly = true
261  deps = [
262    ":BusCenterIpcTest",
263    ":ClientProxyTest",
264    ":HeartBeatFSMTest",
265    ":HeartBeatMediumTest",
266  ]
267}
268