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") 16import("${graphic_2d_root}/rosen/modules/render_service_base/config.gni") 17 18config("rs_graphic_test_config") { 19 include_dirs = [ 20 "include", 21 "$graphic_2d_root/rosen/modules", 22 "$graphic_2d_root/rosen/modules/render_service_client/core", 23 "$graphic_2d_root/rosen/modules/render_service_base/include", 24 "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export/rosen_text", 25 "$graphic_2d_root/rosen/modules/2d_graphics", 26 "$graphic_2d_root/rosen/modules/2d_graphics/include", 27 "$graphic_2d_root/rosen/modules/utils", 28 ] 29 30 defines = rs_common_define 31} 32 33ohos_source_set("rs_graphic_test_src") { 34 defines = [] 35 defines += gpu_defines 36 37 sanitize = { 38 cfi = true 39 cfi_cross_dso = true 40 debug = false 41 } 42 testonly = true 43 44 sources = [ 45 "src/rs_graphic_rootnode.cpp", 46 "src/rs_graphic_test.cpp", 47 "src/rs_graphic_test_director.cpp", 48 "src/rs_graphic_test_ext.cpp", 49 "src/rs_graphic_test_utils.cpp", 50 "src/rs_parameter_parse.cpp", 51 ] 52 53 cflags = [ 54 "-Wno-pointer-arith", 55 "-Wno-missing-field-initializers", 56 "-Wno-c++11-narrowing", 57 ] 58 59 cflags_cc = [ 60 "-fvisibility-inlines-hidden", 61 "-std=c++17", 62 ] 63 64 public_configs = [ ":rs_graphic_test_config" ] 65 66 deps = [ 67 "$rosen_root/modules/2d_graphics:2d_graphics", 68 "$rosen_root/modules/platform:eventhandler", 69 "$rosen_root/modules/platform:hilog", 70 "$rosen_root/modules/platform:ipc_core", 71 ] 72 73 public_deps = [ 74 "$rosen_root/modules/render_service_base:librender_service_base", 75 "$rosen_root/modules/render_service_client:librender_service_client", 76 "//third_party/googletest:gtest", 77 ] 78 79 public_external_deps = [ 80 "graphic_surface:surface", 81 "hilog:libhilog", 82 "image_framework:image_native", 83 "libpng:libpng", 84 "window_manager:libdm", 85 "zlib:libz", 86 ] 87 88 part_name = "graphic_2d" 89 subsystem_name = "graphic" 90} 91 92ohos_shared_library("rs_graphic_test") { 93 branch_protector_ret = "pac_ret" 94 sanitize = { 95 cfi = true 96 cfi_cross_dso = true 97 debug = false 98 } 99 testonly = true 100 101 public_deps = [ 102 ":rs_graphic_test_src", 103 "//third_party/googletest:gtest_main", 104 ] 105 106 part_name = "graphic_2d" 107 subsystem_name = "graphic" 108} 109 110ohos_static_library("rs_graphic_test_main") { 111 branch_protector_ret = "pac_ret" 112 sanitize = { 113 cfi = true 114 cfi_cross_dso = true 115 debug = false 116 } 117 testonly = true 118 119 sources = [ "src/rs_graphic_test_main.cpp" ] 120 121 public_deps = [ ":rs_graphic_test_src" ] 122 123 external_deps = [ "hilog:libhilog" ] 124 125 part_name = "graphic_2d" 126 subsystem_name = "graphic" 127} 128