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("//build/test.gni") 15 16UPDATER_TEST_ROOT = "//base/update/updater/test/unittest" 17 18MODULE_OUTPUT_PATH = "updater/updater_test" 19 20ohos_unittest("package_unittest") { 21 testonly = true 22 resource_config_file = 23 "//base/update/updater/test/unittest/test_data/ohos_test.xml" 24 module_out_path = MODULE_OUTPUT_PATH 25 defines = [ "UPDATER_UT" ] 26 sources = [ 27 "package_unittest.cpp", 28 "pkg_algo_unittest.cpp", 29 "pkg_manager_unittest.cpp", 30 "pkg_package_unittest.cpp", 31 "pkg_verify_unittest.cpp", 32 ] 33 34 sources += [ 35 "//base/update/updater/interfaces/kits/packages/package.cpp", 36 "//base/update/updater/services/package/pkg_algorithm/pkg_algo_deflate.cpp", 37 "//base/update/updater/services/package/pkg_algorithm/pkg_algo_digest.cpp", 38 "//base/update/updater/services/package/pkg_algorithm/pkg_algo_lz4.cpp", 39 "//base/update/updater/services/package/pkg_algorithm/pkg_algo_sign.cpp", 40 "//base/update/updater/services/package/pkg_algorithm/pkg_algorithm.cpp", 41 "//base/update/updater/services/package/pkg_manager/pkg_managerImpl.cpp", 42 "//base/update/updater/services/package/pkg_manager/pkg_stream.cpp", 43 "//base/update/updater/services/package/pkg_manager/pkg_utils.cpp", 44 "//base/update/updater/services/package/pkg_package/packages_info.cpp", 45 "//base/update/updater/services/package/pkg_package/pkg_gzipfile.cpp", 46 "//base/update/updater/services/package/pkg_package/pkg_lz4file.cpp", 47 "//base/update/updater/services/package/pkg_package/pkg_pkgfile.cpp", 48 "//base/update/updater/services/package/pkg_package/pkg_upgradefile.cpp", 49 "//base/update/updater/services/package/pkg_package/pkg_zipfile.cpp", 50 "//base/update/updater/services/package/pkg_verify/cert_verify.cpp", 51 "//base/update/updater/services/package/pkg_verify/openssl_util.cpp", 52 "//base/update/updater/services/package/pkg_verify/pkcs7_signed_data.cpp", 53 "//base/update/updater/services/package/pkg_verify/pkg_verify_util.cpp", 54 "//base/update/updater/services/package/pkg_verify/zip_pkg_parse.cpp", 55 ] 56 57 include_dirs = [ 58 "//base/update/updater/interfaces/kits/include", 59 "//base/update/updater/interfaces/kits/include/package", 60 "//base/update/updater/services/include", 61 "//base/update/updater/services/include/package", 62 "//base/update/updater/services/include/script", 63 "//base/update/updater/services/include/log", 64 "//base/update/updater/services/package/pkg_algorithm", 65 "//base/update/updater/services/package/pkg_manager", 66 "//base/update/updater/services/package/pkg_package", 67 "//base/update/updater/services/package/pkg_verify", 68 "//base/update/updater/test/unittest", 69 "//base/update/updater/utils/include", 70 "//third_party/bounds_checking_function/include", 71 "//third_party/lz4/lib", 72 "//third_party/openssl/include", 73 "//third_party/zlib", 74 ] 75 76 deps = [ 77 "//base/update/updater/interfaces/kits/packages:libpackageExt", 78 "//base/update/updater/services/log:libupdaterlog", 79 "//base/update/updater/utils:libutils", 80 "//third_party/bounds_checking_function:libsec_static", 81 "//third_party/bzip2:libbz2", 82 "//third_party/googletest:gmock_main", 83 "//third_party/googletest:gtest_main", 84 "//third_party/lz4:liblz4_static", 85 "//third_party/openssl:libcrypto_shared", 86 "//third_party/zlib:libz", 87 ] 88 configs = [ "$UPDATER_TEST_ROOT:utest_config" ] 89 external_deps = [ 90 "c_utils:utils", 91 "hiviewdfx_hilog_native:libhilog", 92 ] 93 install_enable = true 94 part_name = "updater" 95} 96