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