1# Copyright (c) 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/frame"
18dsoftbus_root_path = "../../../.."
19softbus_adapter_common = "${dsoftbus_root_path}/adapter/common"
20
21ohos_unittest("SoftbusServerStubTest") {
22  module_out_path = module_output_path
23  sources = [
24    "mock/softbus_server_stub_test_mock.cpp",
25    "softbus_server_stub_test.cpp",
26  ]
27
28  include_dirs = [
29    "$dsoftbus_root_path/adapter/common/include",
30    "$dsoftbus_root_path/core/authentication/interface",
31    "$dsoftbus_root_path/core/bus_center/interface",
32    "$dsoftbus_root_path/core/bus_center/ipc/include",
33    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
34    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
35    "$dsoftbus_root_path/core/common/dfx/interface/include",
36    "$dsoftbus_root_path/core/common/include",
37    "$dsoftbus_root_path/core/common/security/permission/include",
38    "$dsoftbus_root_path/core/connection/interface",
39    "$dsoftbus_root_path/core/discovery/interface",
40    "$dsoftbus_root_path/core/discovery/manager/include",
41    "$dsoftbus_root_path/core/frame/common/include",
42    "$dsoftbus_root_path/core/frame/standard/init/include",
43    "$dsoftbus_root_path/core/frame/standard/init/src",
44    "$dsoftbus_root_path/core/transmission/common/include",
45    "$dsoftbus_root_path/core/transmission/session/include",
46    "$dsoftbus_root_path/core/transmission/trans_channel/manager/include",
47    "$dsoftbus_root_path/core/transmission/trans_channel/tcp_direct/include",
48    "$dsoftbus_root_path/interfaces/kits/common",
49    "$dsoftbus_root_path/interfaces/kits/discovery",
50    "$dsoftbus_root_path/interfaces/kits/transport",
51    "$dsoftbus_root_path/tests/core/frame/unittest/mock",
52    "$dsoftbus_root_path/tests/sdk/common/include",
53  ]
54
55  deps = [
56    "$dsoftbus_root_path/core/common:softbus_utils",
57    "$dsoftbus_root_path/core/frame:softbus_server",
58    "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
59  ]
60
61  if (is_standard_system) {
62    external_deps = [
63      "access_token:libaccesstoken_sdk",
64      "access_token:libprivacy_sdk",
65      "access_token:libtokenid_sdk",
66      "c_utils:utils",
67      "googletest:gmock",
68      "hilog:libhilog",
69      "ipc:ipc_single",
70      "samgr:samgr_proxy",
71    ]
72  }
73}
74
75ohos_unittest("SoftbusServerTest") {
76  module_out_path = module_output_path
77  sources = [
78    "mock/softbus_server_test_mock.cpp",
79    "softbus_server_test.cpp",
80  ]
81
82  include_dirs = [
83    "$dsoftbus_root_path/core/bus_center/interface",
84    "$dsoftbus_root_path/core/discovery/manager/include",
85    "$dsoftbus_root_path/core/discovery/interface",
86    "$dsoftbus_root_path/core/frame/standard/client_manager/include",
87    "$dsoftbus_root_path/core/frame/standard/init/include",
88    "$dsoftbus_root_path/core/frame/standard/init/src",
89    "$dsoftbus_root_path/core/frame/standard/init/include",
90    "$dsoftbus_root_path/core/frame/standard/init/src",
91    "$dsoftbus_root_path/tests/core/frame/unittest/mock",
92  ]
93
94  deps = [
95    "$dsoftbus_root_path/core/common:softbus_utils",
96    "$dsoftbus_root_path/core/frame:softbus_server",
97  ]
98
99  if (is_standard_system) {
100    external_deps = [
101      "c_utils:utils",
102      "googletest:gmock",
103      "hilog:libhilog",
104      "samgr:samgr_proxy",
105    ]
106  }
107}
108
109group("unittest") {
110  testonly = true
111  deps = [
112    ":SoftbusServerStubTest",
113    ":SoftbusServerTest",
114  ]
115}
116