• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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/soft_bus/connection"
18dsoftbus_root_path = "../../../../.."
19
20ohos_unittest("SoftbusConnCommonTest") {
21  module_out_path = module_output_path
22
23  #ldflags = [ "-lstdc++" ]
24  include_dirs = [
25    "$dsoftbus_root_path/core/common/include",
26    "$dsoftbus_root_path/adapter/common/include",
27    "$dsoftbus_root_path/interfaces/kits/connect",
28    "$dsoftbus_root_path/core/connection/interface",
29    "$dsoftbus_root_path/core/connection/manager",
30    "$dsoftbus_root_path/core/connection/common/include",
31    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock",
32  ]
33  sources = [
34    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock/softbus_adapter_mock.cpp",
35    "softbus_conn_common_test.cpp",
36  ]
37  deps = [
38    "$dsoftbus_root_path/adapter:softbus_adapter",
39    "$dsoftbus_root_path/core/common:softbus_utils",
40    "$dsoftbus_root_path/core/frame:softbus_server",
41  ]
42  external_deps = [
43    "bounds_checking_function:libsec_static",
44    "googletest:gmock",
45    "hilog:libhilog",
46  ]
47}
48
49ohos_unittest("SoftbusRcTest") {
50  module_out_path = module_output_path
51
52  include_dirs = [
53    "$dsoftbus_root_path/core/connection/common/include",
54    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock",
55  ]
56
57  sources = [
58    "$dsoftbus_root_path/core/connection/common/src/softbus_rc_collection.c",
59    "$dsoftbus_root_path/core/connection/common/src/softbus_rc_object.c",
60    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock/softbus_conn_common_mock.cpp",
61    "softbus_rc_object_collection_test.cpp",
62  ]
63
64  deps = [
65    "$dsoftbus_dfx_path:softbus_dfx",
66    "$dsoftbus_root_path/adapter:softbus_adapter",
67    "$dsoftbus_root_path/core/common:softbus_utils",
68  ]
69
70  external_deps = [
71    "googletest:gmock",
72    "googletest:gtest",
73    "googletest:gtest_main",
74    "hilog:libhilog",
75  ]
76}
77
78ohos_unittest("SoftbusConnAsyncHelperTest") {
79  module_out_path = module_output_path
80
81  include_dirs = [
82    "$dsoftbus_root_path/core/connection/common/include",
83    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock",
84  ]
85
86  sources = [
87    "$dsoftbus_root_path/core/connection/common/src/softbus_conn_async_helper.c",
88    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock/softbus_conn_common_mock.cpp",
89    "softbus_conn_async_helper_test.cpp",
90  ]
91
92  deps = [
93    "$dsoftbus_dfx_path:softbus_dfx",
94    "$dsoftbus_root_path/adapter:softbus_adapter",
95    "$dsoftbus_root_path/core/common:softbus_utils",
96  ]
97
98  external_deps = [
99    "googletest:gmock",
100    "googletest:gtest",
101    "googletest:gtest_main",
102    "hilog:libhilog",
103  ]
104}
105
106ohos_unittest("SoftbusConnQueueTest") {
107  module_out_path = module_output_path
108
109  include_dirs = [
110    "$dsoftbus_root_path/core/connection/common/include",
111    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock",
112  ]
113
114  sources = [
115    "$dsoftbus_root_path/core/connection/common/src/softbus_conn_bytes_delivery.c",
116    "$dsoftbus_root_path/core/connection/common/src/softbus_conn_fair_priority_queue.c",
117    "$dsoftbus_root_path/tests/core/connection/common/unittest/mock/softbus_conn_common_mock.cpp",
118    "softbus_conn_bytes_delivery_test.cpp",
119    "softbus_conn_fair_priority_queue_test.cpp",
120  ]
121
122  deps = [
123    "$dsoftbus_dfx_path:softbus_dfx",
124    "$dsoftbus_root_path/adapter:softbus_adapter",
125    "$dsoftbus_root_path/core/common:softbus_utils",
126  ]
127
128  external_deps = [
129    "googletest:gmock",
130    "googletest:gtest",
131    "googletest:gtest_main",
132    "hilog:libhilog",
133  ]
134}
135
136ohos_unittest("DataheadTransformTest") {
137  module_out_path = module_output_path
138
139  include_dirs = [ "$dsoftbus_root_path/core/connection/common/include" ]
140
141  sources = [ "softbus_datahead_transform_test.cpp" ]
142
143  deps = [
144    "$dsoftbus_dfx_path:softbus_dfx",
145    "$dsoftbus_root_path/adapter:softbus_adapter",
146    "$dsoftbus_root_path/core/common:softbus_utils",
147  ]
148
149  external_deps = [
150    "googletest:gmock",
151    "googletest:gtest",
152    "googletest:gtest_main",
153    "hilog:libhilog",
154  ]
155}
156