• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_dfx_path/interface/include",
30    "$dsoftbus_root_path/adapter/common/include",
31    "$dsoftbus_root_path/core/adapter/bus_center/include",
32    "$dsoftbus_root_path/core/authentication/interface",
33    "$dsoftbus_root_path/core/bus_center/interface",
34    "$dsoftbus_root_path/core/bus_center/ipc/include",
35    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
36    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include",
37    "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include",
38    "$dsoftbus_root_path/core/common/include",
39    "$dsoftbus_root_path/core/common/security/permission/include",
40    "$dsoftbus_root_path/core/connection/interface",
41    "$dsoftbus_root_path/core/discovery/interface",
42    "$dsoftbus_root_path/core/discovery/manager/include",
43    "$dsoftbus_root_path/core/frame/common/include",
44    "$dsoftbus_root_path/core/frame/standard/init/include",
45    "$dsoftbus_root_path/core/frame/standard/init/src",
46    "$dsoftbus_root_path/core/transmission/common/include",
47    "$dsoftbus_root_path/core/transmission/ipc/include",
48    "$dsoftbus_root_path/core/transmission/session/cpp/include",
49    "$dsoftbus_root_path/core/transmission/session/include",
50    "$dsoftbus_root_path/core/transmission/trans_channel/common/include",
51    "$dsoftbus_root_path/core/transmission/trans_channel/manager/include",
52    "$dsoftbus_root_path/core/transmission/trans_channel/tcp_direct/include",
53    "$dsoftbus_root_path/interfaces/kits/common",
54    "$dsoftbus_root_path/interfaces/kits/discovery",
55    "$dsoftbus_root_path/interfaces/kits/transport",
56    "$dsoftbus_root_path/tests/core/frame/unittest/mock",
57    "$dsoftbus_root_path/tests/sdk/common/include",
58  ]
59
60  deps = [
61    "$dsoftbus_root_path/core/common:softbus_utils",
62    "$dsoftbus_root_path/core/frame:softbus_server",
63    "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
64  ]
65
66  if (is_standard_system) {
67    external_deps = [
68      "c_utils:utils",
69      "dsoftbus:softbus_client",
70      "googletest:gmock",
71      "hilog:libhilog",
72      "ipc:ipc_single",
73      "safwk:system_ability_fwk",
74      "samgr:samgr_proxy",
75    ]
76    if (has_ces_part) {
77      external_deps += [ "common_event_service:cesfwk_innerkits" ]
78    }
79  }
80  if (dsoftbus_access_token_feature) {
81    external_deps += [
82      "access_token:libaccesstoken_sdk",
83      "access_token:libprivacy_sdk",
84      "access_token:libtokenid_sdk",
85    ]
86  }
87}
88
89ohos_unittest("SoftbusServerTest") {
90  module_out_path = module_output_path
91  sources = [
92    "mock/softbus_server_test_mock.cpp",
93    "softbus_server_test.cpp",
94  ]
95
96  include_dirs = [
97    "$dsoftbus_root_path/core/bus_center/interface",
98    "$dsoftbus_root_path/core/discovery/manager/include",
99    "$dsoftbus_root_path/core/discovery/interface",
100    "$dsoftbus_root_path/core/frame/standard/client_manager/include",
101    "$dsoftbus_root_path/core/frame/standard/init/include",
102    "$dsoftbus_root_path/core/frame/standard/init/src",
103    "$dsoftbus_root_path/core/frame/standard/init/include",
104    "$dsoftbus_root_path/core/frame/standard/init/src",
105    "$dsoftbus_root_path/tests/core/frame/unittest/mock",
106  ]
107
108  deps = [
109    "$dsoftbus_root_path/core/common:softbus_utils",
110    "$dsoftbus_root_path/core/frame:softbus_server",
111  ]
112
113  if (is_standard_system) {
114    external_deps = [
115      "c_utils:utils",
116      "dsoftbus:softbus_client",
117      "googletest:gmock",
118      "hilog:libhilog",
119      "safwk:system_ability_fwk",
120      "samgr:samgr_proxy",
121    ]
122  }
123}
124
125group("unittest") {
126  testonly = true
127  deps = [ ":SoftbusServerTest" ]
128  if (dsoftbus_access_token_feature) {
129    deps += [ ":SoftbusServerStubTest" ]
130  }
131}
132