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("../../../../../build/config.gni")
16
17module_output_path = "${OHOS_PROFILER_TEST_MODULE_OUTPUT_PATH}/sp_daemon"
18config("module_private_config") {
19  visibility = [ ":*" ]
20}
21
22ohos_unittest("sp_daemon_ut") {
23  module_out_path = module_output_path
24  sources = [
25    "../ByTrace.cpp",
26    "../CPU.cpp",
27    "../Capture.cpp",
28    "../DDR.cpp",
29    "../Dubai.cpp",
30    "../FPS.cpp",
31    "../GPU.cpp",
32    "../GpuCounter.cpp",
33    "../GpuCounterCallback.cpp",
34    "../Network.cpp",
35    "../Power.cpp",
36    "../RAM.cpp",
37    "../Temperature.cpp",
38    "../parse_click_complete_trace.cpp",
39    "../parse_click_response_trace.cpp",
40    "../parse_radar.cpp",
41    "../parse_slide_fps_trace.cpp",
42    "../profiler_fps.cpp",
43    "../sdk_data_recv.cpp",
44    "../sp_log.cpp",
45    "../sp_task.cpp",
46    "../sp_utils.cpp",
47    "../startup_delay.cpp",
48    "unittest/bytrace_test.cpp",
49    "unittest/ddr_test.cpp",
50    "unittest/dubai_test.cpp",
51    "unittest/fps_test.cpp",
52    "unittest/parse_radar_test.cpp",
53    "unittest/smartperf_main_test.cpp",
54    "unittest/sp_daemon_test.cpp",
55    "unittest/sp_task_test.cpp",
56    "unittest/sp_utils_test.cpp",
57  ]
58  include_dirs = [
59    "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command/include",
60    "//third_party/googletest/googletest/include/gtest",
61  ]
62  deps = [
63    "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command:SP_daemon",
64    "//third_party/googletest:gtest",
65    "//third_party/libpng:libpng",
66  ]
67  external_deps = [
68    "c_utils:utils",
69    "hilog:libhilog",
70    "hiview:libucollection_utility",
71    "image_framework:image_native",
72    "init:libbegetutil",
73    "window_manager:libdm",
74    "window_manager:libwm",
75  ]
76
77  configs = [ "//build/config/compiler:exceptions" ]
78
79  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
80  part_name = "${OHOS_PROFILER_PART_NAME}"
81}
82
83group("unittest") {
84  testonly = true
85  deps = [ ":sp_daemon_ut" ]
86}
87