1e9297d28Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
2e9297d28Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3e9297d28Sopenharmony_ci# you may not use this file except in compliance with the License.
4e9297d28Sopenharmony_ci# You may obtain a copy of the License at
5e9297d28Sopenharmony_ci#
6e9297d28Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7e9297d28Sopenharmony_ci#
8e9297d28Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9e9297d28Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10e9297d28Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11e9297d28Sopenharmony_ci# See the License for the specific language governing permissions and
12e9297d28Sopenharmony_ci# limitations under the License.
13e9297d28Sopenharmony_ci
14e9297d28Sopenharmony_ciimport("//build/test.gni")
15e9297d28Sopenharmony_ciimport("//foundation/graphic/graphic_2d/graphic_config.gni")
16e9297d28Sopenharmony_ci
17e9297d28Sopenharmony_cimodule_out_path = "graphic_2d/surfaceimage"
18e9297d28Sopenharmony_ci
19e9297d28Sopenharmony_cigroup("unittest") {
20e9297d28Sopenharmony_ci  testonly = true
21e9297d28Sopenharmony_ci
22e9297d28Sopenharmony_ci  deps = [ ":native_image_system_test_st" ]
23e9297d28Sopenharmony_ci}
24e9297d28Sopenharmony_ci
25e9297d28Sopenharmony_ci## SystemTest native_image_system_test {{{
26e9297d28Sopenharmony_ciohos_unittest("native_image_system_test_st") {
27e9297d28Sopenharmony_ci  module_out_path = module_out_path
28e9297d28Sopenharmony_ci  sources = []
29e9297d28Sopenharmony_ci  if (surface_enable_gpu) {
30e9297d28Sopenharmony_ci    sources += [
31e9297d28Sopenharmony_ci      "native_image_opengl_system_test.cpp",
32e9297d28Sopenharmony_ci      "native_image_system_test.cpp",
33e9297d28Sopenharmony_ci    ]
34e9297d28Sopenharmony_ci  }
35e9297d28Sopenharmony_ci
36e9297d28Sopenharmony_ci  deps = [
37e9297d28Sopenharmony_ci    ":native_image_system_common",
38e9297d28Sopenharmony_ci    "$graphic_2d_root/frameworks/opengl_wrapper:EGL",
39e9297d28Sopenharmony_ci    "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3",
40e9297d28Sopenharmony_ci  ]
41e9297d28Sopenharmony_ci}
42e9297d28Sopenharmony_ci
43e9297d28Sopenharmony_ci## UnitTest native_image_test }}}
44e9297d28Sopenharmony_ci
45e9297d28Sopenharmony_ci## Build native_image_system_common.a {{{
46e9297d28Sopenharmony_ciohos_static_library("native_image_system_common") {
47e9297d28Sopenharmony_ci  visibility = [ ":*" ]
48e9297d28Sopenharmony_ci  testonly = true
49e9297d28Sopenharmony_ci  sanitize = {
50e9297d28Sopenharmony_ci    cfi = true
51e9297d28Sopenharmony_ci    cfi_cross_dso = true
52e9297d28Sopenharmony_ci    cfi_vcall_icall_only = true
53e9297d28Sopenharmony_ci    debug = false
54e9297d28Sopenharmony_ci  }
55e9297d28Sopenharmony_ci  cflags = [
56e9297d28Sopenharmony_ci    "-Wall",
57e9297d28Sopenharmony_ci    "-Werror",
58e9297d28Sopenharmony_ci    "-g3",
59e9297d28Sopenharmony_ci    "-Dprivate=public",
60e9297d28Sopenharmony_ci    "-Dprotected=public",
61e9297d28Sopenharmony_ci  ]
62e9297d28Sopenharmony_ci
63e9297d28Sopenharmony_ci  public_deps = [
64e9297d28Sopenharmony_ci    "$graphic_2d_root:libnative_image",
65e9297d28Sopenharmony_ci    "$graphic_2d_root/utils:libgraphic_utils",
66e9297d28Sopenharmony_ci    "//third_party/googletest:gtest_main",
67e9297d28Sopenharmony_ci  ]
68e9297d28Sopenharmony_ci
69e9297d28Sopenharmony_ci  public_external_deps = [
70e9297d28Sopenharmony_ci    "access_token:libaccesstoken_sdk",
71e9297d28Sopenharmony_ci    "access_token:libnativetoken",
72e9297d28Sopenharmony_ci    "access_token:libtoken_setproc",
73e9297d28Sopenharmony_ci    "c_utils:utils",
74e9297d28Sopenharmony_ci    "graphic_surface:buffer_handle",
75e9297d28Sopenharmony_ci    "graphic_surface:surface",
76e9297d28Sopenharmony_ci    "graphic_surface:sync_fence",
77e9297d28Sopenharmony_ci    "hilog:libhilog",
78e9297d28Sopenharmony_ci    "ipc:ipc_core",
79e9297d28Sopenharmony_ci    "samgr:samgr_proxy",
80e9297d28Sopenharmony_ci  ]
81e9297d28Sopenharmony_ci
82e9297d28Sopenharmony_ci  subsystem_name = "graphic"
83e9297d28Sopenharmony_ci  part_name = "graphic_2d"
84e9297d28Sopenharmony_ci}
85e9297d28Sopenharmony_ci## Build surface_test_common.a }}}
86