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 "lang/ui_language_unittest.cpp", 36 "strategy/ui_strategy_unittest.cpp", 37 "view/ui_component_unittest.cpp", 38 "view/ui_layout_unittest.cpp", 39 "view/ui_page_manager_unittest.cpp", 40 "view/ui_view_api_unittest.cpp", 41 "view/ui_view_proxy_unittest.cpp", 42 ] 43 sources += [ 44 "${updater_path}/services/ui/language/language_ui.cpp", 45 "${updater_path}/services/ui/strategy/ui_strategy.cpp", 46 "${updater_path}/services/ui/view/component/box_progress_adapter.cpp", 47 "${updater_path}/services/ui/view/component/component_factory.cpp", 48 "${updater_path}/services/ui/view/component/img_view_adapter.cpp", 49 "${updater_path}/services/ui/view/component/label_btn_adapter.cpp", 50 "${updater_path}/services/ui/view/component/text_label_adapter.cpp", 51 "${updater_path}/services/ui/view/layout/layout_parser.cpp", 52 "${updater_path}/services/ui/view/page/base_page.cpp", 53 "${updater_path}/services/ui/view/page/page.cpp", 54 "${updater_path}/services/ui/view/page/page_manager.cpp", 55 "${updater_path}/services/ui/view/page/sub_page.cpp", 56 "${updater_path}/services/ui/view/view_api.cpp", 57 ] 58 59 include_dirs = [ 60 "//third_party/libpng", 61 "//third_party/libdrm/include/drm", 62 "//third_party/libdrm", 63 "${updater_path}/services/include/log", 64 "${updater_path}/services/include", 65 "//drivers/hdf_core/framework/ability/sbuf/include", 66 "//drivers/hdf_core/framework/include/platform", 67 "//drivers/hdf_core/framework/include/core", 68 "//drivers/hdf_core/framework/include/osal", 69 "//drivers/hdf_core/framework/include/utils", 70 "//drivers/hdf_core/framework/include/config", 71 "//drivers/hdf_core/framework/include", 72 "//drivers/hdf_core/adapter/uhdf2/hdi", 73 "//drivers/peripheral/input/hal/include", 74 "//drivers/peripheral/input/interfaces/include", 75 "${updater_path}/utils/include", 76 "${updater_path}/utils/json", 77 "${updater_path}/services", 78 "${updater_path}/interfaces/kits/include", 79 "${updater_path}/services/ui", 80 "${updater_path}/services/ui/include", 81 "${updater_path}/services/ui/control", 82 "${updater_path}/services/ui/driver", 83 "${updater_path}/services/ui/strategy", 84 "${updater_path}/services/ui/view", 85 "${updater_path}/services/ui/language", 86 "${updater_path}/test/unittest/updater_ui_test", 87 ] 88 deps = [ 89 "${updater_path}/interfaces/kits/packages:libpackageExt", 90 "${updater_path}/services/log:libupdaterlog", 91 "${updater_path}/utils:libutils", 92 "//drivers/peripheral/input/hal:hdi_input", 93 "//third_party/bounds_checking_function:libsec_static", 94 "//third_party/cJSON:cjson", 95 "//third_party/googletest:gmock_main", 96 "//third_party/googletest:gtest_main", 97 "//third_party/libdrm:libdrm", 98 "//third_party/libpng:libpng", 99 ] 100 configs = [ "${updater_path}/test/unittest:utest_config" ] 101 external_deps = [ 102 "c_utils:utils", 103 "hilog:libhilog", 104 "ui_lite:libupdater_layout", 105 ] 106 install_enable = true 107 part_name = "updater" 108} 109