1# Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 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("../../../base/config.gni") 16 17module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" 18config("module_private_config") { 19 visibility = [ ":*" ] 20 if (current_toolchain != host_toolchain) { 21 defines = [ 22 "HAVE_HILOG", 23 "NETWORK_PLUGIN_UNITTEST", 24 ] 25 } 26} 27 28ohos_unittest("networkplugin_ut") { 29 module_out_path = module_output_path 30 sources = [ "unittest/network_plugin_test.cpp" ] 31 deps = [ 32 "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base", 33 "${OHOS_PROFILER_DIR}/device/plugins/network_plugin:networkplugin_source", 34 "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_data_cpp", 35 ] 36 include_dirs = [ 37 "../include", 38 "../../api/include", 39 "${OHOS_PROFILER_DIR}/interfaces/kits", 40 "${OHOS_PROFILER_DIR}/device/base/include", 41 ] 42 cflags = [ 43 "-Wno-inconsistent-missing-override", 44 "-Dprivate=public", #allow test code access private members 45 "-Dprotected=public", #allow test code access private members 46 ] 47 48 external_deps = [ 49 "bounds_checking_function:libsec_shared", 50 "c_utils:utils", 51 "googletest:gtest", 52 "hilog:libhilog_base", 53 "ipc:ipc_core", 54 "netmanager_base:net_stats_manager_if", 55 "protobuf:protobuf_lite", 56 ] 57 configs = [ ":module_private_config" ] 58 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 59 resource_config_file = "${OHOS_PROFILER_DIR}/device/ohos_test.xml" 60} 61 62group("unittest") { 63 testonly = true 64 deps = [ ":networkplugin_ut" ] 65} 66