1# Copyright (C) 2021-2022 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/wifi/dhcp/dhcp.gni") 16 17################################################################################ 18 19module_output_path = "dhcp/dhcp_manage_test" 20even_path = "//base/notification/common_event_service" 21 22config("module_private_config") { 23 visibility = [ ":*" ] 24 include_dirs = [ 25 "//commonlibrary/c_utils/base/include", 26 "$DHCP_ROOT_DIR/services/mgr_service/include", 27 ] 28} 29 30ohos_unittest("dhcp_manage_unittest") { 31 module_out_path = module_output_path 32 sources = [ 33 "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_client_service_impl.cpp", 34 "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_event_subscriber.cpp", 35 "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_func.cpp", 36 "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_server_service.cpp", 37 "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_service.cpp", 38 "dhcp_client_service_test.cpp", 39 "dhcp_func_test.cpp", 40 "dhcp_result_notify.cpp", 41 "dhcp_server_service_test.cpp", 42 "dhcp_service_test.cpp", 43 "global_test.cpp", 44 "mock_system_func.cpp", 45 ] 46 47 include_dirs = [ 48 "//third_party/googletest/googlemock/include", 49 "$DHCP_ROOT_DIR/services/mgr_service/test", 50 "$DHCP_ROOT_DIR/services/mgr_service/include", 51 "$DHCP_ROOT_DIR/interfaces/inner_api/include", 52 "$DHCP_ROOT_DIR/interfaces/inner_api/interfaces", 53 "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/log", 54 "//commonlibrary/c_utils/base/include", 55 "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", 56 "${even_path}/cesfwk/kits/native/include", 57 "${even_path}/cesfwk/innerkits/include", 58 "//base/notification/common_event_service/frameworks/core/include", 59 ] 60 61 deps = [ 62 "//third_party/googletest:gmock_main", 63 "//third_party/googletest:gtest_main", 64 ] 65 66 ldflags = [ 67 "-fPIC", 68 "-Wl,-E", 69 "--coverage", 70 "-Wl,-rpath=/vendor/lib64/hw", 71 "-Wl,--wrap=open", 72 "-Wl,--wrap=close", 73 "-Wl,--wrap=write", 74 "-Wl,--wrap=read", 75 "-Wl,--wrap=socket", 76 "-Wl,--wrap=setsockopt", 77 "-Wl,--wrap=ioctl", 78 "-Wl,--wrap=bind", 79 "-Wl,--wrap=listen", 80 "-Wl,--wrap=connect", 81 "-Wl,--wrap=select", 82 "-Wl,--wrap=sendto", 83 "-Wl,--wrap=vfork", 84 "-Wl,--wrap=execv", 85 "-Wl,--wrap=_exit", 86 "-Wl,--wrap=waitpid", 87 "-Wl,--wrap=kill", 88 ] 89 90 external_deps = [ 91 "ability_base:want", 92 "bundle_framework:appexecfwk_base", 93 "c_utils:utils", 94 "common_event_service:cesfwk_innerkits", 95 "eventhandler:libeventhandler", 96 "hiviewdfx_hilog_native:libhilog", 97 ] 98 configs = [ ":module_private_config" ] 99 100 part_name = "dhcp" 101 subsystem_name = "communication" 102} 103 104group("unittest") { 105 testonly = true 106 deps = [ ":dhcp_manage_unittest" ] 107} 108