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