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_service_test") { 18 module_out_path = "netmanager_base/netmanager_base/net_conn_service_test" 19 20 sources = [ 21 "$NETMANAGER_BASE_ROOT/test/security/netmanager_base_test_security.cpp", 22 "net_conn_service_iface_test.cpp", 23 "net_conn_service_proxy_test.cpp", 24 "net_conn_service_stub_test.cpp", 25 "net_supplier_callback_proxy_test.cpp", 26 ] 27 28 include_dirs = [ 29 "$INNERKITS_ROOT/include", 30 "$INNERKITS_ROOT/netconnclient/include", 31 "$INNERKITS_ROOT/netconnclient/include/proxy", 32 "$NETCONNMANAGER_SOURCE_DIR/include/stub", 33 "$NETCONNMANAGER_SOURCE_DIR/include", 34 "$NETMANAGERNATIVE_ROOT/net_mgr_native/include", 35 "$NETMANAGERNATIVE_ROOT/common/include", 36 "$NETMANAGER_BASE_ROOT/services/common/include", 37 "$NETMANAGER_BASE_ROOT/test/commonduplicatedcode", 38 "$NETMANAGER_BASE_ROOT/test/security", 39 "$NETSYSCONTROLLER_ROOT_DIR/include", 40 "$NETSYSNATIVE_SOURCE_DIR/include/netsys", 41 "$INNERKITS_ROOT/netmanagernative/include", 42 ] 43 44 deps = [ 45 "$INNERKITS_ROOT/netconnclient:net_conn_manager_if", 46 "$INNERKITS_ROOT/netconnclient:net_conn_parcel", 47 "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if", 48 "$NETCONNMANAGER_SOURCE_DIR:net_conn_manager_static", 49 "$NETMANAGER_BASE_ROOT/utils:net_manager_common", 50 "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller", 51 ] 52 53 external_deps = [ 54 "ability_base:want", 55 "ability_base:zuri", 56 "ability_runtime:ability_manager", 57 "access_token:libaccesstoken_sdk", 58 "access_token:libnativetoken", 59 "access_token:libtoken_setproc", 60 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "cJSON:cjson", 63 "common_event_service:cesfwk_core", 64 "common_event_service:cesfwk_innerkits", 65 "curl:curl_shared", 66 "data_share:datashare_common", 67 "data_share:datashare_consumer", 68 "eventhandler:libeventhandler", 69 "ffrt:libffrt", 70 "hisysevent:libhisysevent", 71 "ipc:ipc_core", 72 "openssl:libcrypto_shared", 73 "openssl:libssl_shared", 74 "os_account:os_account_innerkits", 75 "relational_store:native_rdb", 76 "safwk:system_ability_fwk", 77 "samgr:samgr_proxy", 78 ] 79 80 if (enable_netmgr_debug) { 81 external_deps += [ "googletest:gmock_main" ] 82 } 83 84 defines = [ 85 "NETMGR_LOG_TAG = \"NetConnManager\"", 86 "LOG_DOMAIN = 0xD0015B0", 87 ] 88 89 if (enable_netmgr_debug) { 90 defines += [ "NETMGR_DEBUG" ] 91 } 92 93 external_deps += [ "hilog:libhilog" ] 94 95 if (enable_sys_func) { 96 defines += [ "SYS_FUNC" ] 97 } 98 99 configs = [ 100 "$NETMANAGER_BASE_ROOT/test/netconnmanager/mock:UNITTEST_MOCK", 101 ] 102 103 part_name = "netmanager_base" 104 subsystem_name = "communication" 105} 106