# Copyright (c) 2022-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("//foundation/communication/netmanager_ext/netmanager_ext_config.gni") EXT_SECURITY_PATH = "../../.." ohos_unittest("networkshare_manager_test") { sanitize = { cfi = true cfi_cross_dso = true blocklist = "./cfi_blocklist.txt" debug = false } branch_protector_ret = "pac_ret" module_out_path = "netmanager_ext/networkshare_manager_test" sources = [ "$EXT_SECURITY_PATH/security/netmanager_ext_test_security.cpp", "interface_configuration_test.cpp", "netshare_result_callback_proxy_test.cpp", "netshare_result_callback_stub_test.cpp", "networkshare_hisysevent_test.cpp", "networkshare_main_statemachine_test.cpp", "networkshare_request_parcel_test.cpp", "networkshare_service_stub_test.cpp", "networkshare_service_test.cpp", "networkshare_upstreammonitor_test.cpp", "sharing_event_callback_proxy_test.cpp", "sharing_event_callback_stub_test.cpp", "static_configuration_test.cpp", ] include_dirs = [ "$BASE_INNERKITS_ROOT/netconnclient/include/proxy", "$NETMANAGER_BASE_ROOT/utils/errorcode_utils/include", "$BLUETOOTH_ROOT/interfaces/inner_api/include", "$EXT_INNERKITS_ROOT/ethernetclient/include", "$EXT_INNERKITS_ROOT/include", "$EXT_INNERKITS_ROOT/netshareclient/include", "$EXT_INNERKITS_ROOT/netshareclient/include/proxy", "$EXT_INNERKITS_ROOT/netshareclient/include/proxy/ipccallback", "$EXT_SECURITY_PATH/security", "$NETMANAGER_EXT_ROOT/services/networksharemanager/include", "$NETMANAGER_EXT_ROOT/services/networksharemanager/include/stub", "$NETMANAGER_EXT_ROOT/test/netmanager_ext_mock_test", "$NETSYSCONTROLLER_ROOT_DIR/include", "$THIRD_PARTY_ROOT/openssl/include", "$USB_MANAGER_ROOT/utils/native/include", "$USB_MANAGER_ROOT/services/zidl/include", ] defines = [] if (communication_wifi_switch_enable) { defines += [ "WIFI_MODOULE" ] include_dirs += [ "$WIFI_MANAGER_ROOT/interfaces/kits/c", "$WIFI_MANAGER_ROOT/frameworks/native/interfaces", ] } if (communication_bluetooth_switch_enable) { defines += [ "BLUETOOTH_MODOULE" ] } deps = [ "$EXT_INNERKITS_ROOT/ethernetclient:ethernet_parcel", "$EXT_INNERKITS_ROOT/netshareclient:net_tether_manager_if", "$NETMANAGER_EXT_ROOT/services/networksharemanager:net_tether_manager_static", "$NETMANAGER_EXT_ROOT/utils:net_event_report", "$NETMANAGER_EXT_ROOT/utils:net_manager_ext_common", "$THIRD_PARTY_ROOT/googletest:gmock_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "dhcp:dhcp_sdk", "eventhandler:libeventhandler", "ffrt:libffrt", "ipc:ipc_core", ] if (communication_wifi_switch_enable) { defines += [ "WIFI_MODOULE" ] external_deps += [ "wifi:wifi_sdk" ] } if (usb_manager_enable) { defines += [ "USB_MODOULE" ] external_deps += [ "drivers_interface_usb:usb_idl_headers", "usb_manager:usbsrv_client", ] } defines += [ "NETMGR_LOG_TAG = \"NetworkShareManager\"", "LOG_DOMAIN = 0xD0015B0", ] if (enable_netmgr_ext_debug) { defines += [ "NETMGR_DEBUG" ] } external_deps += [ "hilog:libhilog" ] part_name = "netmanager_ext" subsystem_name = "communication" }