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 "//third_party/bounds_checking_function/include", 42 "//third_party/cJSON", 43 ] 44 external_deps = [ 45 "hilog:libhilog", 46 "init:libbegetutil", 47 ] 48 deps = [ 49 "${updater_path}/interfaces/kits/misc_info:libmiscinfo", 50 "${updater_path}/services/fs_manager:libfsmanager", 51 "${updater_path}/services/log:libupdaterlog", 52 "${updater_path}/services/package:libupdaterpackage", 53 "${updater_path}/utils:libutils", 54 "//third_party/bounds_checking_function:libsec_static", 55 "//third_party/bzip2:libbz2", 56 "//third_party/cJSON:cjson", 57 "//third_party/googletest:gmock_main", 58 "//third_party/googletest:gtest_main", 59 "//third_party/lz4:liblz4_static", 60 "//third_party/openssl:libcrypto_shared", 61 "//third_party/openssl:libssl_static", 62 "//third_party/zlib:libz", 63 ] 64 configs = [ "${updater_path}/test/unittest:utest_config" ] 65 install_enable = true 66 part_name = "updater" 67} 68