# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../base/config.gni") module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/device" config("module_private_config") { visibility = [ ":*" ] if (current_toolchain != host_toolchain) { defines = [ "HAVE_HILOG" ] } } ohos_unittest("hiprofiler_cmd_ut") { module_out_path = module_output_path sources = [ "../src/parse_plugin_config.cpp", "unittest/hiprofiler_cmd_test.cpp", "unittest/parse_plugin_config_test.cpp", ] deps = [ "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf", "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite", "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base", "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto", "${OHOS_PROFILER_DIR}/protos/services:profiler_service_type_source", "${OHOS_PROFILER_DIR}/protos/types/plugins/arkts_plugin:arkts_plugin_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/default:ftrace_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/hidump_data:hidump_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/hiebpf_data:hiebpf_data_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/hisysevent_data:hisysevent_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_plugin_config_cpp_standard", "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_plugin_config_cpp_standard", "//third_party/bounds_checking_function:libsec_static", "//third_party/googletest:gtest_main", "//third_party/openssl:libcrypto_shared", ] include_dirs = [ "../include", "${OHOS_PROFILER_DIR}/device/base/include", "//third_party/openssl/include", "//third_party/googletest/googletest/include/gtest", "//third_party/bounds_checking_function/include", ] cflags = [ "-Wno-inconsistent-missing-override", "-Dprivate=public", #allow test code access private members ] external_deps = [ "hilog:libhilog" ] configs = [ ":module_private_config" ] subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" part_name = "${OHOS_PROFILER_PART_NAME}" defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } group("unittest") { testonly = true deps = [ ":hiprofiler_cmd_ut" ] }