1# Copyright (c) 2022-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("//build/test.gni") 15import("//foundation/filemanagement/app_file_service/backup.gni") 16 17ohos_unittest("b_file_info_test") { 18 branch_protector_ret = "pac_ret" 19 sanitize = { 20 integer_overflow = true 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 } 25 26 module_out_path = path_module_out_tests 27 28 sources = [ 29 "${path_backup}/frameworks/native/backup_kit_inner/src/b_file_info.cpp", 30 "b_file_info_test.cpp", 31 ] 32 sources += backup_mock_parcel_src 33 34 include_dirs = 35 [ "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl" ] 36 include_dirs += backup_mock_parcel_include_dirs 37 38 deps = [ 39 "${path_backup}/tests/utils:backup_test_utils", 40 "${path_backup}/utils:backup_utils", 41 ] 42 43 external_deps = [ "hilog:libhilog" ] 44 45 use_exceptions = true 46} 47 48ohos_unittest("backup_sa_impl_test") { 49 branch_protector_ret = "pac_ret" 50 51 module_out_path = path_module_out_tests 52 53 sources = [ 54 "${path_backup_mock}/system_ability_manager/service_registry_mock.cpp", 55 "${path_backup_mock}/utils_mock/src/utils_mock_global_variable.cpp", 56 "service_proxy_test.cpp", 57 "service_reverse_stub_test.cpp", 58 "service_reverse_test.cpp", 59 "svc_death_recipient_test.cpp", 60 ] 61 62 include_dirs = [ 63 "${path_backup}/services/backup_sa/include", 64 "${path_backup}/frameworks/native/backup_kit_inner/include", 65 "${path_backup}/tests/unittests/backup_api/backup_impl/include", 66 "${path_backup}/interfaces/inner_api/native/backup_kit_inner/impl", 67 ] 68 include_dirs += backup_mock_utils_include 69 70 deps = [ 71 "${path_backup}/interfaces/inner_api/native/backup_kit_inner:backup_kit_inner", 72 "${path_backup}/tests/utils:backup_test_utils", 73 "${path_backup}/utils:backup_utils", 74 "${path_googletest}:gmock_main", 75 ] 76 77 external_deps = [ 78 "c_utils:utils", 79 "hilog:libhilog", 80 "hitrace:hitrace_meter", 81 "init:libbegetutil", 82 "ipc:ipc_core", 83 "samgr:samgr_proxy", 84 ] 85 86 sanitize = { 87 integer_overflow = true 88 cfi = true 89 cfi_cross_dso = true 90 debug = false 91 blocklist = "${path_backup}/cfi_blocklist.txt" 92 } 93 94 use_exceptions = true 95} 96 97group("backup_impl_test") { 98 testonly = true 99 100 deps = [ 101 ":b_file_info_test", 102 ":backup_sa_impl_test", 103 ] 104} 105