• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/lite/config/component/lite_component.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17import("../../../../../dsoftbus.gni")
18
19module_output_path = "dsoftbus/discovery"
20
21ohos_unittest("DiscManagerTest") {
22  module_out_path = module_output_path
23  sources = [ "disc_manager_test.cpp" ]
24
25  include_dirs = [
26    "$softbus_adapter_common/include",
27    "$dsoftbus_root_path/core/common/include",
28    "$dsoftbus_root_path/core/discovery/interface",
29    "$dsoftbus_root_path/interfaces/kits/common",
30    "$dsoftbus_root_path/interfaces/kits/discovery",
31    "$dsoftbus_root_path/core/discovery/manager/include",
32    "$dsoftbus_root_path/core/discovery/coap/interface",
33    "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface",
34    "unittest/common/",
35  ]
36
37  deps = [
38    "$dsoftbus_dfx_path:softbus_dfx",
39    "$dsoftbus_root_path/components/nstackx/nstackx_ctrl:nstackx_ctrl",
40    "$dsoftbus_root_path/tests/core/frame:softbus_server_static",
41  ]
42
43  external_deps = [
44    "c_utils:utils",
45    "googletest:gtest_main",
46    "hilog:libhilog",
47  ]
48}
49
50ohos_unittest("DiscManagerMockTest") {
51  module_out_path = module_output_path
52  sources = [
53    "$dsoftbus_core_path/discovery/ble/approach_ble/src/disc_approach_ble_virtual.c",
54    "$dsoftbus_core_path/discovery/ble/virtual_link_ble/src/disc_virtual_link_ble_virtual.c",
55    "$dsoftbus_core_path/discovery/manager/src/disc_manager.c",
56    "ble_mock.cpp",
57    "coap_mock.cpp",
58    "disc_manager_mock_test.cpp",
59    "usb_mock.cpp",
60  ]
61
62  include_dirs = [
63    "$softbus_adapter_common/include",
64    "$dsoftbus_core_path/common/include",
65    "$dsoftbus_dfx_path/interface/include",
66    "$dsoftbus_core_path/discovery/interface",
67    "$dsoftbus_core_path/discovery/ipc/include",
68    "$dsoftbus_core_path/discovery/manager/include",
69    "$dsoftbus_core_path/bus_center/interface",
70    "$dsoftbus_core_path/bus_center/lnn/net_builder/include",
71    "$dsoftbus_core_path/bus_center/service/include",
72    "$dsoftbus_core_path/discovery/ble/dispatcher/include",
73    "$dsoftbus_core_path/discovery/usb/dispatcher/include",
74    "$dsoftbus_core_path/discovery/coap/interface",
75    "$dsoftbus_root_path/interfaces/kits/bus_center",
76    "$dsoftbus_root_path/interfaces/kits/common",
77    "$dsoftbus_root_path/interfaces/kits/discovery",
78    "$dsoftbus_core_path/discovery/ble/approach_ble/include",
79    "$dsoftbus_core_path/discovery/ble/virtual_link_ble/include",
80  ]
81
82  deps = [
83    "$dsoftbus_root_path/adapter:softbus_adapter",
84    "$dsoftbus_root_path/core/common:softbus_utils",
85  ]
86  external_deps = [
87    "googletest:gmock",
88    "googletest:gtest_main",
89    "hilog:libhilog",
90  ]
91}
92
93group("unittest") {
94  testonly = true
95  deps = [
96    ":DiscManagerMockTest",
97    ":DiscManagerTest",
98  ]
99}
100