• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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_ext/netmanager_ext_config.gni")
16
17EXT_SECURITY_PATH = "../../.."
18
19ohos_unittest("networkshare_manager_test") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    blocklist = "./cfi_blocklist.txt"
24    debug = false
25  }
26
27  branch_protector_ret = "pac_ret"
28
29  module_out_path = "netmanager_base/netmanager_base/networkshare_manager_test"
30
31  sources = [
32    "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp",
33    "interface_configuration_test.cpp",
34    "netshare_result_callback_proxy_test.cpp",
35    "netshare_result_callback_stub_test.cpp",
36    "networkshare_hisysevent_test.cpp",
37    "networkshare_main_statemachine_test.cpp",
38    "networkshare_request_parcel_test.cpp",
39    "networkshare_service_stub_test.cpp",
40    "networkshare_service_test.cpp",
41    "networkshare_upstreammonitor_test.cpp",
42    "sharing_event_callback_proxy_test.cpp",
43    "sharing_event_callback_stub_test.cpp",
44    "static_configuration_test.cpp",
45  ]
46
47  include_dirs = [
48    "$BASE_INNERKITS_ROOT/netconnclient/include/proxy",
49    "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include",
50    "$BLUETOOTH_ROOT/interfaces/inner_api/include",
51    "$EXT_INNERKITS_ROOT/ethernetclient/include",
52    "$EXT_INNERKITS_ROOT/include",
53    "$EXT_INNERKITS_ROOT/netshareclient/include",
54    "$EXT_INNERKITS_ROOT/netshareclient/include/proxy",
55    "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback",
56    "$EXT_SECURITY_PATH/security",
57    "$NETMANAGER_EXT_ROOT/services/networksharemanager/include",
58    "$NETMANAGER_EXT_ROOT/services/networksharemanager/include/stub",
59    "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test",
60    "$NETSYSCONTROLLER_ROOT_DIR/include",
61    "$USB_MANAGER_ROOT/utils/native/include",
62    "$USB_MANAGER_ROOT/services/zidl/include",
63  ]
64
65  defines = []
66  if (communication_wifi_switch_enable) {
67    defines += [ "WIFI_MODOULE" ]
68  }
69  if (communication_bluetooth_switch_enable) {
70    defines += [ "BLUETOOTH_MODOULE" ]
71  }
72
73  deps = [
74    "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel",
75    "$EXT_INNERKITS_ROOT/netshareclient:net_tether_manager_if",
76    "$NETMANAGER_EXT_ROOT/services/networksharemanager:net_tether_manager_static",
77    "$NETMANAGER_EXT_ROOT/utils:net_event_report",
78    "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common",
79    "googletest:gmock_main",
80  ]
81
82  external_deps = [
83    "access_token:libaccesstoken_sdk",
84    "access_token:libnativetoken",
85    "access_token:libtoken_setproc",
86    "dhcp:dhcp_sdk",
87    "eventhandler:libeventhandler",
88    "ffrt:libffrt",
89    "ipc:ipc_core",
90  ]
91
92  if (communication_wifi_switch_enable) {
93    defines += [ "WIFI_MODOULE" ]
94  }
95
96  if (usb_manager_enable) {
97    defines += [ "USB_MODOULE" ]
98    external_deps += [
99      "drivers_interface_usb:usb_idl_headers",
100      "usb_manager:usbsrv_client",
101    ]
102  }
103
104  defines += [
105    "NETMGR_LOG_TAG = \"NetworkShareManager\"",
106    "LOG_DOMAIN = 0xD0015B0",
107  ]
108
109  if (enable_netmgr_ext_debug) {
110    defines += [ "NETMGR_DEBUG" ]
111  }
112
113  external_deps += [ "hilog:libhilog" ]
114
115  part_name = "netmanager_ext"
116  subsystem_name = "communication"
117}
118