• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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("//foundation/graphic/graphic_2d/graphic_config.gni")
16
17module_out_path = "graphic_2d/render_service_client"
18
19group("unittest") {
20  testonly = true
21
22  deps = [
23    ":RSDisplayModeTest",
24    ":RSDropframeTest",
25    ":RSEventTest",
26    ":RSInterfacesTest",
27    ":RSJankDetectorTest",
28    ":RSRegionTest",
29    ":RSScreenSkipFrameTest",
30    ":RSTransactionsTest",
31    ":RSTunnelHandleTest",
32    ":RSVirtualScreenRefreshRateTest",
33    "animation:RSAnimationTest",
34    "animation:RSAnimationTest1",
35    "animation:RSAnimationTest2",
36    "animation:RSAnimationTest3",
37  ]
38}
39
40## Build RSVirtualScreenRefreshRateTest
41ohos_unittest("RSVirtualScreenRefreshRateTest") {
42  module_out_path = module_out_path
43  sources = [ "rs_virtual_screen_refresh_rate_test.cpp" ]
44  deps = [ ":rs_client_test_common" ]
45  external_deps = [
46    "access_token:libaccesstoken_sdk",
47    "access_token:libnativetoken",
48    "access_token:libtoken_setproc",
49    "c_utils:utils",
50    "hilog:libhilog",
51  ]
52}
53
54## Build RSScreenSkipFrameTest
55ohos_unittest("RSScreenSkipFrameTest") {
56  module_out_path = module_out_path
57  sources = [ "rs_screen_skipframe_test.cpp" ]
58  deps = [ ":rs_client_test_common" ]
59  external_deps = [
60    "access_token:libaccesstoken_sdk",
61    "access_token:libnativetoken",
62    "access_token:libtoken_setproc",
63    "c_utils:utils",
64    "hilog:libhilog",
65  ]
66}
67
68## Build RSJankDetectorTest
69ohos_unittest("RSJankDetectorTest") {
70  module_out_path = module_out_path
71  sources = [
72    "$graphic_2d_root/rosen/modules/render_service_client/core/render_thread/jank_detector/rs_jank_detector.cpp",
73    "render_thread/jank_detector/rs_jank_detector_test.cpp",
74  ]
75  deps = [ ":rs_client_test_common" ]
76  external_deps = [ "hisysevent:libhisysevent" ]
77}
78
79## Build RSInterfacesTest
80ohos_unittest("RSInterfacesTest") {
81  module_out_path = module_out_path
82  sources = [ "rs_interfaces_test.cpp" ]
83  if (defined(input_ext_feature_magiccursor) && input_ext_feature_magiccursor) {
84    defines = [ "OHOS_BUILD_ENABLE_MAGICCURSOR" ]
85  }
86  deps = [ ":rs_client_test_common" ]
87  external_deps = [
88    "access_token:libaccesstoken_sdk",
89    "access_token:libnativetoken",
90    "access_token:libtoken_setproc",
91    "graphic_surface:surface",
92  ]
93}
94
95## Build RSTransactionsTest
96ohos_unittest("RSTransactionsTest") {
97  module_out_path = module_out_path
98  sources = [ "rs_transaction_controller_test.cpp" ]
99  deps = [
100    ":rs_client_test_common",
101    "../../../render_service_base:render_service_base_src",
102  ]
103}
104
105## Build RSDropframeTest
106ohos_unittest("RSDropframeTest") {
107  module_out_path = module_out_path
108  sources = [ "rs_dropframe_test.cpp" ]
109  deps = [ ":rs_client_test_common" ]
110}
111
112## Build RSDisplayModeTest
113ohos_unittest("RSDisplayModeTest") {
114  module_out_path = module_out_path
115  sources = [ "rs_display_mode_test.cpp" ]
116  deps = [ ":rs_client_test_common" ]
117}
118
119## Build TunnelHandleTest
120ohos_unittest("RSTunnelHandleTest") {
121  module_out_path = module_out_path
122  sources = [ "rs_tunnel_handle_test.cpp" ]
123  deps = [ ":rs_client_test_common" ]
124}
125
126## Build RSEventTest
127ohos_unittest("RSEventTest") {
128  module_out_path = module_out_path
129  sources = [ "rs_event_test.cpp" ]
130  deps = [ ":rs_client_test_common" ]
131}
132
133## Build RSRegionTest
134ohos_unittest("RSRegionTest") {
135  module_out_path = module_out_path
136  sources = [ "rs_region_test.cpp" ]
137  deps = [
138    ":rs_client_test_common",
139    "../../../render_service_base:render_service_base_src",
140  ]
141}
142
143## Build rs_client_test_common.a {{{
144config("rs_client_test_common_public_config") {
145  include_dirs = [ "$graphic_2d_root/rosen/modules/render_service_client/core" ]
146
147  cflags = [
148    "-Wall",
149    "-Werror",
150    "-g3",
151    "-Dprivate=public",
152    "-Dprotected=public",
153  ]
154}
155
156ohos_static_library("rs_client_test_common") {
157  visibility = [ ":*" ]
158  testonly = true
159
160  public_configs = [ ":rs_client_test_common_public_config" ]
161
162  public_deps = [
163    "//foundation/graphic/graphic_2d/rosen/modules/render_service_base:librender_service_base",
164    "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
165    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
166    "//third_party/googletest:gtest_main",
167  ]
168
169  public_external_deps = [
170    "c_utils:utils",
171    "hilog:libhilog",
172  ]
173
174  subsystem_name = "graphic"
175  part_name = "graphic_2d"
176}
177## Build rs_client_test_common.a }}}
178