• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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/core"
18dsoftbus_root_path = "../../.."
19
20ohos_unittest("LnnKVAdapterTest") {
21  module_out_path = module_output_path
22  sources = [ "unittest/lnn_kv_adapter_test.cpp" ]
23  include_dirs = [
24    "$dsoftbus_root_path/core/adapter/kv_store/include",
25    "$dsoftbus_root_path/core/adapter/bus_center/include",
26    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
27    "$dsoftbus_root_path/core/common/include",
28  ]
29  deps = [
30    "$dsoftbus_root_path/core/common:softbus_utils",
31    "$dsoftbus_root_path/core/frame:softbus_server",
32  ]
33  external_deps = [ "kv_store:distributeddata_inner" ]
34}
35
36ohos_unittest("LnnKVAdapterWrapperTest") {
37  module_out_path = module_output_path
38  sources = [ "unittest/lnn_kv_adapter_wrapper_test.cpp" ]
39  include_dirs = [
40    "$dsoftbus_root_path/core/adapter/kv_store/include",
41    "$dsoftbus_root_path/core/adapter/bus_center/include",
42    "$dsoftbus_root_path/core/common/include",
43    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
44    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
45    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
46    "$dsoftbus_root_path/core/bus_center/interface",
47  ]
48  deps = [
49    "$dsoftbus_root_path/core/common:softbus_utils",
50    "$dsoftbus_root_path/core/frame:softbus_server",
51  ]
52  external_deps = [
53    "dsoftbus:softbus_client",
54    "kv_store:distributeddata_inner",
55  ]
56}
57
58ohos_unittest("LnnKSettingDataEventMonitorTest") {
59  module_out_path = module_output_path
60  sources = [
61    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_settingdata_event_monitor.cpp",
62    "unittest/lnn_settingdata_event_monitor_deps_mock.cpp",
63    "unittest/lnn_settingdata_event_monitor_test.cpp",
64  ]
65  include_dirs = [
66    "$dsoftbus_root_path/core/adapter/kv_store/include",
67    "$dsoftbus_root_path/core/adapter/bus_center/include",
68    "$dsoftbus_root_path/core/adapter/bus_center/src",
69    "$dsoftbus_root_path/core/common/include",
70    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
71    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
72    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
73    "$dsoftbus_root_path/core/bus_center/interface",
74    "$dsoftbus_root_path/core/bus_center/utils/include",
75    "$dsoftbus_root_path/core/bus_center/service/include/",
76    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include",
77    "$dsoftbus_root_path/tests/core/adapter/unittest/",
78    "$dsoftbus_root_path/interfaces/kits/bus_center",
79    "$dsoftbus_root_path/interfaces/kits/common",
80  ]
81  deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ]
82  external_deps = [
83    "ability_base:want",
84    "ability_base:zuri",
85    "ability_runtime:dataobs_manager",
86    "data_share:datashare_consumer",
87    "googletest:gmock_main",
88    "googletest:gtest_main",
89    "hilog:libhilog",
90    "kv_store:distributeddata_inner",
91    "samgr:samgr_proxy",
92  ]
93  if (is_standard_system && has_ces_part) {
94    external_deps += [ "common_event_service:cesfwk_innerkits" ]
95  }
96  if (support_i18n && qemu_arm_disable) {
97    external_deps += [ "i18n:intl_util" ]
98  }
99}
100
101ohos_unittest("AdapterDsoftbusRsaCryptoTest") {
102  module_out_path = module_output_path
103  sources = [ "unittest/dsoftbus_rsa_crypto_test.cpp" ]
104
105  include_dirs = [
106    "$dsoftbus_dfx_path/interface/include",
107    "$dsoftbus_root_path/adapter/common/include",
108    "$dsoftbus_root_path/core/adapter/huks/include",
109    "$dsoftbus_root_path/core/adapter/transmission/include",
110    "$dsoftbus_root_path/core/common/include",
111    "$dsoftbus_root_path/interfaces/kits/common",
112  ]
113
114  deps = [
115    "$dsoftbus_root_path/adapter:softbus_adapter",
116    "$dsoftbus_root_path/core/common:softbus_utils",
117    "$dsoftbus_root_path/core/frame:softbus_server",
118  ]
119
120  if (is_standard_system) {
121    external_deps = [
122      "bounds_checking_function:libsec_static",
123      "googletest:gtest_main",
124      "hilog:libhilog",
125      "huks:libhukssdk",
126      "openssl:libcrypto_shared",
127    ]
128  } else {
129    external_deps = [
130      "c_utils:utils",
131      "hilog:libhilog",
132    ]
133  }
134}
135
136ohos_unittest("LNNOhosAccountTest") {
137  module_out_path = module_output_path
138  sources = [
139    "unittest/lnn_ohos_account_mock.cpp",
140    "unittest/lnn_ohos_account_test.cpp",
141  ]
142  include_dirs = [
143    "$dsoftbus_root_path/core/adapter/bus_center/include",
144    "$dsoftbus_root_path/core/adapter/bus_center/include",
145    "$dsoftbus_root_path/core/adapter/kv_store/include",
146    "$dsoftbus_root_path/core/authentication/interface",
147    "$dsoftbus_root_path/core/bus_center/interface",
148    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
149    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
150    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
151    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
152    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
153    "$dsoftbus_root_path/core/bus_center/service/include",
154    "$dsoftbus_root_path/core/bus_center/utils/include",
155    "$dsoftbus_root_path/core/common/include",
156    "$dsoftbus_root_path/core/discovery/interface",
157    "$dsoftbus_root_path/dfx/interface/include/form",
158    "$dsoftbus_root_path/interfaces/kits/bus_center",
159    "$dsoftbus_root_path/interfaces/kits/common",
160  ]
161  deps = [
162    "$dsoftbus_root_path/core/common:softbus_utils",
163    "$dsoftbus_root_path/core/frame:softbus_server",
164  ]
165  external_deps = [
166    "bounds_checking_function:libsec_static",
167    "cJSON:cjson",
168    "c_utils:utils",
169    "googletest:gmock_main",
170    "googletest:gtest_main",
171    "hilog:libhilog",
172  ]
173}
174
175ohos_unittest("LNNKvStoreLaunchListenerTest") {
176  module_out_path = module_output_path
177  sources = [
178    "$dsoftbus_root_path/core/adapter/subscribe_kv_store_sa/src/lnn_kv_store_launch_listener.cpp",
179    "unittest/lnn_kv_store_launch_listener_mock.cpp",
180    "unittest/lnn_kv_store_launch_listener_test.cpp",
181  ]
182  include_dirs = [
183    "$dsoftbus_root_path/core/adapter/kv_store/include",
184    "$dsoftbus_root_path/core/adapter/subscribe_kv_store_sa/include",
185    "$dsoftbus_root_path/core/adapter/bus_center/include",
186    "$dsoftbus_root_path/core/common/include",
187    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
188    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
189    "$dsoftbus_root_path/core/bus_center/interface",
190    "$dsoftbus_root_path/interfaces/kits/bus_center",
191    "$dsoftbus_root_path/interfaces/kits/common",
192  ]
193  deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ]
194  external_deps = [
195    "bounds_checking_function:libsec_static",
196    "c_utils:utils",
197    "googletest:gmock_main",
198    "googletest:gtest_main",
199    "hilog:libhilog",
200    "ipc:ipc_core",
201    "safwk:system_ability_fwk",
202    "samgr:samgr_proxy",
203  ]
204}
205
206ohos_unittest("LnnOhosAccountAdapterTest") {
207  module_out_path = module_output_path
208  sources = [
209    "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_ohos_account_adapter.cpp",
210    "unittest/lnn_ohos_account_adapter_mock.cpp",
211    "unittest/lnn_ohos_account_adapter_test.cpp",
212  ]
213
214  include_dirs = [
215    "unittest",
216    "$dsoftbus_root_path/core/adapter/bus_center/include",
217    "$dsoftbus_root_path/core/authentication/include",
218    "$dsoftbus_root_path/interfaces/kits/common",
219  ]
220
221  deps = [
222    "$dsoftbus_root_path/adapter:softbus_adapter",
223    "$dsoftbus_root_path/core/common:softbus_utils",
224    "$dsoftbus_root_path/core/frame:softbus_server",
225  ]
226
227  if (is_standard_system) {
228    external_deps = [
229      "ability_base:base",
230      "ability_base:want",
231      "ability_base:zuri",
232      "bounds_checking_function:libsec_static",
233      "c_utils:utils",
234      "device_auth:deviceauth_sdk",
235      "googletest:gmock_main",
236      "googletest:gtest_main",
237      "hilog:libhilog",
238      "ipc:ipc_single",
239      "os_account:os_account_innerkits",
240    ]
241  } else {
242    external_deps = [
243      "c_utils:utils",
244      "hilog:libhilog",
245    ]
246  }
247}
248
249group("unittest") {
250  testonly = true
251
252  deps = [
253    ":AdapterDsoftbusRsaCryptoTest",
254    ":LNNKvStoreLaunchListenerTest",
255    ":LNNOhosAccountTest",
256    ":LnnKSettingDataEventMonitorTest",
257    ":LnnOhosAccountAdapterTest",
258  ]
259  if (dsoftbus_feature_lnn_cloud_sync) {
260    deps += [
261      ":LnnKVAdapterTest",
262      ":LnnKVAdapterWrapperTest",
263    ]
264  }
265}
266
267group("fuzztest") {
268  testonly = true
269  deps = [ "fuzztest:fuzztest" ]
270}
271