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 "../GameEvent.cpp", 35 "../GetLog.cpp", 36 "../GpuCounter.cpp", 37 "../GpuCounterCallback.cpp", 38 "../Network.cpp", 39 "../Power.cpp", 40 "../RAM.cpp", 41 "../Temperature.cpp", 42 "../Threads.cpp", 43 "../control_call_cmd.cpp", 44 "../cpu_info.cpp", 45 "../editor_command.cpp", 46 "../effective.cpp", 47 "../heartbeat.cpp", 48 "../hiperf.cpp", 49 "../lock_frequency.cpp", 50 "../navigation.cpp", 51 "../parse_click_complete_trace.cpp", 52 "../parse_click_response_trace.cpp", 53 "../parse_radar.cpp", 54 "../parse_slide_fps_trace.cpp", 55 "../sdk_data_recv.cpp", 56 "../service_plugin.cpp", 57 "../sp_log.cpp", 58 "../sp_profiler_factory.cpp", 59 "../sp_server_socket.cpp", 60 "../sp_task.cpp", 61 "../sp_thread_socket.cpp", 62 "../sp_utils.cpp", 63 "../stalling_rate_trace.cpp", 64 "../startup_delay.cpp", 65 "unittest/bytrace_test.cpp", 66 "unittest/control_call_cmd_test.cpp", 67 "unittest/ddr_test.cpp", 68 "unittest/dubai_test.cpp", 69 "unittest/editor_command_test.cpp", 70 "unittest/fps_test.cpp", 71 "unittest/gpuCounter_test.cpp", 72 "unittest/parse_click_complete_trace_test.cpp", 73 "unittest/parse_radar_test.cpp", 74 "unittest/parse_slide_fps_trace_test.cpp", 75 "unittest/power_test.cpp", 76 "unittest/ram_test.cpp", 77 "unittest/sdk_data_recv_test.cpp", 78 "unittest/smartperf_main_test.cpp", 79 "unittest/sp_daemon_test.cpp", 80 "unittest/sp_server_socket_test.cpp", 81 "unittest/sp_task_test.cpp", 82 "unittest/sp_utils_test.cpp", 83 "unittest/stalling_rate_trace_test.cpp", 84 "unittest/startup_delay_test.cpp", 85 "unittest/threads_test.cpp", 86 ] 87 include_dirs = [ 88 "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command/include", 89 ] 90 deps = [ 91 "${OHOS_PROFILER_DIR}/host/smartperf/client/client_command:SP_daemon", 92 ] 93 external_deps = [ 94 "ability_base:want", 95 "c_utils:utils", 96 "common_event_service:cesfwk_innerkits", 97 "graphic_2d:librender_service_base", 98 "graphic_2d:librender_service_client", 99 "hilog:libhilog", 100 "hisysevent:libhisysevent", 101 "hiview:libucollection_utility", 102 "image_framework:image_native", 103 "init:libbegetutil", 104 "ipc:ipc_core", 105 "libpng:libpng", 106 "samgr:samgr_proxy", 107 "window_manager:libdm", 108 "window_manager:libwm", 109 ] 110 111 configs = [ "//build/config/compiler:exceptions" ] 112 113 subsystem_name = "${OHOS_PROFILER_SUBSYS_NAME}" 114 part_name = "${OHOS_PROFILER_PART_NAME}" 115 116 if (arkxtest_able) { 117 external_deps += [ "arkxtest:test_server_client" ] 118 defines = [ "ARKTEST_ENABLE" ] 119 } 120} 121 122group("unittest") { 123 testonly = true 124 deps = [ ":sp_daemon_ut" ] 125} 126 127group("fuzztest") { 128 testonly = true 129 deps = [ "fuzztest/spdaemon_fuzzer:fuzztest" ] 130} 131