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_clean_cache_test_st", 25 ":native_window_test_st", 26 ":surface_batch_opt_with_connect_strictly_test_st", 27 ":surface_ipc_test_st", 28 ":surface_ipc_with_connect_strictly_test_st", 29 "attach_and_detach_buffer_test:systemtest", 30 "buffer_with_present_timestamp_test:systemtest", 31 ] 32} 33 34## SystemTest native_window_buffer_test {{{ 35ohos_unittest("native_window_buffer_test_st") { 36 module_out_path = module_out_path 37 38 sources = [ "native_window_buffer_test.cpp" ] 39 40 deps = [ ":surface_system_test_common" ] 41} 42 43## SystemTest native_window_buffer_test }}} 44 45## SystemTest native_window_test {{{ 46ohos_unittest("native_window_test_st") { 47 module_out_path = module_out_path 48 49 sources = [ "native_window_test.cpp" ] 50 51 deps = [ ":surface_system_test_common" ] 52} 53 54## SystemTest native_window_test }}} 55 56## SystemTest surface_ipc_test {{{ 57ohos_unittest("surface_ipc_test_st") { 58 module_out_path = module_out_path 59 60 sources = [ "surface_ipc_test.cpp" ] 61 62 deps = [ ":surface_system_test_common" ] 63} 64 65## SystemTest surface_ipc_test }}} 66 67## SystemTest native_window_clean_cache_test {{{ 68ohos_unittest("native_window_clean_cache_test_st") { 69 module_out_path = module_out_path 70 71 sources = [ "clean_cache_test/native_window_clean_cache_test.cpp" ] 72 deps = [ ":surface_system_test_common" ] 73} 74 75## SystemTest surface_ipc_with_connect_strictly_test_st {{{ 76ohos_unittest("surface_ipc_with_connect_strictly_test_st") { 77 module_out_path = module_out_path 78 sources = [ 79 "connect_and_disconnect_test/surface_ipc_with_connect_strictly_test.cpp", 80 ] 81 deps = [ ":surface_system_test_common" ] 82} 83 84## SystemTest surface_ipc_with_connect_strictly_test_st }}} 85 86## SystemTest surface_ipc_with_connect_strictly_test_st {{{ 87ohos_unittest("surface_batch_opt_with_connect_strictly_test_st") { 88 module_out_path = module_out_path 89 sources = [ "connect_and_disconnect_test/surface_batch_opt_with_connect_strictly_test.cpp" ] 90 deps = [ ":surface_system_test_common" ] 91} 92 93## SystemTest surface_ipc_with_connect_strictly_test_st }}} 94 95## Build surface_system_test_common.a {{{ 96config("surface_system_test_common_public_config") { 97 include_dirs = [ "$graphic_surface_root/surface/include" ] 98 99 cflags = [ 100 "-Wall", 101 "-Werror", 102 "-g3", 103 "-Dprivate=public", 104 "-Dprotected=public", 105 ] 106} 107 108ohos_static_library("surface_system_test_common") { 109 visibility = [ ":*" ] 110 testonly = true 111 112 public_configs = [ ":surface_system_test_common_public_config" ] 113 114 public_deps = [ 115 "$graphic_surface_root/buffer_handle:buffer_handle", 116 "$graphic_surface_root/surface:surface", 117 "$graphic_surface_root/sync_fence:sync_fence", 118 "$graphic_surface_root/test_header:test_header", 119 ] 120 121 public_external_deps = [ 122 "access_token:libaccesstoken_sdk", 123 "access_token:libnativetoken", 124 "access_token:libtoken_setproc", 125 "c_utils:utils", 126 "hilog:libhilog", 127 "ipc:ipc_single", 128 "samgr:samgr_proxy", 129 ] 130 131 subsystem_name = "graphic" 132 part_name = "graphic_surface" 133} 134## Build surface_system_test_common.a }}} 135