• 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
22config("cflags_config") {
23  cflags = [
24    "-Wno-sign-compare",
25    "-Wno-inconsistent-missing-override",
26    "-Dprivate=public",  #allow test code access private members
27  ]
28}
29
30ohos_unittest("profiler_service_ut") {
31  module_out_path = module_output_path
32  sources = [
33    "../../plugin_service/src/plugin_session.cpp",
34    "../../plugin_service/src/plugin_session_manager.cpp",
35    "unittest/plugin_service_stubs.cpp",
36    "unittest/profiler_capability_manager_test.cpp",
37    "unittest/profiler_data_repeater_test.cpp",
38    "unittest/profiler_service_performance_test.cpp",
39    "unittest/profiler_service_test.cpp",
40    "unittest/result_demuxer_test.cpp",
41    "unittest/trace_file_reader_test.cpp",
42    "unittest/trace_file_writer_test.cpp",
43  ]
44  deps = [
45    "${OHOS_PROFILER_DIR}/protos/services:proto_services_cpp",
46    "${OHOS_PROFILER_DIR}/protos/types/plugins/cpu_data:cpu_data_cpp",
47    "${OHOS_PROFILER_DIR}/protos/types/plugins/diskio_data:diskio_data_cpp",
48    "${OHOS_PROFILER_DIR}/protos/types/plugins/hilog_data:hilog_data_cpp",
49    "${OHOS_PROFILER_DIR}/protos/types/plugins/memory_data:memory_data_cpp",
50    "${OHOS_PROFILER_DIR}/protos/types/plugins/network_data:network_data_cpp",
51    "${OHOS_PROFILER_DIR}/protos/types/plugins/process_data:process_data_cpp",
52    "../:profiler_service",
53    "../../../base:hiprofiler_base",
54    "//third_party/googletest:gtest",
55  ]
56  include_dirs = [
57    "//third_party/googletest/googletest/include/gtest",
58    "${OHOS_PROFILER_DIR}/interfaces/kits",
59  ]
60  configs = [ ":cflags_config" ]
61
62  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
63  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
64}
65
66group("unittest") {
67  testonly = true
68  deps = [ ":profiler_service_ut" ]
69}
70