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("../../../../../core/common/dfx/dsoftbus_dfx.gni") 18import("../../../../../dsoftbus.gni") 19import("../../../../utils/utils.gni") 20 21module_output_path = "dsoftbus/discovery" 22 23ohos_unittest("DiscManagerTest") { 24 module_out_path = module_output_path 25 sources = [ "disc_manager_test.cpp" ] 26 27 include_dirs = [ 28 "$softbus_adapter_common/include", 29 "$dsoftbus_root_path/core/common/include", 30 "$dsoftbus_root_path/core/discovery/interface", 31 "$dsoftbus_root_path/interfaces/kits/common", 32 "$dsoftbus_root_path/interfaces/kits/discovery", 33 "$dsoftbus_root_path/core/discovery/manager/include", 34 "$dsoftbus_root_path/core/discovery/coap/interface", 35 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface", 36 "unittest/common/", 37 ] 38 39 deps = [ 40 "$dsoftbus_dfx_path/log:softbus_dfx_log", 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 ] 60 sources += test_utils_src 61 62 include_dirs = [ 63 "$softbus_adapter_common/include", 64 "$dsoftbus_core_path/common/include", 65 "$dsoftbus_core_path/common/dfx/hisysevent_adapter/include", 66 "$dsoftbus_core_path/common/dfx/hidumper_adapter/include", 67 "$dsoftbus_core_path/discovery/interface", 68 "$dsoftbus_core_path/discovery/ipc/include", 69 "$dsoftbus_core_path/discovery/manager/include", 70 "$dsoftbus_core_path/discovery/ble/dispatcher/include", 71 "$dsoftbus_core_path/discovery/coap/interface", 72 "$dsoftbus_root_path/interfaces/kits/common", 73 "$dsoftbus_root_path/interfaces/kits/discovery", 74 ] 75 include_dirs += test_utils_inc 76 77 deps = [ 78 "$dsoftbus_root_path/adapter:softbus_adapter", 79 "$dsoftbus_root_path/core/common:softbus_utils", 80 ] 81 external_deps = [ 82 "googletest:gmock", 83 "googletest:gtest_main", 84 "hilog:libhilog", 85 ] 86} 87 88group("unittest") { 89 testonly = true 90 deps = [ 91 ":DiscManagerMockTest", 92 ":DiscManagerTest", 93 ] 94} 95