1# Copyright (c) 2024 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_surface/graphic_surface_config.gni")
16
17module_out_path = "graphic_surface/surface"
18
19group("unittest") {
20  testonly = true
21
22  deps = [
23    ":native_window_buffer_test_st",
24    ":native_window_test_st",
25    ":surface_ipc_test_st",
26    ":surface_ipc_with_invaild_pts_test_st",
27    ":surface_ipc_with_pts_test_st",
28  ]
29}
30
31## SystemTest native_window_buffer_test {{{
32ohos_unittest("native_window_buffer_test_st") {
33  module_out_path = module_out_path
34
35  sources = [ "native_window_buffer_test.cpp" ]
36
37  include_dirs = [ "$graphic_surface_root/surface/include" ]
38
39  cflags = [
40    "-Wall",
41    "-Werror",
42    "-g3",
43    "-Dprivate=public",
44    "-Dprotected=public",
45  ]
46
47  deps = [
48    "$graphic_surface_root/buffer_handle:buffer_handle",
49    "$graphic_surface_root/surface:surface",
50  ]
51
52  external_deps = [
53    "access_token:libaccesstoken_sdk",
54    "access_token:libnativetoken",
55    "access_token:libtoken_setproc",
56    "c_utils:utils",
57    "googletest:gtest_main",
58    "hilog:libhilog",
59    "ipc:ipc_core",
60    "samgr:samgr_proxy",
61  ]
62}
63
64## SystemTest native_window_buffer_test }}}
65
66## SystemTest native_window_test {{{
67ohos_unittest("native_window_test_st") {
68  module_out_path = module_out_path
69
70  sources = [ "native_window_test.cpp" ]
71
72  include_dirs = [ "$graphic_surface_root/surface/include" ]
73
74  cflags = [
75    "-Wall",
76    "-Werror",
77    "-g3",
78    "-Dprivate=public",
79    "-Dprotected=public",
80  ]
81
82  deps = [
83    "$graphic_surface_root/buffer_handle:buffer_handle",
84    "$graphic_surface_root/surface:surface",
85  ]
86
87  external_deps = [
88    "c_utils:utils",
89    "googletest:gtest_main",
90    "hilog:libhilog",
91    "ipc:ipc_core",
92  ]
93}
94
95## SystemTest native_window_test }}}
96
97## SystemTest surface_ipc_test {{{
98ohos_unittest("surface_ipc_test_st") {
99  module_out_path = module_out_path
100
101  sources = [ "surface_ipc_test.cpp" ]
102
103  include_dirs = [ "$graphic_surface_root/surface/include" ]
104
105  cflags = [
106    "-Wall",
107    "-Werror",
108    "-g3",
109  ]
110
111  deps = [ "$graphic_surface_root/surface:surface" ]
112
113  external_deps = [
114    "access_token:libaccesstoken_sdk",
115    "access_token:libnativetoken",
116    "access_token:libtoken_setproc",
117    "c_utils:utils",
118    "googletest:gtest_main",
119    "hilog:libhilog",
120    "ipc:ipc_core",
121    "samgr:samgr_proxy",
122  ]
123}
124
125## SystemTest surface_ipc_test }}}
126
127## SystemTest surface_ipc_with_pts_test_st {{{
128ohos_unittest("surface_ipc_with_pts_test_st") {
129  module_out_path = module_out_path
130
131  sources = [ "surface_ipc_with_invaild_pts_test.cpp" ]
132
133  include_dirs = [ "$graphic_surface_root/surface/include" ]
134
135  cflags = [
136    "-Wall",
137    "-Werror",
138    "-g3",
139  ]
140
141  deps = [
142    "$graphic_surface_root/surface:surface",
143    "$graphic_surface_root/sync_fence:sync_fence",
144  ]
145
146  external_deps = [
147    "access_token:libaccesstoken_sdk",
148    "access_token:libnativetoken",
149    "access_token:libtoken_setproc",
150    "c_utils:utils",
151    "googletest:gtest_main",
152    "hilog:libhilog",
153    "ipc:ipc_core",
154    "samgr:samgr_proxy",
155  ]
156}
157
158## SystemTest surface_ipc_with_pts_test_st }}}
159
160## SystemTest surface_ipc_with_pts_test_st {{{
161ohos_unittest("surface_ipc_with_invaild_pts_test_st") {
162  module_out_path = module_out_path
163
164  sources = [ "surface_ipc_with_invaild_pts_test.cpp" ]
165
166  include_dirs = [ "$graphic_surface_root/surface/include" ]
167
168  cflags = [
169    "-Wall",
170    "-Werror",
171    "-g3",
172  ]
173
174  deps = [
175    "$graphic_surface_root/surface:surface",
176    "$graphic_surface_root/sync_fence:sync_fence",
177  ]
178
179  external_deps = [
180    "access_token:libaccesstoken_sdk",
181    "access_token:libnativetoken",
182    "access_token:libtoken_setproc",
183    "c_utils:utils",
184    "googletest:gtest_main",
185    "hilog:libhilog",
186    "ipc:ipc_core",
187    "samgr:samgr_proxy",
188  ]
189}
190## SystemTest surface_ipc_with_pts_test_st }}}
191