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/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 "ui_effect:unittest", 38 ] 39} 40 41## Build RSVirtualScreenRefreshRateTest 42ohos_unittest("RSVirtualScreenRefreshRateTest") { 43 module_out_path = module_out_path 44 sources = [ "rs_virtual_screen_refresh_rate_test.cpp" ] 45 deps = [ ":rs_client_test_common" ] 46 external_deps = [ 47 "access_token:libaccesstoken_sdk", 48 "access_token:libnativetoken", 49 "access_token:libtoken_setproc", 50 "cJSON:cjson", 51 "c_utils:utils", 52 "hilog:libhilog", 53 "selinux_adapter:librestorecon", 54 ] 55} 56 57## Build RSScreenSkipFrameTest 58ohos_unittest("RSScreenSkipFrameTest") { 59 module_out_path = module_out_path 60 sources = [ "rs_screen_skipframe_test.cpp" ] 61 deps = [ ":rs_client_test_common" ] 62 external_deps = [ 63 "access_token:libaccesstoken_sdk", 64 "access_token:libnativetoken", 65 "access_token:libtoken_setproc", 66 "cJSON:cjson", 67 "c_utils:utils", 68 "hilog:libhilog", 69 "selinux_adapter:librestorecon", 70 ] 71} 72 73## Build RSJankDetectorTest 74ohos_unittest("RSJankDetectorTest") { 75 module_out_path = module_out_path 76 sources = [ 77 "$graphic_2d_root/rosen/modules/render_service_client/core/render_thread/jank_detector/rs_jank_detector.cpp", 78 "render_thread/jank_detector/rs_jank_detector_test.cpp", 79 ] 80 deps = [ ":rs_client_test_common" ] 81 external_deps = [ "hisysevent:libhisysevent" ] 82} 83 84## Build RSInterfacesTest 85ohos_unittest("RSInterfacesTest") { 86 module_out_path = module_out_path 87 sources = [ "rs_interfaces_test.cpp" ] 88 if (defined(input_ext_feature_magiccursor) && input_ext_feature_magiccursor) { 89 defines = [ "OHOS_BUILD_ENABLE_MAGICCURSOR" ] 90 } 91 deps = [ ":rs_client_test_common" ] 92 external_deps = [ 93 "access_token:libaccesstoken_sdk", 94 "access_token:libnativetoken", 95 "access_token:libtoken_setproc", 96 "cJSON:cjson", 97 "graphic_surface:surface", 98 "selinux_adapter:librestorecon", 99 ] 100} 101 102## Build RSTransactionsTest 103ohos_unittest("RSTransactionsTest") { 104 module_out_path = module_out_path 105 sources = [ "rs_transaction_controller_test.cpp" ] 106 deps = [ 107 ":rs_client_test_common", 108 "$graphic_2d_root/rosen/modules/render_service_base:render_service_base_src", 109 ] 110} 111 112## Build RSDropframeTest 113ohos_unittest("RSDropframeTest") { 114 module_out_path = module_out_path 115 sources = [ "rs_dropframe_test.cpp" ] 116 deps = [ ":rs_client_test_common" ] 117} 118 119## Build RSDisplayModeTest 120ohos_unittest("RSDisplayModeTest") { 121 module_out_path = module_out_path 122 sources = [ "rs_display_mode_test.cpp" ] 123 deps = [ ":rs_client_test_common" ] 124} 125 126## Build TunnelHandleTest 127ohos_unittest("RSTunnelHandleTest") { 128 module_out_path = module_out_path 129 sources = [ "rs_tunnel_handle_test.cpp" ] 130 deps = [ ":rs_client_test_common" ] 131} 132 133## Build RSEventTest 134ohos_unittest("RSEventTest") { 135 module_out_path = module_out_path 136 sources = [ "rs_event_test.cpp" ] 137 deps = [ ":rs_client_test_common" ] 138} 139 140## Build RSRegionTest 141ohos_unittest("RSRegionTest") { 142 module_out_path = module_out_path 143 sources = [ "rs_region_test.cpp" ] 144 deps = [ 145 ":rs_client_test_common", 146 "$graphic_2d_root/rosen/modules/render_service_base:render_service_base_src", 147 ] 148} 149 150## Build rs_client_test_common.a {{{ 151config("rs_client_test_common_public_config") { 152 include_dirs = [ "$graphic_2d_root/rosen/modules/render_service_client/core" ] 153 154 cflags = [ 155 "-Wall", 156 "-Werror", 157 "-g3", 158 "-Dprivate=public", 159 "-Dprotected=public", 160 ] 161} 162 163ohos_static_library("rs_client_test_common") { 164 visibility = [ ":*" ] 165 testonly = true 166 167 public_configs = [ ":rs_client_test_common_public_config" ] 168 169 public_deps = [ 170 "$graphic_2d_root/rosen/modules/render_service_base:librender_service_base", 171 "$graphic_2d_root/rosen/modules/render_service_client:librender_service_client", 172 ] 173 174 public_external_deps = [ 175 "c_utils:utils", 176 "eventhandler:libeventhandler", 177 "hilog:libhilog", 178 "hisysevent:libhisysevent", 179 ] 180 181 subsystem_name = "graphic" 182 part_name = "graphic_2d" 183} 184## Build rs_client_test_common.a }}} 185