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/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 external_deps = [ 42 "cJSON:cjson_static", 43 "selinux_adapter:librestorecon" 44 ] 45} 46 47## SystemTest native_window_buffer_test }}} 48 49## SystemTest native_window_test {{{ 50ohos_unittest("native_window_test_st") { 51 module_out_path = module_out_path 52 53 sources = [ "native_window_test.cpp" ] 54 55 deps = [ ":surface_system_test_common" ] 56} 57 58## SystemTest native_window_test }}} 59 60## SystemTest surface_ipc_test {{{ 61ohos_unittest("surface_ipc_test_st") { 62 module_out_path = module_out_path 63 64 sources = [ "surface_ipc_test.cpp" ] 65 66 deps = [ ":surface_system_test_common" ] 67 external_deps = [ 68 "cJSON:cjson_static", 69 "selinux_adapter:librestorecon" 70 ] 71} 72 73## SystemTest surface_ipc_test }}} 74 75## SystemTest native_window_clean_cache_test {{{ 76ohos_unittest("native_window_clean_cache_test_st") { 77 module_out_path = module_out_path 78 79 sources = [ "clean_cache_test/native_window_clean_cache_test.cpp" ] 80 deps = [ ":surface_system_test_common" ] 81 external_deps = [ 82 "cJSON:cjson_static", 83 "selinux_adapter:librestorecon" 84 ] 85} 86 87## SystemTest surface_ipc_with_connect_strictly_test_st {{{ 88ohos_unittest("surface_ipc_with_connect_strictly_test_st") { 89 module_out_path = module_out_path 90 sources = [ 91 "connect_and_disconnect_test/surface_ipc_with_connect_strictly_test.cpp", 92 ] 93 deps = [ ":surface_system_test_common" ] 94 external_deps = [ 95 "cJSON:cjson_static", 96 "selinux_adapter:librestorecon" 97 ] 98} 99 100## SystemTest surface_ipc_with_connect_strictly_test_st }}} 101 102## SystemTest surface_ipc_with_connect_strictly_test_st {{{ 103ohos_unittest("surface_batch_opt_with_connect_strictly_test_st") { 104 module_out_path = module_out_path 105 sources = [ "connect_and_disconnect_test/surface_batch_opt_with_connect_strictly_test.cpp" ] 106 deps = [ ":surface_system_test_common" ] 107 external_deps = [ 108 "cJSON:cjson_static", 109 "selinux_adapter:librestorecon" 110 ] 111} 112 113## SystemTest surface_ipc_with_connect_strictly_test_st }}} 114 115## Build surface_system_test_common.a {{{ 116config("surface_system_test_common_public_config") { 117 include_dirs = [ "$graphic_surface_root/surface/include" ] 118 119 cflags = [ 120 "-Wall", 121 "-Werror", 122 "-g3", 123 "-Dprivate=public", 124 "-Dprotected=public", 125 ] 126} 127 128ohos_static_library("surface_system_test_common") { 129 visibility = [ ":*" ] 130 testonly = true 131 132 public_configs = [ ":surface_system_test_common_public_config" ] 133 134 public_deps = [ 135 "$graphic_surface_root/buffer_handle:buffer_handle", 136 "$graphic_surface_root/surface:surface", 137 "$graphic_surface_root/sync_fence:sync_fence", 138 "$graphic_surface_root/test_header:test_header", 139 ] 140 141 public_external_deps = [ 142 "access_token:libaccesstoken_sdk", 143 "access_token:libnativetoken", 144 "access_token:libtoken_setproc", 145 "c_utils:utils", 146 "eventhandler:libeventhandler", 147 "hilog:libhilog", 148 "ipc:ipc_single", 149 "samgr:samgr_proxy", 150 ] 151 152 subsystem_name = "graphic" 153 part_name = "graphic_surface" 154} 155## Build surface_system_test_common.a }}} 156