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/soft_bus/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/interfaces/kits/disc", 29 "$dsoftbus_root_path/core/discovery/interface", 30 "$dsoftbus_root_path/interfaces/kits/common", 31 "$dsoftbus_root_path/interfaces/kits/discovery", 32 "$dsoftbus_root_path/core/discovery/manager/include", 33 "$dsoftbus_root_path/core/discovery/coap/interface", 34 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface", 35 "unittest/common/", 36 "$dsoftbus_root_path/interfaces/kits/nstackx", 37 ] 38 39 deps = [ 40 "$dsoftbus_dfx_path:softbus_dfx", 41 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl:nstackx_ctrl", 42 "$dsoftbus_root_path/core/frame:softbus_server", 43 ] 44 45 external_deps = [ 46 "c_utils:utils", 47 "googletest:gtest_main", 48 "hilog:libhilog", 49 ] 50} 51 52ohos_unittest("DiscManagerMockTest") { 53 module_out_path = module_output_path 54 sources = [ 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 "$dsoftbus_root_path/dfx:softbus_dfx", 86 ] 87 external_deps = [ 88 "googletest:gmock", 89 "googletest:gtest_main", 90 "hilog:libhilog", 91 ] 92} 93 94group("unittest") { 95 testonly = true 96 deps = [ 97 ":DiscManagerMockTest", 98 ":DiscManagerTest", 99 ] 100} 101