• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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"
18updater_path = rebase_path("${updater_absolutely_path}", ".")
19
20ohos_unittest("bin_flow_update_test") {
21  testonly = true
22  resource_config_file = "${updater_path}/test/unittest/test_data/ohos_test.xml"
23  module_out_path = MODULE_OUTPUT_PATH
24  sources = [ "bin_flow_update_unittest.cpp" ]
25
26  sources += [
27    "${updater_path}/services/flow_update/update_bin/bin_flow_update.cpp",
28    "${updater_path}/services/flow_update/update_bin/bin_process.cpp",
29    "${updater_path}/services/flow_update/update_bin/component_processor.cpp",
30    "${updater_path}/services/updater_binary/update_image_block.cpp",
31    "${updater_path}/services/updater_binary/update_image_patch.cpp",
32    "${updater_path}/services/updater_binary/update_partitions.cpp",
33    "${updater_path}/services/updater_binary/update_processor.cpp",
34    "${updater_path}/utils/utils.cpp",
35  ]
36
37  include_dirs = [
38    "${updater_path}/interfaces/kits/include",
39    "${updater_path}/services",
40    "${updater_path}/services/common",
41    "${updater_path}/services/flow_update",
42    "${updater_path}/services/include",
43    "${updater_path}/services/include/applypatch",
44    "${updater_path}/services/include/log",
45    "${updater_path}/services/include/package",
46    "${updater_path}/services/include/script",
47    "${updater_path}/services/package",
48    "${updater_path}/services/package/pkg_algorithm",
49    "${updater_path}/services/package/pkg_manager",
50    "${updater_path}/services/package/pkg_package",
51    "${updater_path}/services/script",
52    "${updater_path}/services/flow_update/update_bin",
53    "${updater_path}/test/unittest",
54    "${updater_path}/utils/include",
55  ]
56
57  deps = [
58    "${updater_path}/interfaces/kits/misc_info:libmiscinfo",
59    "${updater_path}/interfaces/kits/packages:libpackageExt",
60    "${updater_path}/interfaces/kits/slot_info:libslotinfo",
61    "${updater_path}/services/applypatch:libapplypatch",
62    "${updater_path}/services/fs_manager:libfsmanager",
63    "${updater_path}/services/log:libupdaterlog",
64    "${updater_path}/services/package:libupdaterpackage",
65    "${updater_path}/services/script:libupdaterscript",
66    "${updater_path}/utils:libutils",
67  ]
68  external_deps = [
69    "bounds_checking_function:libsec_static",
70    "bzip2:libbz2",
71    "cJSON:cjson",
72    "googletest:gmock_main",
73    "googletest:gtest_main",
74    "hilog:libhilog",
75    "init:libbegetutil_static",
76    "init:libfsmanager_static_real",
77    "openssl:libcrypto_shared",
78  ]
79  defines = [ "UPDATER_UT" ]
80  configs = [ "${updater_path}/test/unittest:utest_config" ]
81  install_enable = true
82  part_name = "updater"
83}
84