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 if (current_toolchain != host_toolchain) { 21 defines = [ "HAVE_HILOG" ] 22 } 23} 24 25ohos_unittest("processplugin_ut") { 26 module_out_path = module_output_path 27 sources = [ "unittest/process_plugin_unittest.cpp" ] 28 deps = [ 29 "${OHOS_PROFILER_DIR}/device/plugins/process_plugin:processplugin", 30 "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_data_cpp", 31 "//third_party/bounds_checking_function:libsec_static", 32 "//third_party/googletest:gtest_main", 33 ] 34 include_dirs = [ 35 "../include", 36 "../../../memory_plugin/include", 37 "${OHOS_PROFILER_DIR}/interfaces/kits", 38 "${OHOS_PROFILER_DIR}/device/base/include", 39 "//third_party/googletest/googletest/include/gtest", 40 "//third_party/bounds_checking_function/include", 41 ] 42 cflags = [ 43 "-Wno-inconsistent-missing-override", 44 "-Dprivate=public", #allow test code access private members 45 ] 46 external_deps = [ "hilog:libhilog" ] 47 configs = [ ":module_private_config" ] 48 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 49 part_name = "${OHOS_PROFILER_PART_NAME}" 50 resource_config_file = "${OHOS_PROFILER_DIR}/device/ohos_test.xml" 51} 52 53group("unittest") { 54 testonly = true 55 deps = [ ":processplugin_ut" ] 56} 57