1# Copyright (c) 2022-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_output_path = "graphic_2d/rosen/modules/2d_graphics/ndk/" 18 19ohos_unittest("2d_graphics_ndk_test") { 20 module_out_path = module_output_path 21 22 sources = [ 23 "drawing_bitmap_test.cpp", 24 "drawing_brush_test.cpp", 25 "drawing_canvas_test.cpp", 26 "drawing_color_space_test.cpp", 27 "drawing_color_test.cpp", 28 "drawing_font_collection_test.cpp", 29 "drawing_font_mgr_test.cpp", 30 "drawing_font_test.cpp", 31 "drawing_gpu_context_test.cpp", 32 "drawing_image_test.cpp", 33 "drawing_matrix_test.cpp", 34 "drawing_memory_stream_test.cpp", 35 "drawing_path_effect_test.cpp", 36 "drawing_path_test.cpp", 37 "drawing_pen_test.cpp", 38 "drawing_pixel_map_test.cpp", 39 "drawing_point_test.cpp", 40 "drawing_record_cmd_test.cpp", 41 "drawing_rect_test.cpp", 42 "drawing_region_test.cpp", 43 "drawing_register_font_test.cpp", 44 "drawing_round_rect_test.cpp", 45 "drawing_shader_effect_test.cpp", 46 "drawing_surface_test.cpp", 47 "drawing_text_typography_test.cpp", 48 "drawing_typeface_test.cpp", 49 ] 50 51 include_dirs = [ 52 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/include", 53 "$graphic_2d_root/rosen/modules/2d_graphics/src", 54 "$graphic_2d_root/rosen/modules/2d_graphics/src/drawing/engine_adapter", 55 "//third_party/googletest/googletest/include", 56 ] 57 if (enable_text_gine) { 58 include_dirs += [ 59 "$graphic_2d_root/rosen/modules/2d_engine/rosen_text/export", 60 "$graphic_2d_root/rosen/modules/render_service_base/include", 61 "//third_party/skia", 62 ] 63 defines = [ "USE_GRAPHIC_TEXT_GINE" ] 64 } else { 65 include_dirs += [ "$graphic_2d_root/rosen/modules/2d_engine" ] 66 } 67 68 deps = [ 69 "$graphic_2d_root/frameworks/opengl_wrapper:EGL", 70 "$graphic_2d_root/frameworks/opengl_wrapper:GLESv3", 71 "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics", 72 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk:native_drawing_ndk", 73 "//third_party/googletest:gtest_main", 74 ] 75 76 subsystem_name = "graphic" 77 external_deps = [ 78 "c_utils:utils", 79 "hilog:libhilog", 80 "image_framework:pixelmap", 81 "openssl:libcrypto_shared", 82 ] 83} 84 85group("unittest") { 86 testonly = true 87 88 deps = [ ":2d_graphics_ndk_test" ] 89} 90