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