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 22ohos_unittest("plugin_service_ut") { 23 module_out_path = module_output_path 24 sources = [ "unittest/plugin_service_test.cpp" ] 25 public_deps = [ 26 "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", 27 "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source", 28 "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto", 29 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source", 30 ] 31 deps = [ "../../../base:hiprofiler_base" ] 32 include_dirs = [ "../src" ] 33 cflags = [ 34 "-Wno-inconsistent-missing-override", 35 "-Dprivate=public", #allow test code access private members 36 "-Dprotected=public", #allow test code access private members 37 ] 38 external_deps = [ 39 "abseil-cpp:absl_sync", 40 "bounds_checking_function:libsec_shared", 41 "googletest:gtest", 42 "hilog:libhilog_base", 43 "openssl:libcrypto_shared", 44 "protobuf:protobuf_lite", 45 ] 46 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 47} 48 49ohos_unittest("plugin_service_module_test") { 50 module_out_path = module_output_path 51 sources = [ "moduletest/plugin_service_test.cpp" ] 52 public_deps = [ 53 "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", 54 "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source", 55 "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto", 56 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source", 57 ] 58 59 cflags = [ 60 "-Wno-inconsistent-missing-override", 61 "-Dprivate=public", #allow test code access private members 62 "-Dprotected=public", #allow test code access private members 63 ] 64 external_deps = [ 65 "abseil-cpp:absl_sync", 66 "googletest:gtest", 67 "hilog:libhilog_base", 68 "protobuf:protobuf_lite", 69 ] 70 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 71} 72 73group("unittest") { 74 testonly = true 75 deps = [ 76 ":plugin_service_module_test", 77 ":plugin_service_ut", 78 ] 79} 80