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