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_2d/graphic_config.gni")
16
17module_out_path = "graphic_2d/surfaceimage"
18
19group("unittest") {
20  testonly = true
21
22  deps = [ ":native_image_system_test_st" ]
23}
24
25## SystemTest native_image_system_test {{{
26ohos_unittest("native_image_system_test_st") {
27  module_out_path = module_out_path
28  sources = []
29  if (surface_enable_gpu) {
30    sources += [
31      "native_image_opengl_system_test.cpp",
32      "native_image_system_test.cpp",
33    ]
34  }
35
36  deps = [
37    ":native_image_system_common",
38    "$graphic_2d_root/frameworks/opengl_wrapper:EGL",
39    "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3",
40  ]
41}
42
43## UnitTest native_image_test }}}
44
45## Build native_image_system_common.a {{{
46ohos_static_library("native_image_system_common") {
47  visibility = [ ":*" ]
48  testonly = true
49  sanitize = {
50    cfi = true
51    cfi_cross_dso = true
52    cfi_vcall_icall_only = true
53    debug = false
54  }
55  cflags = [
56    "-Wall",
57    "-Werror",
58    "-g3",
59    "-Dprivate=public",
60    "-Dprotected=public",
61  ]
62
63  public_deps = [
64    "$graphic_2d_root:libnative_image",
65    "$graphic_2d_root/utils:libgraphic_utils",
66    "//third_party/googletest:gtest_main",
67  ]
68
69  public_external_deps = [
70    "access_token:libaccesstoken_sdk",
71    "access_token:libnativetoken",
72    "access_token:libtoken_setproc",
73    "c_utils:utils",
74    "graphic_surface:buffer_handle",
75    "graphic_surface:surface",
76    "graphic_surface:sync_fence",
77    "hilog:libhilog",
78    "ipc:ipc_core",
79    "samgr:samgr_proxy",
80  ]
81
82  subsystem_name = "graphic"
83  part_name = "graphic_2d"
84}
85## Build surface_test_common.a }}}
86