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_common_test") { 18 sanitize = { 19 cfi = true 20 cfi_cross_dso = true 21 debug = false 22 } 23 24 branch_protector_ret = "pac_ret" 25 26 module_out_path = "netmanager_base/net_common_test" 27 28 include_dirs = [ 29 "$INNERKITS_ROOT/include", 30 "$NETCONNMANAGER_COMMON_DIR/include", 31 "$NETCONNMANAGER_SOURCE_DIR/include", 32 "$INNERKITS_ROOT/netconnclient/include", 33 "$INNERKITS_ROOT/netstatsclient/include", 34 "$NETMANAGER_BASE_ROOT/test/security", 35 "$NETMANAGER_BASE_ROOT/utils/common_utils/include", 36 ] 37 38 sources = [ 39 "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp", 40 "broadcast_manager_test.cpp", 41 "errorcode_convertor_test.cpp", 42 "net_datashare_utils_test.cpp", 43 "net_manager_center_test.cpp", 44 "net_mgr_log_wrapper_test.cpp", 45 "net_setting_test.cpp", 46 "netmanager_base_permission_test.cpp", 47 "netmanager_hitrace_test.cpp", 48 "route_utils_test.cpp", 49 ] 50 51 deps = [ 52 "$INNERKITS_ROOT/netconnclient:net_conn_parcel", 53 "$INNERKITS_ROOT/netstatsclient:net_stats_parcel", 54 "$NETCONNMANAGER_COMMON_DIR:net_service_common", 55 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 56 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 57 ] 58 59 external_deps = [ 60 "access_token:libaccesstoken_sdk", 61 "access_token:libnativetoken", 62 "access_token:libtoken_setproc", 63 "data_share:datashare_common", 64 "data_share:datashare_consumer", 65 "hisysevent:libhisysevent", 66 "hitrace:hitrace_meter", 67 "ipc:ipc_core", 68 "safwk:system_ability_fwk", 69 "samgr:samgr_proxy", 70 ] 71 72 defines = [ 73 "NETMGR_LOG_TAG = \"NetConnManager\"", 74 "LOG_DOMAIN = 0xD0015B0", 75 ] 76 77 if (enable_netmgr_debug) { 78 defines += [ "NETMGR_DEBUG" ] 79 } 80 81 external_deps += [ "hilog:libhilog" ] 82 83 if (enable_sys_func) { 84 defines += [ "SYS_FUNC" ] 85 } 86 87 part_name = "netmanager_base" 88 subsystem_name = "communication" 89} 90