1# Copyright (c) 2022 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("//base/update/updater/updater_default_cfg.gni") 15import("//build/test.gni") 16 17MODULE_OUTPUT_PATH = "updater/updater_test" 18updater_path = rebase_path("${updater_absolutely_path}", ".") 19 20ohos_unittest("ui_unittest") { 21 testonly = true 22 resource_config_file = "${updater_path}/test/unittest/test_data/ohos_test.xml" 23 module_out_path = MODULE_OUTPUT_PATH 24 defines = [ 25 "UPDATER_UT", 26 "UPDATER_UI_SUPPORT", 27 "ENABLE_BITMAP_FONT = 0", 28 "ENABLE_ICU = 0", 29 "ENABLE_MULTI_FONT = 0", 30 "ENABLE_SHAPING = 0", 31 "ENABLE_STATIC_FONT = 0", 32 "ENABLE_VECTOR_FONT = 1", 33 ] 34 sources = [ 35 "control/ui_control_unittest.cpp", 36 "lang/ui_language_unittest.cpp", 37 "strategy/ui_strategy_unittest.cpp", 38 "view/ui_component_unittest.cpp", 39 "view/ui_graphic_engine_unittest.cpp", 40 "view/ui_layout_unittest.cpp", 41 "view/ui_page_manager_unittest.cpp", 42 "view/ui_view_api_unittest.cpp", 43 "view/ui_view_proxy_unittest.cpp", 44 ] 45 sources += [ 46 "${updater_path}/services/ui/control/event_listener.cpp", 47 "${updater_path}/services/ui/driver/drm_driver.cpp", 48 "${updater_path}/services/ui/driver/fbdev_driver.cpp", 49 "${updater_path}/services/ui/driver/graphic_engine.cpp", 50 "${updater_path}/services/ui/driver/surface_dev.cpp", 51 "${updater_path}/services/ui/driver/ui_rotation.cpp", 52 "${updater_path}/services/ui/language/language_ui.cpp", 53 "${updater_path}/services/ui/strategy/ui_strategy.cpp", 54 "${updater_path}/services/ui/view/component/box_progress_adapter.cpp", 55 "${updater_path}/services/ui/view/component/component_factory.cpp", 56 "${updater_path}/services/ui/view/component/img_view_adapter.cpp", 57 "${updater_path}/services/ui/view/component/label_btn_adapter.cpp", 58 "${updater_path}/services/ui/view/component/text_label_adapter.cpp", 59 "${updater_path}/services/ui/view/layout/auto_layout.cpp", 60 "${updater_path}/services/ui/view/layout/layout_parser.cpp", 61 "${updater_path}/services/ui/view/page/base_page.cpp", 62 "${updater_path}/services/ui/view/page/page.cpp", 63 "${updater_path}/services/ui/view/page/page_manager.cpp", 64 "${updater_path}/services/ui/view/page/sub_page.cpp", 65 "${updater_path}/services/ui/view/view_api.cpp", 66 ] 67 68 include_dirs = [ 69 "${updater_path}/services/include/log", 70 "${updater_path}/services/include", 71 "${updater_path}/utils/include", 72 "${updater_path}/utils/json", 73 "${updater_path}/services", 74 "${updater_path}/interfaces/kits/include", 75 "${updater_path}/services/ui", 76 "${updater_path}/services/ui/include", 77 "${updater_path}/services/ui/control", 78 "${updater_path}/services/ui/driver", 79 "${updater_path}/services/ui/strategy", 80 "${updater_path}/services/ui/view", 81 "${updater_path}/services/ui/language", 82 "${updater_path}/test/unittest/updater_ui_test", 83 ] 84 deps = [ 85 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 86 "${updater_path}/interfaces/kits/packages:libpackageExt", 87 "${updater_path}/services/log:libupdaterlog", 88 "${updater_path}/utils:libutils", 89 ] 90 configs = [ "${updater_path}/test/unittest:utest_config" ] 91 external_deps = [ 92 "bounds_checking_function:libsec_static", 93 "cJSON:cjson", 94 "c_utils:utils", 95 "drivers_peripheral_input:hdi_input", 96 "googletest:gmock_main", 97 "googletest:gtest_main", 98 "hilog:libhilog", 99 "libdrm:libdrm", 100 "libpng:libpng", 101 "ui_lite:libupdater_layout", 102 ] 103 install_enable = true 104 part_name = "updater" 105} 106