• 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("../../../../../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    "../AI_schedule.cpp",
26    "../ByTrace.cpp",
27    "../CPU.cpp",
28    "../Capture.cpp",
29    "../DDR.cpp",
30    "../Dubai.cpp",
31    "../FPS.cpp",
32    "../FileDescriptor.cpp",
33    "../GPU.cpp",
34    "../GetLog.cpp",
35    "../GpuCounter.cpp",
36    "../GpuCounterCallback.cpp",
37    "../Network.cpp",
38    "../Power.cpp",
39    "../RAM.cpp",
40    "../Temperature.cpp",
41    "../Threads.cpp",
42    "../control_call_cmd.cpp",
43    "../editor_command.cpp",
44    "../heartbeat.cpp",
45    "../lock_frequency.cpp",
46    "../navigation.cpp",
47    "../parse_click_complete_trace.cpp",
48    "../parse_click_response_trace.cpp",
49    "../parse_radar.cpp",
50    "../parse_slide_fps_trace.cpp",
51    "../profiler_fps.cpp",
52    "../sdk_data_recv.cpp",
53    "../service_plugin.cpp",
54    "../sp_log.cpp",
55    "../sp_profiler_factory.cpp",
56    "../sp_server_socket.cpp",
57    "../sp_task.cpp",
58    "../sp_thread_socket.cpp",
59    "../sp_utils.cpp",
60    "../stalling_rate_trace.cpp",
61    "../startup_delay.cpp",
62    "unittest/bytrace_test.cpp",
63    "unittest/control_call_cmd_test.cpp",
64    "unittest/ddr_test.cpp",
65    "unittest/dubai_test.cpp",
66    "unittest/editor_command_test.cpp",
67    "unittest/filedescriptor_test.cpp",
68    "unittest/fps_test.cpp",
69    "unittest/gpuCounter_test.cpp",
70    "unittest/parse_click_complete_trace_test.cpp",
71    "unittest/parse_radar_test.cpp",
72    "unittest/parse_slide_fps_trace_test.cpp",
73    "unittest/power_test.cpp",
74    "unittest/profiler_fps_test.cpp",
75    "unittest/ram_test.cpp",
76    "unittest/sdk_data_recv_test.cpp",
77    "unittest/smartperf_main_test.cpp",
78    "unittest/sp_daemon_test.cpp",
79    "unittest/sp_server_socket_test.cpp",
80    "unittest/sp_task_test.cpp",
81    "unittest/sp_utils_test.cpp",
82    "unittest/stalling_rate_trace_test.cpp",
83    "unittest/startup_delay_test.cpp",
84    "unittest/threads_test.cpp",
85  ]
86  include_dirs = [
87    "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command/include",
88    "//third_party/googletest/googletest/include/gtest",
89  ]
90  deps = [
91    "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command:SP_daemon",
92    "//third_party/googletest:gtest",
93    "//third_party/libpng:libpng",
94  ]
95  external_deps = [
96    "c_utils:utils",
97    "hilog:libhilog",
98    "hiview:libucollection_utility",
99    "image_framework:image_native",
100    "init:libbegetutil",
101    "ipc:ipc_core",
102    "window_manager:libdm",
103    "window_manager:libwm",
104  ]
105
106  configs = [ "//build/config/compiler:exceptions" ]
107
108  subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}"
109  part_name = "${OHOS_PROFILER_PART_NAME}"
110}
111
112group("unittest") {
113  testonly = true
114  deps = [ ":sp_daemon_ut" ]
115}
116
117group("fuzztest") {
118  testonly = true
119  deps = [ "fuzztest/spdaemon_fuzzer:fuzztest" ]
120}
121