• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  if (ohos_indep_compiler_enable) {
67    external_deps += [
68      "init:libbegetutil",
69      "selinux_adapter:librestorecon",
70      "init:libfsmanager_static",
71      "updater:libfsmanager",
72      "updater:libapplypatch",
73      "updater:libpatch",
74      "updater:libwritestate",
75      "updater:libupdaterpackage_shared",
76      "bzip2:libbz2",
77      "zlib:libz",
78      "updater:libslotinfo",
79      "drivers_peripheral_partitionslot:libpartition_slot_manager",
80    ]
81  }
82  cflags_cc = [ "-fexceptions" ]
83
84  defines = [
85    "UPDATER_UT",
86    "BUILD_OHOS",
87    "HDC_DEBUG",
88    "HARMONY_PROJECT",
89  ]
90
91  public_configs = [ ":utest_config" ]
92  install_enable = true
93  part_name = "sys_installer"
94}
95