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} 21 22config("cflags_config") { 23 cflags = [ 24 "-Wno-sign-compare", 25 "-pthread", 26 "-Dprivate=public", #allow test code access private members 27 "-Dprotected=public", #allow test code access private members 28 ] 29} 30 31ohos_unittest("hiprofiler_plugins_ut") { 32 module_out_path = module_output_path 33 deps = [ 34 "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", 35 "${OHOS_PROFILER_DIR}/device/services/profiler_service:profiler_service", 36 "../:plugins_sources", 37 ] 38 include_dirs = [ "${OHOS_PROFILER_DIR}/device/base/include" ] 39 sources = [ 40 "unittest/buffer_write_test.cpp", 41 "unittest/command_poller_test.cpp", 42 "unittest/plugin_manager_test.cpp", 43 "unittest/plugin_module_test.cpp", 44 "unittest/writer_adapter_test.cpp", 45 ] 46 if (use_clang_coverage) { 47 defines = [ "COVERAGE_TEST" ] 48 } 49 configs = [ ":cflags_config" ] 50 external_deps = [ 51 "abseil-cpp:absl_cord", 52 "abseil-cpp:absl_log", 53 "abseil-cpp:absl_sync", 54 "bounds_checking_function:libsec_shared", 55 "c_utils:utils", 56 "googletest:gmock", 57 "googletest:gtest", 58 "grpc:gpr", 59 "grpc:grpc", 60 "grpc:grpcxx", 61 "hilog:libhilog_base", 62 "init:libbegetutil", 63 "openssl:libcrypto_shared", 64 "protobuf:protobuf_lite", 65 ] 66 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 67 part_name = "${OHOS_PROFILER_PART_NAME}" 68} 69 70group("unittest") { 71 testonly = true 72 deps = [ ":hiprofiler_plugins_ut" ] 73} 74