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