1# Copyright (c) 2024 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 19dsoftbus_root_path = "../../.." 20module_output_path = "dsoftbus/adapter" 21 22test_deps = [ 23 "$dsoftbus_dfx_path:softbus_dfx", 24 "$dsoftbus_root_path/core/common:softbus_utils", 25] 26 27test_external_deps = [ 28 "c_utils:utils", 29 "googletest:gmock_main", 30 "googletest:gtest_main", 31 "hilog:libhilog", 32 "json:nlohmann_json_static", 33] 34 35ohos_unittest("LnnWifiServiceMonitorTest") { 36 module_out_path = module_output_path 37 sources = [ "$dsoftbus_root_path/tests/adapter/common/src/lnn_wifiservice_monitor_test.cpp" ] 38 39 include_dirs = [ 40 "$dsoftbus_root_path/adapter/common/include", 41 "$dsoftbus_root_path/core/common/include", 42 "$dsoftbus_root_path/adapter/common/net/wifi/include", 43 "$dsoftbus_root_path/adapter/common/bus_center/include", 44 "$dsoftbus_root_path/interfaces/kits/common", 45 "$dsoftbus_root_path/core/bus_center/service/include", 46 "$dsoftbus_root_path/interfaces/kits/bus_center", 47 "$dsoftbus_root_path/core/bus_center/interface", 48 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 49 "$dsoftbus_root_path/sdk/frame/standard/include", 50 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 51 "$dsoftbus_root_path/core/transmission/interface", 52 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 53 "$dsoftbus_root_path/core/common/include", 54 "$dsoftbus_root_path/adapter/common/bus_center/wlan", 55 "$dsoftbus_root_path/tests/adapter/common/src", 56 "$dsoftbus_root_path/tests/adapter/common/include", 57 "$dsoftbus_root_path/core/bus_center/utils/include", 58 ] 59 60 deps = test_deps 61 external_deps = test_external_deps 62 if (!defined(ohos_lite) && softbus_communication_wifi_feature == true) { 63 external_deps += [ 64 "ability_base:base", 65 "ability_base:want", 66 "common_event_service:cesfwk_innerkits", 67 "ipc:ipc_core", 68 "wifi:wifi_sdk", 69 ] 70 } 71} 72 73ohos_unittest("LnnLinkWatchTest") { 74 module_out_path = module_output_path 75 sources = [ 76 "$dsoftbus_root_path/adapter/common/bus_center/network/lnn_linkwatch.c", 77 "$dsoftbus_root_path/tests/adapter/common/src/lnn_linkwatch_test.cpp", 78 ] 79 80 include_dirs = [ 81 "$dsoftbus_root_path/adapter/common/include", 82 "$dsoftbus_root_path/core/common/include", 83 "$dsoftbus_root_path/adapter/common/net/wifi/include", 84 "$dsoftbus_root_path/adapter/common/bus_center/include", 85 "$dsoftbus_root_path/interfaces/kits/common", 86 "$dsoftbus_root_path/core/bus_center/service/include", 87 "$dsoftbus_root_path/interfaces/kits/bus_center", 88 "$dsoftbus_root_path/core/bus_center/interface", 89 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 90 "$dsoftbus_root_path/sdk/frame/standard/include", 91 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 92 "$dsoftbus_root_path/core/transmission/interface", 93 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 94 "$dsoftbus_root_path/core/common/include", 95 "$dsoftbus_root_path/adapter/common/bus_center/wlan", 96 "$dsoftbus_root_path/tests/adapter/common/src", 97 "$dsoftbus_root_path/tests/adapter/common/include", 98 "$dsoftbus_root_path/core/bus_center/utils/include", 99 "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dnet/code/interface", 100 "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dnet/code/include", 101 ] 102 103 deps = [ 104 "$dsoftbus_dfx_path:softbus_dfx", 105 "$dsoftbus_root_path/adapter:softbus_adapter", 106 "$dsoftbus_root_path/core/common:softbus_utils", 107 ] 108 external_deps = [ 109 "c_utils:utils", 110 "googletest:gmock", 111 "googletest:gtest_main", 112 "hilog:libhilog", 113 "ipc:ipc_core", 114 "ipc:ipc_single", 115 "samgr:samgr_proxy", 116 ] 117 if (dsoftbus_feature_deps_ability_base) { 118 external_deps += [ 119 "ability_base:base", 120 "ability_base:want", 121 ] 122 } 123} 124 125group("unittest") { 126 testonly = true 127 if (!defined(ohos_lite) && softbus_communication_wifi_feature == true) { 128 deps = [ 129 ":LnnLinkWatchTest", 130 ":LnnWifiServiceMonitorTest", 131 ] 132 } 133} 134