• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023-2024 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/dfs_service/distributedfile.gni")
16
17ohos_unittest("fuse_manager_test") {
18  module_out_path = "filemanagement/dfs_service"
19
20  sources = [
21    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
22    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
23    "fuse_manager_test.cpp",
24  ]
25
26  cloud_disk = [
27    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
28    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
29    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
30    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
31    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
32  ]
33
34  sources += cloud_disk
35
36  include_dirs = [
37    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
38    "${distributedfile_path}/services/cloudfiledaemon/include",
39    "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager",
40    "${services_path}/cloudfiledaemon/include/cloud_disk/",
41    "${distributedfile_path}/adapter/cloud_adapter_example/include",
42    "${clouddisk_database_path}/include",
43    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
44    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
45    "${media_library_path}/frameworks/utils/include",
46  ]
47
48  deps = [
49    "${clouddisk_database_path}:clouddisk_database",
50    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
51    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
52    "${utils_path}:libdistributedfiledentry",
53    "${utils_path}:libdistributedfileutils",
54    "//third_party/googletest:gmock_main",
55    "//third_party/googletest:gtest_main",
56  ]
57
58  external_deps = [
59    "ability_base:zuri",
60    "ability_runtime:dataobs_manager",
61    "c_utils:utils",
62    "ffrt:libffrt",
63    "hilog:libhilog",
64    "hisysevent:libhisysevent",
65    "hitrace:hitrace_meter",
66    "init:libbegetutil",
67    "ipc:ipc_single",
68    "libfuse:libfuse",
69    "relational_store:native_rdb",
70  ]
71
72  defines = [
73    "private=public",
74    "LOG_DOMAIN=0xD004308",
75    "LOG_TAG=\"CloudFileDaemon\"",
76  ]
77
78  if (cloudsync_service_hicollie_enable) {
79    external_deps += [ "hicollie:libhicollie" ]
80    defines += [ "HICOLLIE_ENABLE" ]
81  }
82
83  use_exceptions = true
84  part_name = "dfs_service"
85  subsystem_name = "filemanagement"
86}
87
88ohos_unittest("cloud_daemon_statistic_test") {
89  module_out_path = "filemanagement/dfs_service"
90
91  sources = [
92    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
93    "cloud_daemon_statistic_test.cpp",
94  ]
95
96  cloud_disk = [
97    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
98    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
99    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
100    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
101    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
102  ]
103
104  sources += cloud_disk
105
106  include_dirs = [
107    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
108    "${distributedfile_path}/services/cloudfiledaemon/include",
109    "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager",
110    "${services_path}/cloudfiledaemon/include/cloud_disk/",
111    "${distributedfile_path}/adapter/cloud_adapter_example/include",
112    "${clouddisk_database_path}/include",
113    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
114    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
115    "${media_library_path}/frameworks/utils/include",
116  ]
117
118  deps = [
119    "${clouddisk_database_path}:clouddisk_database",
120    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
121    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
122    "${utils_path}:libdistributedfiledentry",
123    "${utils_path}:libdistributedfileutils",
124    "//third_party/googletest:gmock_main",
125    "//third_party/googletest:gtest_main",
126  ]
127
128  external_deps = [
129    "ability_base:zuri",
130    "ability_runtime:dataobs_manager",
131    "ffrt:libffrt",
132    "hilog:libhilog",
133    "hitrace:hitrace_meter",
134    "init:libbegetutil",
135    "ipc:ipc_single",
136    "libfuse:libfuse",
137    "relational_store:native_rdb",
138  ]
139
140  defines = [
141    "private=public",
142    "LOG_DOMAIN=0xD004308",
143    "LOG_TAG=\"CloudFileDaemon\"",
144  ]
145
146  if (cloudsync_service_hicollie_enable) {
147    external_deps += [ "hicollie:libhicollie" ]
148    defines += [ "HICOLLIE_ENABLE" ]
149  }
150
151  use_exceptions = true
152  part_name = "dfs_service"
153  subsystem_name = "filemanagement"
154}
155
156ohos_unittest("cloud_daemon_test") {
157  module_out_path = "filemanagement/dfs_service"
158
159  sources = [
160    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp",
161    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
162    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp",
163    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
164    "cloud_daemon_test.cpp",
165  ]
166
167  cloud_disk = [
168    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
169    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
170    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
171    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
172    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
173  ]
174
175  sources += cloud_disk
176
177  include_dirs = [
178    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
179    "${distributedfile_path}/services/cloudfiledaemon/include",
180    "${services_path}/cloudfiledaemon/include/cloud_disk/",
181    "${distributedfile_path}/adapter/cloud_adapter_example/include",
182    "${clouddisk_database_path}/include",
183    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
184    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
185    "${media_library_path}/frameworks/utils/include",
186  ]
187
188  deps = [
189    "${clouddisk_database_path}:clouddisk_database",
190    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
191    "${utils_path}:libdistributedfiledentry",
192    "${utils_path}:libdistributedfileutils",
193    "//third_party/googletest:gmock_main",
194    "//third_party/googletest:gtest_main",
195  ]
196
197  external_deps = [
198    "ability_base:zuri",
199    "ability_runtime:dataobs_manager",
200    "c_utils:utils",
201    "ffrt:libffrt",
202    "hilog:libhilog",
203    "hitrace:hitrace_meter",
204    "ipc:ipc_single",
205    "libfuse:libfuse",
206    "relational_store:native_rdb",
207    "safwk:system_ability_fwk",
208    "samgr:samgr_proxy",
209  ]
210
211  defines = [
212    "private=public",
213    "LOG_DOMAIN=0xD004308",
214    "LOG_TAG=\"CloudFileDaemon\"",
215  ]
216
217  if (cloudsync_service_hicollie_enable) {
218    external_deps += [ "hicollie:libhicollie" ]
219    defines += [ "HICOLLIE_ENABLE" ]
220  }
221
222  use_exceptions = true
223  part_name = "dfs_service"
224  subsystem_name = "filemanagement"
225}
226
227ohos_unittest("cloud_daemon_stub_test") {
228  module_out_path = "filemanagement/dfs_service"
229
230  sources = [
231    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
232    "cloud_daemon_stub_test.cpp",
233  ]
234
235  include_dirs = [
236    "${distributedfile_path}/services/cloudfiledaemon/include",
237    "${services_path}/cloudsyncservice/include/data_sync/",
238    "${distributedfile_path}/adapter/cloud_adapter_example/include",
239  ]
240
241  deps = [
242    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
243    "${utils_path}:libdistributedfiledentry",
244    "${utils_path}:libdistributedfileutils",
245    "//third_party/googletest:gmock_main",
246    "//third_party/googletest:gtest_main",
247  ]
248
249  external_deps = [
250    "c_utils:utils",
251    "hilog:libhilog",
252    "ipc:ipc_single",
253    "libfuse:libfuse",
254    "safwk:system_ability_fwk",
255    "samgr:samgr_proxy",
256  ]
257
258  defines = [
259    "private=public",
260    "LOG_DOMAIN=0xD004308",
261    "LOG_TAG=\"CloudFileDaemon\"",
262  ]
263
264  use_exceptions = true
265  part_name = "dfs_service"
266  subsystem_name = "filemanagement"
267}
268
269group("services_daemon_test") {
270  testonly = true
271
272  deps = [
273    ":cloud_daemon_statistic_test",
274    ":cloud_daemon_stub_test",
275    ":fuse_manager_test",
276  ]
277}
278