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