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