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 "//commonlibrary/c_utils/base/include", 36 "unittest/common/", 37 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface", 38 ] 39 40 deps = [ 41 "$dsoftbus_dfx_path/log:softbus_dfx_log", 42 "$dsoftbus_root_path/components/nstackx/nstackx_ctrl:nstackx_ctrl", 43 "$dsoftbus_root_path/core/frame:softbus_server", 44 "//third_party/googletest:gtest_main", 45 ] 46 47 if (is_standard_system) { 48 external_deps = [ 49 "c_utils:utils", 50 "hilog:libhilog", 51 ] 52 } else { 53 external_deps = [ 54 "c_utils:utils", 55 "hilog:libhilog", 56 ] 57 } 58} 59 60ohos_unittest("DiscManagerMockTest") { 61 module_out_path = module_output_path 62 sources = [ 63 "$dsoftbus_core_path/discovery/manager/src/disc_manager.c", 64 "ble_mock.cpp", 65 "coap_mock.cpp", 66 "disc_manager_mock_test.cpp", 67 ] 68 sources += test_utils_src 69 70 include_dirs = [ 71 "$dsoftbus_root_path/interfaces/kits/common", 72 "$dsoftbus_root_path/interfaces/kits/discovery", 73 "$dsoftbus_core_path/common/include", 74 "$dsoftbus_core_path/common/dfx/hisysevent_adapter/include", 75 "$dsoftbus_core_path/common/dfx/hidumper_adapter/include", 76 "$softbus_adapter_common/include", 77 "$dsoftbus_core_path/discovery/interface", 78 "$dsoftbus_core_path/discovery/ipc/include", 79 "$dsoftbus_core_path/discovery/manager/include", 80 "$dsoftbus_core_path/discovery/ble/dispatcher/include", 81 "$dsoftbus_core_path/discovery/coap/interface", 82 ] 83 include_dirs += test_utils_inc 84 85 deps = [ 86 "$dsoftbus_root_path/adapter:softbus_adapter", 87 "$dsoftbus_root_path/core/common:softbus_utils", 88 "//third_party/googletest:gmock", 89 "//third_party/googletest:gtest_main", 90 ] 91} 92 93group("unittest") { 94 testonly = true 95 deps = [ 96 ":DiscManagerMockTest", 97 ":DiscManagerTest", 98 ] 99} 100