• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = [ "../src" ]
33  cflags = [
34    "-Wno-inconsistent-missing-override",
35    "-Dprivate=public",  #allow test code access private members
36    "-Dprotected=public",  #allow test code access private members
37  ]
38  external_deps = [
39    "abseil-cpp:absl_sync",
40    "abseil-cpp:absl_cord",
41    "abseil-cpp:absl_log",
42    "bounds_checking_function:libsec_shared",
43    "c_utils:utils",
44    "googletest:gtest",
45    "grpc:gpr",
46    "hilog:libhilog_base",
47    "openssl:libcrypto_shared",
48    "protobuf:protobuf_lite",
49  ]
50  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
51}
52
53ohos_unittest("plugin_service_module_test") {
54  module_out_path = module_output_path
55  sources = [ "moduletest/plugin_service_test.cpp" ]
56  public_deps = [
57    "${OHOS_PROFILER_DIR}/device/services/plugin_service:hiprofiler_plugin_service",
58    "${OHOS_PROFILER_DIR}/device/services/shared_memory:shared_memory_source",
59    "${OHOS_PROFILER_DIR}/protos/services:plugin_service_proto",
60    "${OHOS_PROFILER_DIR}/protos/services:profiler_service_all_type_source",
61  ]
62
63  cflags = [
64    "-Wno-inconsistent-missing-override",
65    "-Dprivate=public",  #allow test code access private members
66    "-Dprotected=public",  #allow test code access private members
67  ]
68  external_deps = [
69    "abseil-cpp:absl_cord",
70    "abseil-cpp:absl_log",
71    "abseil-cpp:absl_sync",
72    "googletest:gtest",
73    "grpc:gpr",
74    "hilog:libhilog_base",
75    "protobuf:protobuf_lite",
76  ]
77  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
78}
79
80group("unittest") {
81  testonly = true
82  deps = [
83    ":plugin_service_module_test",
84    ":plugin_service_ut",
85  ]
86}
87