1# Copyright (c) 2021-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/test.gni") 15import("//foundation/communication/netmanager_base/netmanager_base_config.gni") 16 17ohos_unittest("net_conn_manager_test") { 18 module_out_path = "netmanager_base/netmanager_base/net_conn_manager_test" 19 sanitize = { 20 cfi = true 21 cfi_cross_dso = true 22 debug = false 23 } 24 25 branch_protector_ret = "pac_ret" 26 use_exceptions = true 27 sources = [ 28 "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp", 29 "net_common_event_test.cpp", 30 "net_conn_callback_stub_test.cpp", 31 "net_conn_callback_test.cpp", 32 "net_conn_manager_test.cpp", 33 "net_conn_service_test.cpp", 34 "net_conn_service_xtra_test.cpp", 35 "net_detection_callback_stub_test.cpp", 36 "net_detection_callback_test.cpp", 37 "network_test.cpp", 38 ] 39 40 include_dirs = [ 41 "$INNERKITS_ROOT/include", 42 "$INNERKITS_ROOT/netconnclient/include", 43 "$INNERKITS_ROOT/netconnclient/include/proxy", 44 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 45 "$NETCONNMANAGER_SOURCE_DIR/include", 46 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 47 "$NETMANAGERNATIVE_ROOT/common/include", 48 "$NETPOLICYMANAGER_SOURCE_DIR/include", 49 "$NETPOLICYMANAGER_SOURCE_DIR/include/stub", 50 "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient/include", 51 "$NETMANAGER_BASE_ROOT/services/common/include", 52 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 53 "$NETMANAGER_BASE_ROOT/test/security", 54 "$NETSYSCONTROLLER_ROOT_DIR/include", 55 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 56 "$INNERKITS_ROOT/netmanagernative/include", 57 ] 58 59 deps = [ 60 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 61 "$INNERKITS_ROOT/netmanagernative:net_native_manager_if", 62 "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", 63 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 64 "$NETMANAGER_BASE_ROOT/interfaces/kits/c/netconnclient:net_connection", 65 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 66 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 67 ] 68 69 external_deps = [ 70 "ability_base:want", 71 "ability_base:zuri", 72 "ability_runtime:ability_manager", 73 "access_token:libaccesstoken_sdk", 74 "access_token:libnativetoken", 75 "access_token:libtoken_setproc", 76 "bundle_framework:appexecfwk_base", 77 "bundle_framework:appexecfwk_core", 78 "cJSON:cjson", 79 "common_event_service:cesfwk_core", 80 "common_event_service:cesfwk_innerkits", 81 "data_share:datashare_common", 82 "data_share:datashare_consumer", 83 "eventhandler:libeventhandler", 84 "ffrt:libffrt", 85 "hisysevent:libhisysevent", 86 "hitrace:hitrace_meter", 87 "ipc:ipc_core", 88 "openssl:libcrypto_shared", 89 "openssl:libssl_shared", 90 "os_account:os_account_innerkits", 91 "relational_store:native_rdb", 92 "safwk:system_ability_fwk", 93 "samgr:samgr_proxy", 94 "curl:curl_shared", 95 ] 96 97 defines = [ 98 "NETMGR_LOG_TAG = \"NetConnManager\"", 99 "LOG_DOMAIN = 0xD0015B0", 100 ] 101 102 if(netmanager_base_enable_pac_proxy){ 103 defines += [ "NETMANAGER_ENABLE_PAC_PROXY" ] 104 } 105 106 if (enable_netmgr_debug) { 107 defines += [ "NETMGR_DEBUG" ] 108 } 109 110 if (netmanager_base_enable_feature_sysvpn) { 111 defines += [ "SUPPORT_SYSVPN" ] 112 } 113 114 external_deps += [ "hilog:libhilog" ] 115 116 if (enable_sys_func) { 117 defines += [ "SYS_FUNC" ] 118 } 119 120 part_name = "netmanager_base" 121 subsystem_name = "communication" 122} 123