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