1# Copyright (c) 2021-2023 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/test.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17ohos_unittest("net_conn_manager_test") { 18 module_out_path = "netmanager_base/net_conn_manager_test" 19 sanitize = { 20 cfi = true 21 cfi_cross_dso = true 22 debug = false 23 } 24 sources = [ 25 "inet_addr_test.cpp", 26 "net_activate_test.cpp", 27 "net_all_capabilities_test.cpp", 28 "net_caps_test.cpp", 29 "net_common_event_test.cpp", 30 "net_conn_callback_stub_test.cpp", 31 "net_conn_callback_test.cpp", 32 "net_conn_client_test.cpp", 33 "net_conn_event_handler_test.cpp", 34 "net_conn_hievent_test.cpp", 35 "net_conn_manager_test.cpp", 36 "net_conn_service_iface_test.cpp", 37 "net_conn_service_proxy_test.cpp", 38 "net_conn_service_test.cpp", 39 "net_datashare_utils_test.cpp", 40 "net_detection_callback_stub_test.cpp", 41 "net_detection_callback_test.cpp", 42 "net_handle_test.cpp", 43 "net_interface_callback_stub_test.cpp", 44 "net_link_info_test.cpp", 45 "net_monitor_test.cpp", 46 "net_score_test.cpp", 47 "net_specifier_test.cpp", 48 "net_supplier_callback_base_test.cpp", 49 "net_supplier_callback_stub_test.cpp", 50 "net_supplier_info_test.cpp", 51 "network_test.cpp", 52 "route_test.cpp", 53 ] 54 55 include_dirs = [ 56 "$INNERKITS_ROOT/include", 57 "$INNERKITS_ROOT/netconnclient/include", 58 "$INNERKITS_ROOT/netconnclient/include/proxy", 59 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 60 "$NETCONNMANAGER_SOURCE_DIR/include", 61 "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", 62 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 63 "$NETMANAGERNATIVE_ROOT/common/include", 64 "$NETMANAGER_BASE_ROOT/services/common/include", 65 "$NETSYSCONTROLLER_ROOT_DIR/include", 66 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 67 "$INNERKITS_ROOT/netmanagernative/include", 68 ] 69 70 deps = [ 71 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 72 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 73 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 74 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 75 ] 76 77 external_deps = [ 78 "ability_base:want", 79 "ability_base:zuri", 80 "ability_runtime:ability_manager", 81 "access_token:libaccesstoken_sdk", 82 "access_token:libnativetoken", 83 "access_token:libtoken_setproc", 84 "common_event_service:cesfwk_core", 85 "common_event_service:cesfwk_innerkits", 86 "data_share:datashare_common", 87 "data_share:datashare_consumer", 88 "eventhandler:libeventhandler", 89 "hisysevent:libhisysevent", 90 "ipc:ipc_core", 91 "safwk:system_ability_fwk", 92 "samgr:samgr_proxy", 93 ] 94 95 defines = [ 96 "NETMGR_LOG_TAG = \"NetConnManager\"", 97 "LOG_DOMAIN = 0xD0015B0", 98 ] 99 100 if (enable_netmgr_debug) { 101 defines += [ "NETMGR_DEBUG" ] 102 } 103 104 external_deps += [ "hilog:libhilog" ] 105 106 if (enable_sys_func) { 107 defines += [ "SYS_FUNC" ] 108 } 109 110 part_name = "netmanager_base" 111 subsystem_name = "communication" 112} 113