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/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 "dns_result_call_back_test.cpp", 30 "inet_addr_test.cpp", 31 "net_activate_test.cpp", 32 "net_all_capabilities_test.cpp", 33 "net_caps_test.cpp", 34 "net_common_event_test.cpp", 35 "net_conn_callback_stub_test.cpp", 36 "net_conn_callback_test.cpp", 37 "net_conn_client_test.cpp", 38 "net_conn_event_handler_test.cpp", 39 "net_conn_hievent_test.cpp", 40 "net_conn_service_iface_test.cpp", 41 "net_conn_service_proxy_test.cpp", 42 "net_conn_service_stub_test.cpp", 43 "net_datashare_utils_test.cpp", 44 "net_detection_callback_stub_test.cpp", 45 "net_detection_callback_test.cpp", 46 "net_factoryreset_callback_stub_test.cpp", 47 "net_factoryreset_callback_test.cpp", 48 "net_handle_test.cpp", 49 "net_http_probe_test.cpp", 50 "net_interface_callback_stub_test.cpp", 51 "net_link_info_test.cpp", 52 "net_monitor_test.cpp", 53 "net_proxy_from_string_test.cpp", 54 "net_proxy_userinfo_test.cpp", 55 "net_score_test.cpp", 56 "net_specifier_test.cpp", 57 "net_supplier_callback_base_test.cpp", 58 "net_supplier_callback_stub_test.cpp", 59 "net_supplier_info_test.cpp", 60 "net_supplier_test.cpp", 61 "network_security_config_test.cpp", 62 "network_test.cpp", 63 "route_test.cpp", 64 ] 65 66 include_dirs = [ 67 "$INNERKITS_ROOT/include", 68 "$INNERKITS_ROOT/netconnclient/include", 69 "$INNERKITS_ROOT/netconnclient/include/proxy", 70 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 71 "$NETCONNMANAGER_SOURCE_DIR/include", 72 "$SAMGR_MANAGER_ROOT/interfaces/innerkits/samgr_proxy/include", 73 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 74 "$NETMANAGERNATIVE_ROOT/common/include", 75 "$NETMANAGER_BASE_ROOT/services/common/include", 76 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 77 "$NETMANAGER_BASE_ROOT/test/security", 78 "$NETSYSCONTROLLER_ROOT_DIR/include", 79 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 80 "$INNERKITS_ROOT/netmanagernative/include", 81 "$THIRD_PARTY_ROOT/curl/include", 82 "$THIRD_PARTY_ROOT/openssl/include", 83 ] 84 85 deps = [ 86 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 87 "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", 88 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 89 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 90 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 91 "$THIRD_PARTY_ROOT/openssl:libcrypto_shared", 92 "$THIRD_PARTY_ROOT/openssl:libssl_shared", 93 ] 94 95 external_deps = [ 96 "ability_base:want", 97 "ability_base:zuri", 98 "ability_runtime:ability_manager", 99 "access_token:libaccesstoken_sdk", 100 "access_token:libnativetoken", 101 "access_token:libtoken_setproc", 102 "bundle_framework:appexecfwk_base", 103 "bundle_framework:appexecfwk_core", 104 "cJSON:cjson", 105 "common_event_service:cesfwk_core", 106 "common_event_service:cesfwk_innerkits", 107 "data_share:datashare_common", 108 "data_share:datashare_consumer", 109 "eventhandler:libeventhandler", 110 "ffrt:libffrt", 111 "hisysevent:libhisysevent", 112 "ipc:ipc_core", 113 "os_account:os_account_innerkits", 114 "relational_store:native_rdb", 115 "safwk:system_ability_fwk", 116 "samgr:samgr_proxy", 117 ] 118 119 defines = [ 120 "NETMGR_LOG_TAG = \"NetConnManager\"", 121 "LOG_DOMAIN = 0xD0015B0", 122 ] 123 124 if (enable_netmgr_debug) { 125 defines += [ "NETMGR_DEBUG" ] 126 } 127 128 external_deps += [ "hilog:libhilog" ] 129 130 if (enable_sys_func) { 131 defines += [ "SYS_FUNC" ] 132 } 133 134 part_name = "netmanager_base" 135 subsystem_name = "communication" 136} 137