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  testonly = true
37
38  sources = [
39    "src/rs_graphic_rootnode.cpp",
40    "src/rs_graphic_test.cpp",
41    "src/rs_graphic_test_director.cpp",
42    "src/rs_graphic_test_ext.cpp",
43    "src/rs_graphic_test_img.cpp",
44    "src/rs_graphic_test_text.cpp",
45    "src/rs_graphic_test_utils.cpp",
46    "src/rs_parameter_parse.cpp",
47  ]
48
49  cflags = [
50    "-Wno-pointer-arith",
51    "-Wno-missing-field-initializers",
52    "-Wno-c++11-narrowing",
53  ]
54
55  cflags_cc = [
56    "-fvisibility-inlines-hidden",
57    "-std=c++17",
58  ]
59
60  public_configs = [ ":rs_graphic_test_config" ]
61
62  deps = [
63    "$rosen_root/modules/2d_graphics:2d_graphics",
64    "$rosen_root/modules/platform:eventhandler",
65    "$rosen_root/modules/platform:hilog",
66    "$rosen_root/modules/platform:ipc_core",
67  ]
68
69  public_deps = [
70    "$rosen_root/modules/render_service_base:librender_service_base",
71    "$rosen_root/modules/render_service_client:librender_service_client",
72    "//third_party/googletest:gtest",
73  ]
74
75  public_external_deps = [
76    "graphic_surface:surface",
77    "hilog:libhilog",
78    "image_framework:image_native",
79    "libpng:libpng",
80    "window_manager:libdm",
81    "zlib:libz",
82  ]
83
84  part_name = "graphic_2d"
85  subsystem_name = "graphic"
86}
87
88ohos_shared_library("rs_graphic_test") {
89  testonly = true
90
91  public_deps = [
92    ":rs_graphic_test_src",
93    "//third_party/googletest:gtest_main",
94  ]
95
96  part_name = "graphic_2d"
97  subsystem_name = "graphic"
98}
99
100ohos_static_library("rs_graphic_test_main") {
101  testonly = true
102
103  sources = [ "src/rs_graphic_test_main.cpp" ]
104
105  public_deps = [ ":rs_graphic_test_src" ]
106
107  external_deps = [ "hilog:libhilog" ]
108
109  part_name = "graphic_2d"
110  subsystem_name = "graphic"
111}
112