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 = [ 33 "../src", 34 "//third_party/googletest/googletest/include/gtest", 35 ] 36 cflags = [ 37 "-Wno-inconsistent-missing-override", 38 "-Dprivate=public", #allow test code access private members 39 "-Dprotected=public", #allow test code access private members 40 ] 41 external_deps = [ "hilog:libhilog" ] 42 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 43} 44 45ohos_unittest("plugin_service_module_test") { 46 module_out_path = module_output_path 47 sources = [ "moduletest/plugin_service_test.cpp" ] 48 public_deps = [ 49 "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service", 50 "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source", 51 "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto", 52 "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source", 53 ] 54 deps = [ "//third_party/googletest:gtest" ] 55 include_dirs = [ "//third_party/googletest/googletest/include/gtest" ] 56 cflags = [ 57 "-Wno-inconsistent-missing-override", 58 "-Dprivate=public", #allow test code access private members 59 "-Dprotected=public", #allow test code access private members 60 ] 61 external_deps = [ "hilog:libhilog" ] 62 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 63} 64 65group("unittest") { 66 testonly = true 67 deps = [ 68 ":plugin_service_module_test", 69 ":plugin_service_ut", 70 ] 71} 72