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