• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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/storage_service/storage_service_aafwk.gni")
16
17ohos_unittest("storage_daemon_clt_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  module_out_path = "storage_service/storage_service/storage_daemon"
26
27  defines = [
28    "STORAGE_LOG_TAG = \"StorageDaemon\"",
29    "LOG_DOMAIN = 0xD004301",
30  ]
31
32  if (storage_service_user_crypto_manager) {
33    defines += [ "USER_CRYPTO_MANAGER" ]
34  }
35
36  include_dirs = [
37    "${storage_daemon_path}/include",
38    "${storage_daemon_path}/client/include",
39    "${storage_daemon_path}/utils/test/common",
40    "${storage_manager_path}/include",
41    "${storage_service_common_path}/include",
42    "${storage_interface_path}/innerkits/storage_manager/native",
43  ]
44
45  sources = [
46    "${storage_daemon_path}/client/storage_daemon_client.cpp",
47    "${storage_daemon_path}/client/test/storage_daemon_client_test.cpp",
48    "${storage_daemon_path}/utils/test/common/help_utils.cpp",
49    "${storage_manager_path}/mock/storage_daemon_proxy_mock.cpp",
50  ]
51
52  deps = [
53    "${storage_daemon_path}:storage_common_utils",
54    "${storage_daemon_path}:storage_daemon_header",
55    "${storage_daemon_path}/libfscrypt:libfscryptutils",
56  ]
57
58  external_deps = [
59    "c_utils:utils",
60    "googletest:gmock_main",
61    "googletest:gtest_main",
62    "hilog:libhilog",
63    "init:libbegetutil",
64    "ipc:ipc_single",
65    "samgr:samgr_proxy",
66  ]
67}
68
69ohos_unittest("storage_daemon_client_sub_test") {
70  branch_protector_ret = "pac_ret"
71  sanitize = {
72    integer_overflow = true
73    cfi = true
74    cfi_cross_dso = true
75    debug = false
76    blocklist = "${storage_service_path}/cfi_blocklist.txt"
77  }
78  module_out_path = "storage_service/storage_service/storage_daemon"
79
80  defines = [
81    "STORAGE_LOG_TAG = \"StorageDaemon\"",
82    "LOG_DOMAIN = 0xD004301",
83    "private=public",
84  ]
85
86  if (storage_service_user_crypto_manager) {
87    defines += [ "USER_CRYPTO_MANAGER" ]
88  }
89
90  include_dirs = [
91    "${storage_daemon_path}/include",
92    "${storage_daemon_path}/ipc/test/",
93    "${storage_daemon_path}/client/include",
94    "${storage_daemon_path}/utils/test/common",
95    "${storage_manager_path}/include",
96    "${storage_service_common_path}/include",
97    "${storage_interface_path}/innerkits/storage_manager/native",
98  ]
99
100  sources = [
101    "${storage_daemon_path}/client/storage_daemon_client.cpp",
102    "${storage_daemon_path}/client/test/storage_daemon_client_sub_test.cpp",
103    "${storage_daemon_path}/utils/test/common/help_utils.cpp",
104    "${storage_manager_path}/innerkits_impl/src/storage_file_raw_data.cpp",
105  ]
106
107  deps = [
108    "${storage_daemon_path}:storage_common_utils",
109    "${storage_daemon_path}:storage_daemon_ipc",
110    "${storage_daemon_path}/libfscrypt:libfscryptutils",
111  ]
112
113  external_deps = [
114    "c_utils:utils",
115    "googletest:gmock_main",
116    "googletest:gtest_main",
117    "hicollie:libhicollie",
118    "hilog:libhilog",
119    "init:libbegetutil",
120    "ipc:ipc_single",
121    "safwk:system_ability_fwk",
122    "samgr:samgr_proxy",
123  ]
124}
125
126group("storage_daemon_client_test") {
127  testonly = true
128  deps = [
129    ":storage_daemon_client_sub_test",
130    ":storage_daemon_clt_test",
131  ]
132}
133