1# Copyright (c) 2021-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/storage_service/storage_service_aafwk.gni") 16 17ROOT_DIR = "$storage_daemon_path" 18 19ohos_unittest("user_manager_test") { 20 branch_protector_ret = "pac_ret" 21 sanitize = { 22 integer_overflow = true 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 } 27 module_out_path = "storage_service/storage_daemon" 28 29 defines = [ 30 "STORAGE_LOG_TAG = \"StorageDaemon\"", 31 "LOG_DOMAIN = 0xD004301", 32 "private=public", 33 ] 34 35 if (storage_service_user_crypto_manager) { 36 defines += [ "USER_CRYPTO_MANAGER" ] 37 } 38 39 include_dirs = [ 40 "$ROOT_DIR/include", 41 "$ROOT_DIR/utils", 42 "${storage_service_common_path}/include", 43 ] 44 45 sources = [ 46 "$ROOT_DIR/crypto/test/key_manager_mock.cpp", 47 "$ROOT_DIR/quota/quota_manager.cpp", 48 "$ROOT_DIR/user/src/mount_manager.cpp", 49 "$ROOT_DIR/user/src/user_manager.cpp", 50 "$ROOT_DIR/user/test/user_manager_test.cpp", 51 "$ROOT_DIR/utils/mount_argument_utils.cpp", 52 "$ROOT_DIR/utils/test/common/help_utils.cpp", 53 ] 54 55 deps = [ 56 "$ROOT_DIR:storage_common_utils", 57 "//third_party/googletest:gtest_main", 58 ] 59 60 external_deps = [ 61 "ability_base:zuri", 62 "app_file_service:fileuri_native", 63 "app_file_service:sandbox_helper_native", 64 "bundle_framework:appexecfwk_core", 65 "c_utils:utils", 66 "hilog:libhilog", 67 "hisysevent:libhisysevent", 68 "huks:libhukssdk", 69 "init:libbegetutil", 70 "ipc:ipc_single", 71 "ipc:libdbinder", 72 ] 73 74 if (storage_service_dfs_service) { 75 defines += [ "DFS_SERVICE" ] 76 external_deps += [ "dfs_service:cloud_daemon_kit_inner" ] 77 } 78} 79 80group("storage_daemon_user_test") { 81 testonly = true 82 deps = [ ":user_manager_test" ] 83} 84