1# Copyright (c) 2023 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/test/texgine/unittest" 18is_ok = true 19 20group("unittest") { 21 testonly = true 22 if (is_ok) { 23 deps = [ 24 ":texgine_unittest_part1", 25 ":texgine_unittest_part2", 26 ":texgine_unittest_part3", 27 ":texgine_unittest_part4", 28 ":texgine_unittest_part5", 29 ":texgine_unittest_part6", 30 ] 31 } 32} 33 34config("texgine_test_config") { 35 include_dirs = [ 36 "$graphic_2d_root/rosen/modules/texgine/export/texgine", 37 "$graphic_2d_root/rosen/modules/texgine/src", 38 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing", 39 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing/src", 40 ] 41} 42 43group("common_deps") { 44 testonly = true 45 public_deps = [ 46 "$graphic_2d_root/rosen/build/icu:rosen_libicu_ohos", 47 "$graphic_2d_root/rosen/modules/texgine:libtexgine", 48 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing:libtexgine_drawing", 49 "$graphic_2d_root/utils/test_header:test_header", 50 "//third_party/googletest:gmock", 51 "//third_party/googletest:gtest", 52 ] 53 54 if (defined(use_rosen_drawing) && use_rosen_drawing) { 55 public_deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] 56 } 57} 58 59ohos_unittest("texgine_unittest_part1") { 60 module_out_path = module_output_path 61 if (defined(use_rosen_drawing) && use_rosen_drawing) { 62 defines = [ "USE_ROSEN_DRAWING" ] 63 } 64 sources = [ 65 "bidi_processer_test.cpp", 66 "char_groups_test.cpp", 67 "dynamic_file_font_provider_test.cpp", 68 "dynamic_font_style_set_test.cpp", 69 "font_features_test.cpp", 70 "font_styles_test.cpp", 71 "text_converter_test.cpp", 72 "text_merger_test.cpp", 73 "text_reverser_test.cpp", 74 "typography_builder_impl_test.cpp", 75 "typography_style_test.cpp", 76 "variant_span_test.cpp", 77 ] 78 79 public_configs = [ ":texgine_test_config" ] 80 81 public_deps = [ ":common_deps" ] 82 83 use_exceptions = true 84 85 part_name = "graphic_2d" 86 subsystem_name = "graphic" 87} 88 89ohos_unittest("texgine_unittest_part2") { 90 module_out_path = module_output_path 91 if (defined(use_rosen_drawing) && use_rosen_drawing) { 92 defines = [ "USE_ROSEN_DRAWING" ] 93 } 94 sources = [ 95 "dynamic_font_provider_test.cpp", 96 "system_font_provider_test.cpp", 97 "text_shaper_test.cpp", 98 "typeface_test.cpp", 99 ] 100 101 public_configs = [ ":texgine_test_config" ] 102 public_deps = [ ":common_deps" ] 103 104 use_exceptions = true 105 106 part_name = "graphic_2d" 107 subsystem_name = "graphic" 108} 109 110ohos_unittest("texgine_unittest_part3") { 111 module_out_path = module_output_path 112 if (defined(use_rosen_drawing) && use_rosen_drawing) { 113 defines = [ "USE_ROSEN_DRAWING" ] 114 } 115 sources = [ 116 "font_collection_test.cpp", 117 "line_breaker_test.cpp", 118 "text_breaker_test.cpp", 119 ] 120 121 public_configs = [ ":texgine_test_config" ] 122 public_deps = [ ":common_deps" ] 123 124 use_exceptions = true 125 126 part_name = "graphic_2d" 127 subsystem_name = "graphic" 128} 129 130ohos_unittest("texgine_unittest_part4") { 131 module_out_path = module_output_path 132 133 sources = [ 134 "font_providers_test.cpp", 135 "measurer_test.cpp", 136 ] 137 138 public_configs = [ ":texgine_test_config" ] 139 public_deps = [ ":common_deps" ] 140 141 use_exceptions = true 142 143 part_name = "graphic_2d" 144 subsystem_name = "graphic" 145} 146 147ohos_unittest("texgine_unittest_part5") { 148 module_out_path = module_output_path 149 if (defined(use_rosen_drawing) && use_rosen_drawing) { 150 defines = [ "USE_ROSEN_DRAWING" ] 151 } 152 sources = [ 153 "measurer_impl_test.cpp", 154 "texgine_canvas_test.cpp", 155 "texgine_dash_path_effect_test.cpp", 156 "texgine_data_test.cpp", 157 "texgine_font_manager_test.cpp", 158 "texgine_font_metrics_test.cpp", 159 "texgine_font_style_set_test.cpp", 160 "typography_impl_test.cpp", 161 ] 162 163 public_configs = [ ":texgine_test_config" ] 164 public_deps = [ ":common_deps" ] 165 166 use_exceptions = true 167 168 part_name = "graphic_2d" 169 subsystem_name = "graphic" 170 if (enable_text_gine) { 171 sources -= [ 172 "texgine_canvas_test.cpp", 173 "texgine_font_manager_test.cpp", 174 "typography_impl_test.cpp", 175 ] 176 sources += [ 177 "texgine_font_style_test.cpp", 178 "texgine_font_test.cpp", 179 "texgine_mask_filter_test.cpp", 180 "texgine_paint_test.cpp", 181 "texgine_path_1d_path_effect_test.cpp", 182 "texgine_path_test.cpp", 183 ] 184 } 185} 186 187ohos_unittest("texgine_unittest_part6") { 188 module_out_path = module_output_path 189 190 sources = [ 191 "font_manager_test.cpp", 192 "font_parser_test.cpp", 193 ] 194 195 public_configs = [ ":texgine_test_config" ] 196 public_deps = [ ":common_deps" ] 197 198 use_exceptions = true 199 200 part_name = "graphic_2d" 201 subsystem_name = "graphic" 202} 203