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