• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("hiprofiler_cmd_ut") {
26  module_out_path = module_output_path
27  sources = [
28    "../src/parse_plugin_config.cpp",
29    "unittest/hiprofiler_cmd_test.cpp",
30    "unittest/parse_plugin_config_test.cpp",
31  ]
32  deps = [
33    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf",
34    "${OHOS_PROFILER_3RDPARTY_PROTOBUF_DIR}:protobuf_lite",
35    "${OHOS_PROFILER_DIR}/device/base:hiprofiler_base",
36    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_proto",
37    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_type_source",
38    "${OHOS_PROFILER_DIR}/protos/types/plugins/arkts_plugin:arkts_plugin_cpp_standard",
39    "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_plugin_config_cpp_standard",
40    "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_plugin_config_cpp_standard",
41    "${OHOS_PROFILER_DIR}/protos/types/plugins/ftrace_data/default:ftrace_plugin_config_cpp_standard",
42    "${OHOS_PROFILER_DIR}/protos/types/plugins/hidump_data:hidump_plugin_config_cpp_standard",
43    "${OHOS_PROFILER_DIR}/protos/types/plugins/hiebpf_data:hiebpf_data_cpp_standard",
44    "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_plugin_config_cpp_standard",
45    "${OHOS_PROFILER_DIR}/protos/types/plugins/hiperf_data:hiperf_data_cpp_standard",
46    "${OHOS_PROFILER_DIR}/protos/types/plugins/hisysevent_data:hisysevent_plugin_config_cpp_standard",
47    "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_plugin_config_cpp_standard",
48    "${OHOS_PROFILER_DIR}/protos/types/plugins/native_hook:native_hook_plugin_config_cpp_standard",
49    "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_plugin_config_cpp_standard",
50    "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_plugin_config_cpp_standard",
51    "//third_party/bounds_checking_function:libsec_static",
52    "//third_party/googletest:gtest_main",
53    "//third_party/openssl:libcrypto_shared",
54  ]
55  include_dirs = [
56    "../include",
57    "${OHOS_PROFILER_DIR}/device/base/include",
58    "//third_party/openssl/include",
59    "//third_party/googletest/googletest/include/gtest",
60    "//third_party/bounds_checking_function/include",
61  ]
62  cflags = [
63    "-Wno-inconsistent-missing-override",
64    "-Dprivate=public",  #allow test code access private members
65  ]
66  external_deps = [ "hilog:libhilog" ]
67  configs = [ ":module_private_config" ]
68  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
69  part_name = "${OHOS_PROFILER_PART_NAME}"
70  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
71}
72
73group("unittest") {
74  testonly = true
75  deps = [ ":hiprofiler_cmd_ut" ]
76}
77