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/rosen/modules/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      enhanced_opt) {
30    cflags += [ "-fwhole-program-vtables" ]
31  }
32
33  sources = [
34    "hgm_energy_consumption_policy_test.cpp",
35    "hgm_frame_rate_manager_test.cpp",
36    "hgm_idle_detector_test.cpp",
37    "hgm_lru_cache_test.cpp",
38    "hgm_multi_app_strategy_test.cpp",
39    "hgm_screen_info_test.cpp",
40    "hgm_task_handle_thread_test.cpp",
41    "hgm_touch_manager_test.cpp",
42    "hgm_vsync_generator_controller_test.cpp",
43    "hgm_xml_parser_test.cpp",
44    "hyper_graphic_manager_test.cpp",
45    "rs_frame_rate_vote_test.cpp",
46    "rs_video_frame_rate_vote_test.cpp",
47  ]
48
49  include_dirs = [
50    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/core/frame_rate_manager",
51    "$graphic_2d_root/rosen/modules/hyper_graphic_manager/frame_rate_vote",
52    "$graphic_2d_root/rosen/modules/render_service_base/include",
53  ]
54
55  deps = [
56    "$graphic_2d_root/rosen/modules/hyper_graphic_manager:libhyper_graphic_manager",
57    "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
58    "$graphic_2d_root/rosen/modules/render_service_base:render_service_base_src",
59    "$graphic_2d_root/utils/test_header:test_header",
60  ]
61
62  external_deps = [
63    "c_utils:utils",
64    "eventhandler:libeventhandler",
65    "ffrt:libffrt",
66    "graphic_surface:surface",
67    "hilog:libhilog",
68    "hitrace:hitrace_meter",
69    "init:libbeget_proxy",
70    "init:libbegetutil",
71  ]
72
73  part_name = "graphic_2d"
74  subsystem_name = "graphic"
75}
76
77group("unittest") {
78  testonly = true
79
80  deps = [ ":hyper_graphic_manager_test" ]
81}
82