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