1# Copyright (c) 2023 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 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("//foundation/graphic/graphic_2d/graphic_config.gni") 16 17ohos_unittest("hyper_graphic_manager_test") { 18 module_out_path = "graphic_2d/graphic_2d/hyper_graphic_manager" 19 20 cflags = [ 21 "-Wall", 22 "-Werror", 23 "-g3", 24 "-Dprivate=public", 25 "-Dprotected=public", 26 ] 27 28 if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64")) { 29 if (!use_libfuzzer) { 30 cflags += [ "-flto=thin" ] 31 } 32 if (enhanced_opt) { 33 if (!use_libfuzzer) { 34 cflags += [ "-fwhole-program-vtables" ] 35 } 36 } 37 } 38 39 sources = [ 40 "hgm_app_page_url_strategy_test.cpp", 41 "hgm_energy_consumption_policy_test.cpp", 42 "hgm_frame_rate_manager_test.cpp", 43 "hgm_hfbc_config_test.cpp", 44 "hgm_idle_detector_test.cpp", 45 "hgm_lru_cache_test.cpp", 46 "hgm_multi_app_strategy_test.cpp", 47 "hgm_pointer_manager_test.cpp", 48 "hgm_screen_info_test.cpp", 49 "hgm_task_handle_thread_test.cpp", 50 "hgm_touch_manager_test.cpp", 51 "hgm_vsync_generator_controller_test.cpp", 52 "hgm_xml_parser_test.cpp", 53 "hyper_graphic_manager_test.cpp", 54 "rs_frame_rate_vote_test.cpp", 55 "rs_video_frame_rate_vote_test.cpp", 56 ] 57 58 include_dirs = [ 59 "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/config", 60 "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/frame_rate_manager", 61 "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/hgm_screen_manager", 62 "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/utils", 63 "$graphic_2d_root/rosen/modules/hyper_graphic_manager/frame_rate_vote", 64 "$graphic_2d_root/rosen/modules/render_service_base/include", 65 ] 66 67 deps = [ 68 "$graphic_2d_root/rosen/modules/hyper_graphic_manager:libhyper_graphic_manager", 69 "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base", 70 "$graphic_2d_root/rosen/modules/render_service_base:render_service_base_src", 71 "$graphic_2d_root/utils/test_header:test_header", 72 ] 73 74 external_deps = [ 75 "c_utils:utils", 76 "eventhandler:libeventhandler", 77 "ffrt:libffrt", 78 "graphic_surface:surface", 79 "hilog:libhilog", 80 "hitrace:hitrace_meter", 81 "init:libbeget_proxy", 82 "init:libbegetutil", 83 ] 84 85 part_name = "graphic_2d" 86 subsystem_name = "graphic" 87} 88 89group("unittest") { 90 testonly = true 91 92 deps = [ ":hyper_graphic_manager_test" ] 93} 94