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("utils_test") { 21 testonly = true 22 module_out_path = MODULE_OUTPUT_PATH 23 sources = [ 24 "json/utils_json_test.cpp", 25 "json/utils_json_visitor_test.cpp", 26 "utils_unittest.cpp", 27 ] 28 sources += [ 29 "${updater_path}/utils/json/json_node.cpp", 30 "${updater_path}/utils/utils.cpp", 31 ] 32 include_dirs = [ 33 "include", 34 "${updater_path}/interfaces/kits/include/", 35 "${updater_path}/services/common", 36 "${updater_path}/services/include/", 37 "${updater_path}/utils/include", 38 "${updater_path}/utils/json", 39 "${updater_path}/services/ui", 40 "${updater_path}/test/unittest", 41 ] 42 external_deps = [ 43 "bounds_checking_function:libsec_static", 44 "bzip2:libbz2", 45 "cJSON:cjson", 46 "googletest:gmock_main", 47 "googletest:gtest_main", 48 "hilog:libhilog", 49 "init:libbegetutil_static", 50 "lz4:liblz4_static", 51 "openssl:libcrypto_shared", 52 "openssl:libssl_static", 53 "zlib:libz", 54 ] 55 deps = [ 56 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 57 "${updater_path}/services/fs_manager:libfsmanager", 58 "${updater_path}/services/log:libupdaterlog", 59 "${updater_path}/services/package:libupdaterpackage", 60 "${updater_path}/utils:libutils", 61 ] 62 configs = [ "${updater_path}/test/unittest:utest_config" ] 63 install_enable = true 64 part_name = "updater" 65} 66