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