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 external_deps = 40 [ "drivers_interface_display:libdisplay_commontype_proxy_1.0" ] 41} 42 43## UnitTest native_image_test }}} 44 45## Build surface_test_common.a {{{ 46ohos_static_library("surface_test_common") { 47 visibility = [ ":*" ] 48 testonly = true 49 50 cflags = [ 51 "-Wall", 52 "-Werror", 53 "-g3", 54 "-Dprivate=public", 55 "-Dprotected=public", 56 ] 57 58 public_deps = [ 59 "$graphic_2d_root:libnative_image", 60 "$graphic_2d_root/utils:libgraphic_utils", 61 "//third_party/googletest:gtest_main", 62 ] 63 64 public_external_deps = [ 65 "access_token:libaccesstoken_sdk", 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