• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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")
16import("//foundation/graphic/graphic_surface/graphic_surface_config.gni")
17
18module_out_path = "graphic_surface/surface"
19
20group("unittest") {
21  testonly = true
22
23  deps = [
24    # ":buffer_client_producer_remote_test",
25    # ":buffer_manager_test",
26    # ":buffer_queue_consumer_test",
27
28    # ":buffer_queue_producer_remote_test",
29    # ":buffer_queue_producer_test",
30    # ":buffer_queue_test",
31    ":buffer_shared_test",
32
33    # ":consumer_surface_test",
34    ":metadata_helper_test",
35    ":native_buffer_test",
36
37    # ":native_window_test",
38    # ":producer_surface_test",
39    # ":surface_buffer_impl_test",
40    ":surface_utils_test",
41  ]
42}
43
44## UnitTest buffer_client_producer_remote_test {{{
45ohos_unittest("buffer_client_producer_remote_test") {
46  module_out_path = module_out_path
47
48  sources = [ "buffer_client_producer_remote_test.cpp" ]
49
50  deps = [ ":surface_test_common" ]
51
52  external_deps = [
53    "access_token:libaccesstoken_sdk",
54    "access_token:libnativetoken",
55    "access_token:libtoken_setproc",
56    "c_utils:utils",
57    "hilog:libhilog",
58    "samgr:samgr_proxy",
59  ]
60}
61
62## UnitTest buffer_client_producer_remote_test }}}
63
64## UnitTest buffer_manager_test {{{
65ohos_unittest("buffer_manager_test") {
66  module_out_path = module_out_path
67
68  sources = [ "buffer_manager_test.cpp" ]
69
70  deps = [ ":surface_test_common" ]
71
72  external_deps = [
73    "c_utils:utils",
74    "hilog:libhilog",
75  ]
76}
77
78## UnitTest buffer_manager_test }}}
79
80## UnitTest buffer_queue_consumer_test {{{
81ohos_unittest("buffer_queue_consumer_test") {
82  module_out_path = module_out_path
83
84  sources = [ "buffer_queue_consumer_test.cpp" ]
85
86  deps = [ ":surface_test_common" ]
87
88  external_deps = [
89    "c_utils:utils",
90    "hilog:libhilog",
91  ]
92}
93
94## UnitTest buffer_queue_consumer_test }}}
95
96## UnitTest buffer_queue_producer_remote_test {{{
97ohos_unittest("buffer_queue_producer_remote_test") {
98  module_out_path = module_out_path
99
100  sources = [ "buffer_queue_producer_remote_test.cpp" ]
101
102  deps = [ ":surface_test_common" ]
103
104  external_deps = [
105    "access_token:libaccesstoken_sdk",
106    "access_token:libnativetoken",
107    "access_token:libtoken_setproc",
108    "c_utils:utils",
109    "hilog:libhilog",
110    "samgr:samgr_proxy",
111  ]
112}
113
114## UnitTest buffer_queue_producer_remote_test }}}
115
116## UnitTest buffer_queue_producer_test {{{
117ohos_unittest("buffer_queue_producer_test") {
118  module_out_path = module_out_path
119
120  sources = [ "buffer_queue_producer_test.cpp" ]
121
122  deps = [ ":surface_test_common" ]
123
124  external_deps = [
125    "c_utils:utils",
126    "hilog:libhilog",
127  ]
128}
129
130## UnitTest buffer_queue_producer_test }}}
131
132## UnitTest buffer_queue_test {{{
133ohos_unittest("buffer_queue_test") {
134  module_out_path = module_out_path
135
136  sources = [ "buffer_queue_test.cpp" ]
137
138  deps = [ ":surface_test_common" ]
139
140  external_deps = [
141    "c_utils:utils",
142    "hilog:libhilog",
143  ]
144}
145
146## UnitTest buffer_queue_test }}}
147
148## UnitTest buffer_shared_test {{{
149ohos_unittest("buffer_shared_test") {
150  module_out_path = module_out_path
151
152  sources = [ "buffer_shared_test.cpp" ]
153
154  deps = [ ":surface_test_common" ]
155
156  external_deps = [
157    "c_utils:utils",
158    "hilog:libhilog",
159  ]
160}
161
162## UnitTest buffer_shared_test }}}
163
164## UnitTest consumer_surface_test {{{
165ohos_unittest("consumer_surface_test") {
166  module_out_path = module_out_path
167
168  sources = [ "consumer_surface_test.cpp" ]
169
170  deps = [ ":surface_test_common" ]
171
172  external_deps = [
173    "c_utils:utils",
174    "hilog:libhilog",
175  ]
176}
177
178## UnitTest consumer_surface_test }}}
179
180## UnitTest producer_surface_test {{{
181ohos_unittest("producer_surface_test") {
182  module_out_path = module_out_path
183
184  sources = [ "producer_surface_test.cpp" ]
185
186  deps = [ ":surface_test_common" ]
187
188  external_deps = [
189    "c_utils:utils",
190    "hilog:libhilog",
191  ]
192}
193
194## UnitTest producer_surface_test }}}
195
196## UnitTest surface_buffer_impl_test {{{
197ohos_unittest("surface_buffer_impl_test") {
198  module_out_path = module_out_path
199
200  sources = [ "surface_buffer_impl_test.cpp" ]
201
202  deps = [ ":surface_test_common" ]
203
204  external_deps = [
205    "c_utils:utils",
206    "drivers_interface_display:display_commontype_idl_headers",
207    "hilog:libhilog",
208  ]
209}
210
211## UnitTest surface_buffer_impl_test }}}
212
213## UnitTest surface_utils_test {{{
214ohos_unittest("surface_utils_test") {
215  module_out_path = module_out_path
216
217  sources = [ "surface_utils_test.cpp" ]
218
219  deps = [ ":surface_test_common" ]
220
221  external_deps = [
222    "c_utils:utils",
223    "hilog:libhilog",
224  ]
225}
226
227## UnitTest surface_utils_test }}}
228
229## UnitTest native_window_test {{{
230ohos_unittest("native_window_test") {
231  module_out_path = module_out_path
232
233  sources = [ "native_window_test.cpp" ]
234
235  deps = [ ":surface_test_common" ]
236
237  external_deps = [
238    "access_token:libaccesstoken_sdk",
239    "access_token:libnativetoken",
240    "access_token:libtoken_setproc",
241    "c_utils:utils",
242    "hilog:libhilog",
243    "samgr:samgr_proxy",
244  ]
245}
246
247## UnitTest metadata_helper_test {{{
248ohos_unittest("metadata_helper_test") {
249  module_out_path = module_out_path
250
251  sources = [ "metadata_helper_test.cpp" ]
252
253  deps = [ ":surface_test_common" ]
254
255  external_deps = [
256    "c_utils:utils",
257    "drivers_interface_display:display_commontype_idl_headers",
258    "hilog:libhilog",
259  ]
260}
261
262## UnitTest producer_surface_test }}}
263
264## UnitTest native_window_test }}}
265
266## UnitTest native_buffer_test {{{
267ohos_unittest("native_buffer_test") {
268  module_out_path = module_out_path
269
270  sources = [ "native_buffer_test.cpp" ]
271
272  deps = [ ":surface_test_common" ]
273
274  external_deps = [
275    "c_utils:utils",
276    "hilog:libhilog",
277  ]
278}
279
280## UnitTest native_buffer_test }}}
281
282## Build surface_test_common.a {{{
283config("surface_test_common_public_config") {
284  include_dirs = [ "../../include" ]
285
286  cflags = [
287    "-Wall",
288    "-Werror",
289    "-g3",
290    "-Dprivate=public",
291    "-Dprotected=public",
292  ]
293}
294
295ohos_static_library("surface_test_common") {
296  visibility = [ ":*" ]
297  testonly = true
298
299  public_configs = [ ":surface_test_common_public_config" ]
300
301  public_deps = [
302    "$graphic_surface_root/buffer_handle:buffer_handle",
303    "$graphic_surface_root/surface:surface",
304    "$graphic_surface_root/sync_fence:sync_fence",
305    "$graphic_surface_root/test_header:test_header",
306    "//third_party/googletest:gtest_main",
307  ]
308  subsystem_name = "graphic"
309  part_name = "graphic_surface"
310}
311## Build surface_test_common.a }}}
312