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  ]
33
34  if (storage_service_user_crypto_manager) {
35    defines += [ "USER_CRYPTO_MANAGER" ]
36  }
37
38  include_dirs = [
39    "$ROOT_DIR/include",
40    "$ROOT_DIR/utils",
41    "${storage_service_common_path}/include",
42  ]
43
44  sources = [
45    "$ROOT_DIR/crypto/test/key_manager_mock.cpp",
46    "$ROOT_DIR/quota/quota_manager.cpp",
47    "$ROOT_DIR/user/src/mount_manager.cpp",
48    "$ROOT_DIR/user/src/user_manager.cpp",
49    "$ROOT_DIR/user/test/user_manager_test.cpp",
50    "$ROOT_DIR/utils/mount_argument_utils.cpp",
51    "$ROOT_DIR/utils/test/common/help_utils.cpp",
52  ]
53
54  deps = [
55    "$ROOT_DIR:storage_common_utils",
56    "//third_party/googletest:gtest_main",
57  ]
58
59  external_deps = [
60    "ability_base:zuri",
61    "app_file_service:fileuri_native",
62    "app_file_service:sandbox_helper_native",
63    "bundle_framework:appexecfwk_core",
64    "c_utils:utils",
65    "hilog:libhilog",
66    "hisysevent:libhisysevent",
67    "huks:libhukssdk",
68    "init:libbegetutil",
69    "ipc:ipc_single",
70    "ipc:libdbinder",
71  ]
72
73  if (storage_service_dfs_service) {
74    defines += [ "DFS_SERVICE" ]
75    external_deps += [ "dfs_service:cloud_daemon_kit_inner" ]
76  }
77}
78
79group("storage_daemon_user_test") {
80  testonly = true
81  deps = [ ":user_manager_test" ]
82}
83