• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17updater_path = rebase_path("${updater_absolutely_path}", ".")
18
19MODULE_OUTPUT_PATH = "updater/updater_test"
20HDC_PATH = "//developtools/hdc/src"
21
22ohos_unittest("flashd_unittest") {
23  testonly = true
24  resource_config_file =
25      "//base/update/updater/test/unittest/test_data/ohos_test.xml"
26  module_out_path = MODULE_OUTPUT_PATH
27  sources = [
28    "${HDC_PATH}/common/async_cmd.cpp",
29    "${HDC_PATH}/common/auth.cpp",
30    "${HDC_PATH}/common/base.cpp",
31    "${HDC_PATH}/common/channel.cpp",
32    "${HDC_PATH}/common/circle_buffer.cpp",
33    "${HDC_PATH}/common/debug.cpp",
34    "${HDC_PATH}/common/file.cpp",
35    "${HDC_PATH}/common/file_descriptor.cpp",
36    "${HDC_PATH}/common/forward.cpp",
37    "${HDC_PATH}/common/session.cpp",
38    "${HDC_PATH}/common/task.cpp",
39    "${HDC_PATH}/common/tcp.cpp",
40    "${HDC_PATH}/common/transfer.cpp",
41    "${HDC_PATH}/common/usb.cpp",
42    "${updater_path}/services/flashd/daemon/commander.cpp",
43    "${updater_path}/services/flashd/daemon/commander_factory.cpp",
44    "${updater_path}/services/flashd/daemon/daemon_updater.cpp",
45    "${updater_path}/services/flashd/daemon/erase_commander.cpp",
46    "${updater_path}/services/flashd/daemon/flash_commander.cpp",
47    "${updater_path}/services/flashd/daemon/flashd_main.cpp",
48    "${updater_path}/services/flashd/daemon/flashd_utils.cpp",
49    "${updater_path}/services/flashd/daemon/format_commander.cpp",
50    "${updater_path}/services/flashd/daemon/update_commander.cpp",
51    "${updater_path}/services/flashd/image_writer/image_writer.cpp",
52    "${updater_path}/services/flashd/partition.cpp",
53    "${updater_path}/services/hdi/server/update_hdi_impl.cpp",
54    "${updater_path}/services/updater_utils.cpp",
55    "flashd_unittest.cpp",
56  ]
57  include_dirs = [
58    "${HDC_PATH}/daemon",
59    "${HDC_PATH}/common",
60    "${updater_path}/services",
61    "${updater_path}/services/common",
62    "${updater_path}/services/flashd",
63    "${updater_path}/services/flashd/daemon",
64    "${updater_path}/services/flashd/common",
65    "${updater_path}/interfaces/kits/include",
66    "${updater_path}/services/include/package",
67    "${updater_path}/services/include/ptable_parse",
68    "${updater_path}/services/include/script",
69    "${updater_path}/services/ui",
70    "${updater_path}/services/include/log",
71    "${updater_path}/services/include",
72    "${updater_path}/services/ptable_parse",
73    "${updater_path}/utils/include",
74    "${updater_path}/utils/json",
75    "//base/startup/init/services/include/param",
76    "//third_party/bounds_checking_function/include",
77    "//third_party/cJSON",
78    "//third_party/lz4/lib",
79    "//third_party/libuv",
80  ]
81
82  deps = [
83    "${updater_path}/interfaces/kits/misc_info:libmiscinfo",
84    "${updater_path}/interfaces/kits/updaterkits:libupdaterkits",
85    "${updater_path}/services:updater",
86    "${updater_path}/services/applypatch:libapplypatch",
87    "${updater_path}/services/diffpatch/patch:libpatch",
88    "${updater_path}/services/fs_manager:libfsmanager",
89    "${updater_path}/services/hdi/server:libupdate_hdi_impl",
90    "${updater_path}/services/log:libupdaterlog",
91    "${updater_path}/services/package:libupdaterpackage",
92    "${updater_path}/services/script:libupdaterscript",
93    "${updater_path}/utils:libutils",
94    "//developtools/hdc:hdc_hash_gen",
95    "//third_party/bounds_checking_function:libsec_static",
96    "//third_party/bzip2:libbz2",
97    "//third_party/cJSON:cjson",
98    "//third_party/googletest:gmock_main",
99    "//third_party/googletest:gtest_main",
100    "//third_party/libuv:uv",
101    "//third_party/lz4:liblz4_static",
102    "//third_party/openssl:libcrypto_shared",
103    "//third_party/zlib:libz",
104  ]
105
106  external_deps = [
107    "hilog:libhilog",
108    "init:libbegetutil",
109  ]
110  configs = [ "${updater_path}/test/unittest:utest_config" ]
111  install_enable = true
112  part_name = "updater"
113  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
114}
115