• 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("//build/test.gni")
15
16UPDATER_TEST_ROOT = "//base/update/updater/test/unittest"
17
18MODULE_OUTPUT_PATH = "updater/updater_test"
19
20ohos_unittest("applypatch_unittest") {
21  testonly = true
22  resource_config_file =
23      "//base/update/updater/test/unittest/test_data/ohos_test.xml"
24  module_out_path = MODULE_OUTPUT_PATH
25  sources = [
26    "all_cmd_unittest.cpp",
27    "applypatch_unittest.cpp",
28    "blockset_unittest.cpp",
29    "commands_unittest.cpp",
30    "commandsfunction_unittest.cpp",
31    "partition_update_record_unittest.cpp",
32    "store_unittest.cpp",
33    "transfer_manager_unittest.cpp",
34  ]
35  sources += [
36    "//base/update/updater/services/applypatch/block_set.cpp",
37    "//base/update/updater/services/applypatch/block_writer.cpp",
38    "//base/update/updater/services/applypatch/command.cpp",
39    "//base/update/updater/services/applypatch/command_function.cpp",
40    "//base/update/updater/services/applypatch/command_process.cpp",
41    "//base/update/updater/services/applypatch/data_writer.cpp",
42    "//base/update/updater/services/applypatch/partition_record.cpp",
43    "//base/update/updater/services/applypatch/raw_writer.cpp",
44    "//base/update/updater/services/applypatch/store.cpp",
45    "//base/update/updater/services/applypatch/transfer_manager.cpp",
46  ]
47  include_dirs = [
48    "//base/update/updater/interfaces/kits/include",
49    "//base/update/updater/services/include",
50    "//base/update/updater/services/include/fs_manager",
51    "//base/update/updater/services/include/log",
52    "//base/update/updater/services/include/package",
53    "//base/update/updater/services/include/script",
54    "//base/update/updater/services/package/pkg_manager",
55    "//base/update/updater/test/unittest",
56    "//base/update/updater/utils/include",
57    "//third_party/bounds_checking_function/include",
58  ]
59  deps = [
60    "//base/update/updater/services/applypatch:libapplypatch",
61    "//base/update/updater/services/fs_manager:libfsmanager",
62    "//third_party/googletest:gmock_main",
63    "//third_party/googletest:gtest_main",
64    "//third_party/openssl:libcrypto_static",
65    "//third_party/openssl:ssl_source",
66  ]
67  external_deps = [
68    "hiviewdfx_hilog_native:libhilog",
69    "init:libbegetutil",
70    ]
71  configs = [ "$UPDATER_TEST_ROOT:utest_config" ]
72  install_enable = true
73  part_name = "updater"
74}
75