• 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"
18dsoftbus_root_path = "../../../.."
19
20ohos_unittest("LNNConnAddrUtilsTest") {
21  module_out_path = module_output_path
22  sources = [ "lnn_bus_center_utils_test.cpp" ]
23  include_dirs = [
24    "$dsoftbus_root_path/core/bus_center/utils/include",
25    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
26    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
27    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include",
28    "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include",
29    "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include",
30    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
31    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include",
32    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
33    "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include",
34    "$dsoftbus_root_path/core/bus_center/monitor/include",
35    "$dsoftbus_root_path/core/common/include",
36    "$dsoftbus_root_path/adapter/common/include",
37    "$dsoftbus_root_path/core/connection/interface",
38    "$dsoftbus_root_path/core/connection/p2p/interface",
39    "$dsoftbus_root_path/core/connection/p2p/common/include",
40    "$dsoftbus_root_path/core/authentication/interface",
41    "$dsoftbus_root_path/core/bus_center/interface",
42    "$dsoftbus_root_path/core/bus_center/utils/include",
43    "$dsoftbus_root_path/interfaces/kits/bus_center",
44    "$dsoftbus_root_path/interfaces/kits/common",
45    "$dsoftbus_root_path/core/adapter/bus_center/include",
46    "unittest/common/",
47    "$dsoftbus_root_path/core/connection/manager",
48    "$dsoftbus_root_path/adapter/common/bus_center/include/",
49    "$dsoftbus_root_path/core/discovery/manager/include",
50    "$dsoftbus_root_path/core/discovery/interface",
51    "$dsoftbus_root_path/interfaces/kits/discovery",
52    "$dsoftbus_root_path/core/bus_center/service/include",
53    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include",
54  ]
55  deps = [
56    "$dsoftbus_dfx_path:softbus_dfx",
57    "$dsoftbus_root_path/adapter:softbus_adapter",
58    "$dsoftbus_root_path/core/common:softbus_utils",
59    "$dsoftbus_root_path/core/frame:softbus_server",
60  ]
61  if (is_standard_system) {
62    external_deps = [
63      "c_utils:utils",
64      "device_auth:deviceauth_sdk",
65      "googletest:gmock",
66      "googletest:gtest_main",
67      "hilog:libhilog",
68    ]
69  } else {
70    external_deps = [
71      "c_utils:utils",
72      "googletest:gmock",
73      "googletest:gtest_main",
74      "hilog:libhilog",
75      "huks:libhukssdk",
76    ]
77  }
78}
79
80ohos_unittest("LNNFileUtilsTest") {
81  module_out_path = module_output_path
82  sources = [
83    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_ledger/lnn_decision_db_deps_mock.cpp",
84    "lnn_file_utils_test.cpp",
85  ]
86  include_dirs = [
87    "$dsoftbus_root_path/core/bus_center/utils/include",
88    "$dsoftbus_root_path/adapter/common/include",
89    "$dsoftbus_root_path/interfaces/kits/bus_center",
90    "$dsoftbus_root_path/interfaces/kits/common",
91    "$dsoftbus_root_path/tests/core/bus_center/lnn/net_ledger",
92    "$dsoftbus_root_path/core/authentication/interface",
93    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
94    "unittest/common/",
95    "$dsoftbus_root_path/core/common/include",
96    "$dsoftbus_root_path/core/bus_center/interface",
97    "$dsoftbus_root_path/core/bus_center/service/include",
98    "$dsoftbus_root_path/core/discovery/manager/include",
99    "$dsoftbus_root_path/core/discovery/interface",
100    "$dsoftbus_root_path/interfaces/kits/discovery",
101    "$dsoftbus_root_path/interfaces/kits/lnn",
102    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
103    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
104  ]
105  deps = [
106    "$dsoftbus_dfx_path:softbus_dfx",
107    "$dsoftbus_root_path/adapter:softbus_adapter",
108    "$dsoftbus_root_path/core/common:softbus_utils",
109    "$dsoftbus_root_path/core/frame:softbus_server",
110  ]
111  if (is_standard_system) {
112    external_deps = [
113      "c_utils:utils",
114      "device_auth:deviceauth_sdk",
115      "googletest:gmock",
116      "googletest:gtest_main",
117      "hilog:libhilog",
118      "huks:libhukssdk",
119    ]
120  } else {
121    external_deps = [
122      "c_utils:utils",
123      "googletest:gmock",
124      "googletest:gtest_main",
125      "hilog:libhilog",
126      "huks:libhukssdk",
127    ]
128  }
129}
130
131ohos_unittest("BusCenterUtilsTest") {
132  module_out_path = module_output_path
133  sources = [
134    "$dsoftbus_root_path/core/bus_center/utils/src/lnn_compress.c",
135    "bus_center_utils_mock.cpp",
136    "bus_center_utils_test.cpp",
137  ]
138  include_dirs = [
139    "$dsoftbus_root_path/adapter/common/include",
140    "$dsoftbus_root_path/core/bus_center/interface",
141    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
142    "$dsoftbus_root_path/core/bus_center/utils/include",
143    "$dsoftbus_root_path/core/bus_center/utils/src",
144    "$dsoftbus_root_path/interfaces/kits/common",
145    "$dsoftbus_root_path/tests/core/bus_center/utils",
146  ]
147  deps = [
148    "$dsoftbus_dfx_path:softbus_dfx",
149    "$dsoftbus_root_path/adapter:softbus_adapter",
150    "$dsoftbus_root_path/core/common:softbus_utils",
151    "$dsoftbus_root_path/core/frame:softbus_server",
152  ]
153  external_deps = [
154    "bounds_checking_function:libsec_static",
155    "c_utils:utils",
156    "dsoftbus:softbus_client",
157    "googletest:gmock",
158    "googletest:gtest_main",
159    "hilog:libhilog",
160    "zlib:libz",
161  ]
162}
163
164group("unittest") {
165  testonly = true
166  deps = [
167    ":BusCenterUtilsTest",
168    ":LNNConnAddrUtilsTest",
169    ":LNNFileUtilsTest",
170  ]
171}
172