# Copyright (C) 2021-2022 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/dhcp/dhcp.gni") ################################################################################ module_output_path = "dhcp/dhcp_manage_test" even_path = "//base/notification/common_event_service" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//commonlibrary/c_utils/base/include", "$DHCP_ROOT_DIR/services/mgr_service/include", ] } ohos_unittest("dhcp_manage_unittest") { module_out_path = module_output_path sources = [ "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_client_service_impl.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_event_subscriber.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_func.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_ipv6_client.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_ipv6_event.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_server_service.cpp", "$DHCP_ROOT_DIR/services/mgr_service/src/dhcp_service.cpp", "dhcp_client_service_test.cpp", "dhcp_func_test.cpp", "dhcp_result_notify.cpp", "dhcp_server_service_test.cpp", "dhcp_service_test.cpp", "mock_system_func.cpp", ] include_dirs = [ "//third_party/googletest/googlemock/include", "$DHCP_ROOT_DIR/services/mgr_service/test", "$DHCP_ROOT_DIR/services/mgr_service/include", "$DHCP_ROOT_DIR/interfaces/inner_api/include", "$DHCP_ROOT_DIR/interfaces/inner_api/interfaces", "$WIFI_ROOT_DIR/services/wifi_standard/wifi_framework/wifi_toolkit/log", "//commonlibrary/c_utils/base/include", "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", "${even_path}/cesfwk/kits/native/include", "${even_path}/cesfwk/innerkits/include", "//base/notification/common_event_service/frameworks/core/include", ] deps = [ "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] ldflags = [ "-fPIC", "-Wl,-E", "--coverage", "-Wl,-rpath=/vendor/lib64/hw", "-Wl,--wrap=open", "-Wl,--wrap=close", "-Wl,--wrap=write", "-Wl,--wrap=read", "-Wl,--wrap=socket", "-Wl,--wrap=setsockopt", "-Wl,--wrap=ioctl", "-Wl,--wrap=bind", "-Wl,--wrap=listen", "-Wl,--wrap=connect", "-Wl,--wrap=select", "-Wl,--wrap=sendto", "-Wl,--wrap=vfork", "-Wl,--wrap=execv", "-Wl,--wrap=_exit", "-Wl,--wrap=waitpid", "-Wl,--wrap=kill", ] external_deps = [ "ability_base:want", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", ] configs = [ ":module_private_config" ] part_name = "dhcp" subsystem_name = "communication" } group("unittest") { testonly = true deps = [ ":dhcp_manage_unittest" ] }