1# Copyright (c) 2025 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/frameworks/text/config.gni") 16import("//foundation/graphic/graphic_2d/graphic_config.gni") 17 18ohos_unittest("text_ndk_test") { 19 module_out_path = text_ut_out_path 20 21 defines = [] 22 sources = [ 23 "add_text_test.cpp", 24 "font_collection_test.cpp", 25 "font_mgr_test.cpp", 26 "font_test.cpp", 27 "register_font_test.cpp", 28 "text_font_descriptor_test.cpp", 29 "text_global_test.cpp", 30 "text_lineTypography_test.cpp", 31 "text_line_test.cpp", 32 "text_run_test.cpp", 33 "text_style_copy_test.cpp", 34 "text_typography_alignment_test.cpp", 35 "text_typography_paint_attribute_test.cpp", 36 "text_typography_strut_style_test.cpp", 37 "text_typography_style_test.cpp", 38 "text_typography_test.cpp", 39 "undefined_glyph_display_test.cpp", 40 ] 41 42 include_dirs = [ 43 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/drawing_utils", 44 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/include", 45 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk/src", 46 "$graphic_2d_root/rosen/modules/2d_graphics/src", 47 ] 48 49 cflags_cc = [ 50 "-std=c++17", 51 "-Dprivate=public", 52 "-Dprotected=public", 53 ] 54 55 include_dirs += [ 56 "$rosen_text_root/interface/export", 57 "$rosen_text_root/adapter/skia", 58 "$rosen_text_root/service/texgine/src", 59 ] 60 61 if (ohos_indep_compiler_enable) { 62 include_dirs += ["//binarys/third_party/icu/innerapis/shared_icuuc/includes/common" ] 63 } 64 65 deps = [ 66 "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics", 67 "$graphic_2d_root/rosen/modules/2d_graphics/drawing_ndk:native_drawing_ndk", 68 "$rosen_text_root:rosen_text", 69 ] 70 71 subsystem_name = "graphic" 72 external_deps = [ 73 "bundle_framework:appexecfwk_base", 74 "bundle_framework:appexecfwk_core", 75 "hilog:libhilog", 76 "icu:shared_icuuc", 77 ] 78 79 platform = current_os 80 if (platform == "ohos" || platform == "ohos_ng") { 81 defines += [ "ENABLE_OHOS_ENHANCE" ] 82 } 83} 84 85group("unittest") { 86 testonly = true 87 88 deps = [ ":text_ndk_test" ] 89} 90