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 = [ ":texgine_unittest_part3" ] 24 } 25} 26 27config("texgine_test_config") { 28 include_dirs = [ 29 "$graphic_2d_root/rosen/modules/texgine/export/texgine", 30 "$graphic_2d_root/rosen/modules/texgine/src", 31 "$graphic_2d_root/rosen/modules/texgine/src/opentype_parser", 32 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing", 33 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing/src", 34 ] 35} 36 37group("common_deps") { 38 testonly = true 39 public_deps = [ 40 "$graphic_2d_root/rosen/build/icu:rosen_libicu_ohos", 41 "$graphic_2d_root/rosen/modules/texgine:libtexgine", 42 "$graphic_2d_root/rosen/modules/texgine/texgine_drawing:libtexgine_drawing", 43 "$graphic_2d_root/utils/test_header:test_header", 44 "//third_party/googletest:gmock", 45 "//third_party/googletest:gtest", 46 ] 47 48 if (defined(use_rosen_drawing) && use_rosen_drawing) { 49 public_deps += [ "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics" ] 50 } 51} 52 53ohos_unittest("texgine_unittest_part3") { 54 module_out_path = module_output_path 55 if (defined(use_rosen_drawing) && use_rosen_drawing) { 56 defines = [ "USE_ROSEN_DRAWING" ] 57 } 58 sources = [ "font_parser_test.cpp" ] 59 60 public_configs = [ ":texgine_test_config" ] 61 public_deps = [ ":common_deps" ] 62 63 use_exceptions = true 64 65 part_name = "graphic_2d" 66 subsystem_name = "graphic" 67} 68 69ohos_unittest("texgine_unittest_part6") { 70 module_out_path = module_output_path 71 72 sources = [ "font_parser_test.cpp" ] 73 74 public_configs = [ ":texgine_test_config" ] 75 public_deps = [ ":common_deps" ] 76 77 use_exceptions = true 78 79 part_name = "graphic_2d" 80 subsystem_name = "graphic" 81} 82