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("updater_service_unittest") { 21 defines = [ "UPDATER_UT" ] 22 testonly = true 23 resource_config_file = "${updater_path}/test/unittest/test_data/ohos_test.xml" 24 module_out_path = MODULE_OUTPUT_PATH 25 sources = [ 26 "${updater_path}/services/sdcard_update/sdcard_update.cpp", 27 "${updater_path}/services/updater.cpp", 28 "${updater_path}/services/updater_main.cpp", 29 "${updater_path}/services/updater_preprocess.cpp", 30 "${updater_path}/services/updater_utils.cpp", 31 "${updater_path}/utils/utils.cpp", 32 "updater_service_unittest.cpp", 33 ] 34 include_dirs = [ 35 "include", 36 "${updater_path}/interfaces/kits/include/", 37 "${updater_path}/services/common", 38 "${updater_path}/services/include/package", 39 "${updater_path}/services/package/pkg_manager", 40 "${updater_path}/services/package/pkg_verify", 41 "${updater_path}/services/include/log", 42 "${updater_path}/utils/include", 43 "${updater_path}/utils/json", 44 "//third_party/bounds_checking_function/include", 45 "${updater_path}/services", 46 "${updater_path}/services/ui", 47 "${updater_path}/services/ui/include", 48 "${updater_path}/services/include", 49 "${updater_path}/services/ui/view", 50 ] 51 52 deps = [ 53 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 54 "${updater_path}/interfaces/kits/packages:libpackageExt", 55 "${updater_path}/services/applypatch:libapplypatch", 56 "${updater_path}/services/diffpatch/patch:libpatch", 57 "${updater_path}/services/fs_manager:libfsmanager", 58 "${updater_path}/services/log:libupdaterlog", 59 "${updater_path}/services/package:libupdaterpackage", 60 "//third_party/bounds_checking_function:libsec_shared", 61 "//third_party/bounds_checking_function:libsec_static", 62 "//third_party/bzip2:libbz2", 63 "//third_party/cJSON:cjson", 64 "//third_party/libdrm:libdrm", 65 "//third_party/openssl:libcrypto_shared", 66 "//third_party/openssl:libssl_shared", 67 "//third_party/zlib:libz", 68 ] 69 70 external_deps = [ 71 "hilog:libhilog", 72 "init:libbegetutil", 73 "ui_lite:libupdater_layout", 74 ] 75 configs = [ "${updater_path}/test/unittest:utest_config" ] 76 install_enable = true 77 part_name = "updater" 78} 79