1# Copyright (c) 2021 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/sys_installer/sys_installer_default_cfg.gni") 15import("//build/test.gni") 16 17sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".") 18module_output_path = "sys_installer/sys_installer" 19 20config("utest_config") { 21 visibility = [ ":*" ] 22 23 cflags = [ 24 "-fprofile-arcs", 25 "-Wno-implicit-fallthrough", 26 "-Wno-unused-function", 27 ] 28 cflags_cc = [ "-Wno-implicit-fallthrough" ] 29 30 ldflags = [ "--coverage" ] 31} 32 33ohos_unittest("stream_update_unittest") { 34 testonly = true 35 module_out_path = module_output_path 36 sources = [ 37 "${sys_installer_path}/services/stream_update/src/stream_update.cpp", 38 "stream_update_test.cpp", 39 ] 40 41 include_dirs = [ 42 "${sys_installer_path}/common/include", 43 "${sys_installer_path}/interfaces/innerkits", 44 "${sys_installer_path}/interfaces/inner_api/include", 45 "${sys_installer_path}/frameworks/actions/include", 46 "${sys_installer_path}/frameworks/installer_manager/include", 47 "${sys_installer_path}/frameworks/status_manager/include", 48 "${sys_installer_path}/include", 49 "${sys_installer_path}/services/stream_update/include", 50 ] 51 52 deps = [ "${sys_installer_path}/frameworks/status_manager:libstatusmanager" ] 53 54 external_deps = [ 55 "bounds_checking_function:libsec_static", 56 "googletest:gmock_main", 57 "googletest:gtest_main", 58 "hilog:libhilog", 59 "ipc:ipc_core", 60 "openssl:libcrypto_static", 61 "updater:libbinchunkupdate", 62 "updater:libringbuffer", 63 "updater:libupdater", 64 "updater:libutils", 65 ] 66 67 cflags_cc = [ "-fexceptions" ] 68 69 defines = [ 70 "UPDATER_UT", 71 "BUILD_OHOS", 72 "HDC_DEBUG", 73 "HARMONY_PROJECT", 74 ] 75 76 public_configs = [ ":utest_config" ] 77 install_enable = true 78 part_name = "sys_installer" 79} 80