• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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")
15import("//foundation/filemanagement/app_file_service/backup.gni")
16
17ohos_unittest("b_incremental_session_test") {
18  module_out_path = path_module_out_tests
19
20  sanitize = {
21    integer_overflow = true
22    ubsan = true
23    boundary_sanitize = true
24    cfi = true
25    cfi_cross_dso = true
26    cfi_vcall_icall_only = true
27    debug = false
28    blocklist = "${path_backup}/cfi_blocklist.txt"
29  }
30
31  include_dirs = [
32    "${path_backup}/frameworks/native/backup_kit_inner/include",
33    "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl",
34    "${path_backup}/services/backup_sa/include",
35    "${path_backup}/services/backup_sa/include/module_notify",
36    "${path_backup}/utils/include",
37    "${path_backup}/utils/src",
38    "${path_backup}/tests/mock/utils_mock/include",
39    ".",
40    "session",
41  ]
42
43  sources = [
44    "${path_backup}/frameworks/native/backup_kit_inner/src/b_file_info.cpp",
45    "${path_backup}/frameworks/native/backup_kit_inner/src/b_incremental_backup_session.cpp",
46    "${path_backup}/frameworks/native/backup_kit_inner/src/b_incremental_data.cpp",
47    "${path_backup}/frameworks/native/backup_kit_inner/src/b_incremental_restore_session.cpp",
48    "${path_backup}/frameworks/native/backup_kit_inner/src/b_incremental_session_restore_async.cpp",
49    "${path_backup}/frameworks/native/backup_kit_inner/src/service_incremental_reverse.cpp",
50    "${path_backup}/frameworks/native/backup_kit_inner/src/service_reverse.cpp",
51    "${path_backup}/tests/mock/utils_mock/src/utils_mock_global_variable.cpp",
52    "b_incremental_session_test.cpp",
53    "service_client_mock.cpp",
54    "service_proxy_mock.cpp",
55  ]
56
57  public_configs = [ "${path_backup}/services/backup_sa:public_idl_config" ]
58
59  deps = [
60    "${path_backup}/services/backup_sa:backup_sa_ipc_stub",
61    "${path_backup}/utils:backup_utils",
62  ]
63
64  defines = [
65    "LOG_TAG=\"app_file_service\"",
66    "LOG_DOMAIN=0xD200000",
67    "private = public",
68    "protected = public",
69  ]
70
71  external_deps = [
72    "c_utils:utils",
73    "googletest:gmock_main",
74    "googletest:gtest_main",
75    "hilog:libhilog",
76    "hitrace:hitrace_meter",
77    "ipc:ipc_core",
78    "safwk:system_ability_fwk",
79    "samgr:samgr_proxy",
80  ]
81
82  use_exceptions = true
83}
84
85group("session_test") {
86  testonly = true
87  deps = [ ":b_incremental_session_test" ]
88}
89