# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/lite/config/component/lite_component.gni") import("//build/ohos.gni") import("//build/test.gni") import("../../../../../core/common/dfx/dsoftbus_dfx.gni") import("../../../../../dsoftbus.gni") import("../../../../utils/utils.gni") module_output_path = "dsoftbus/discovery" ohos_unittest("DiscManagerTest") { module_out_path = module_output_path sources = [ "disc_manager_test.cpp" ] include_dirs = [ "$softbus_adapter_common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/interfaces/kits/common", "$dsoftbus_root_path/interfaces/kits/discovery", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/discovery/coap/interface", "$dsoftbus_root_path/components/nstackx/nstackx_ctrl/interface", "unittest/common/", ] deps = [ "$dsoftbus_dfx_path/log:softbus_dfx_log", "$dsoftbus_root_path/components/nstackx/nstackx_ctrl:nstackx_ctrl", "$dsoftbus_root_path/core/frame:softbus_server", ] external_deps = [ "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", ] } ohos_unittest("DiscManagerMockTest") { module_out_path = module_output_path sources = [ "$dsoftbus_core_path/discovery/manager/src/disc_manager.c", "ble_mock.cpp", "coap_mock.cpp", "disc_manager_mock_test.cpp", ] sources += test_utils_src include_dirs = [ "$softbus_adapter_common/include", "$dsoftbus_core_path/common/include", "$dsoftbus_core_path/common/dfx/hisysevent_adapter/include", "$dsoftbus_core_path/common/dfx/hidumper_adapter/include", "$dsoftbus_core_path/discovery/interface", "$dsoftbus_core_path/discovery/ipc/include", "$dsoftbus_core_path/discovery/manager/include", "$dsoftbus_core_path/discovery/ble/dispatcher/include", "$dsoftbus_core_path/discovery/coap/interface", "$dsoftbus_root_path/interfaces/kits/common", "$dsoftbus_root_path/interfaces/kits/discovery", ] include_dirs += test_utils_inc deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", ] external_deps = [ "googletest:gmock", "googletest:gtest_main", "hilog:libhilog", ] } group("unittest") { testonly = true deps = [ ":DiscManagerMockTest", ":DiscManagerTest", ] }