• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 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/dfs_service/distributedfile.gni")
16
17ohos_unittest("fuse_manager_test") {
18  module_out_path = "filemanagement/dfs_service"
19
20  sources = [
21    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_asset_read_session.cpp",
22    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_assets_downloader.cpp",
23    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_container.cpp",
24    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_database.cpp",
25    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp",
26    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp",
27    "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp",
28    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
29    "fuse_manager_test.cpp",
30  ]
31
32  cloud_disk = [
33    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
34    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
35    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
36    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
37    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
38  ]
39
40  sources += cloud_disk
41
42  include_dirs = [
43    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
44    "${distributedfile_path}/services/cloudfiledaemon/include",
45    "//third_party/libfuse/include",
46    "//third_party/libfuse/lib",
47    "${services_path}/cloudfiledaemon/include/cloud_disk/",
48    "${services_path}/cloudsyncservice/include/data_sync/",
49    "${distributedfile_path}/adapter/cloud_adapter_example/include",
50    "${clouddisk_database_path}/include",
51    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
52    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
53    "${media_library_path}/frameworks/utils/include",
54  ]
55
56  deps = [
57    "${clouddisk_database_path}:clouddisk_database",
58    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
59    "${utils_path}:libdistributedfiledentry",
60    "${utils_path}:libdistributedfileutils",
61    "//third_party/googletest:gmock_main",
62    "//third_party/googletest:gtest_main",
63    "//third_party/libfuse:libfuse",
64  ]
65
66  external_deps = [
67    "hilog:libhilog",
68    "ipc:ipc_single",
69    "relational_store:native_rdb",
70  ]
71
72  defines = [
73    "private=public",
74    "LOG_DOMAIN=0xD004308",
75    "LOG_TAG=\"CloudFileDaemon\"",
76  ]
77
78  use_exceptions = true
79  part_name = "dfs_service"
80  subsystem_name = "filemanagement"
81}
82
83ohos_unittest("cloud_daemon_test") {
84  module_out_path = "filemanagement/dfs_service"
85
86  sources = [
87    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_asset_read_session.cpp",
88    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_assets_downloader.cpp",
89    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_container.cpp",
90    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_database.cpp",
91    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp",
92    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp",
93    "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp",
94    "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp",
95    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp",
96    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
97    "cloud_daemon_test.cpp",
98  ]
99
100  cloud_disk = [
101    "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp",
102    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp",
103    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp",
104    "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp",
105    "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp",
106  ]
107
108  sources += cloud_disk
109
110  include_dirs = [
111    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
112    "${distributedfile_path}/services/cloudfiledaemon/include",
113    "//third_party/libfuse/include",
114    "//third_party/libfuse/lib",
115    "${services_path}/cloudfiledaemon/include/cloud_disk/",
116    "${services_path}/cloudsyncservice/include/data_sync/",
117    "${distributedfile_path}/adapter/cloud_adapter_example/include",
118    "${clouddisk_database_path}/include",
119    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include",
120    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
121    "${media_library_path}/frameworks/utils/include",
122  ]
123
124  deps = [
125    "${clouddisk_database_path}:clouddisk_database",
126    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
127    "${utils_path}:libdistributedfiledentry",
128    "${utils_path}:libdistributedfileutils",
129    "//third_party/googletest:gmock_main",
130    "//third_party/googletest:gtest_main",
131    "//third_party/libfuse:libfuse",
132  ]
133
134  external_deps = [
135    "hilog:libhilog",
136    "ipc:ipc_single",
137    "relational_store:native_rdb",
138    "safwk:system_ability_fwk",
139    "samgr:samgr_proxy",
140  ]
141
142  defines = [
143    "private=public",
144    "LOG_DOMAIN=0xD004308",
145    "LOG_TAG=\"CloudFileDaemon\"",
146  ]
147
148  use_exceptions = true
149  part_name = "dfs_service"
150  subsystem_name = "filemanagement"
151}
152
153ohos_unittest("cloud_daemon_stub_test") {
154  module_out_path = "filemanagement/dfs_service"
155
156  sources = [
157    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_asset_read_session.cpp",
158    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_assets_downloader.cpp",
159    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_container.cpp",
160    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_database.cpp",
161    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp",
162    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp",
163    "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp",
164    "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp",
165    "cloud_daemon_stub_test.cpp",
166  ]
167
168  include_dirs = [
169    "${distributedfile_path}/services/cloudfiledaemon/include",
170    "//third_party/libfuse/include",
171    "//third_party/libfuse/lib",
172    "${services_path}/cloudsyncservice/include/data_sync/",
173    "${distributedfile_path}/adapter/cloud_adapter_example/include",
174  ]
175
176  deps = [
177    "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner",
178    "${utils_path}:libdistributedfiledentry",
179    "${utils_path}:libdistributedfileutils",
180    "//third_party/googletest:gmock_main",
181    "//third_party/googletest:gtest_main",
182    "//third_party/libfuse:libfuse",
183  ]
184
185  external_deps = [
186    "hilog:libhilog",
187    "ipc:ipc_single",
188    "safwk:system_ability_fwk",
189    "samgr:samgr_proxy",
190  ]
191
192  defines = [
193    "private=public",
194    "LOG_DOMAIN=0xD004308",
195    "LOG_TAG=\"CloudFileDaemon\"",
196  ]
197
198  use_exceptions = true
199  part_name = "dfs_service"
200  subsystem_name = "filemanagement"
201}
202
203group("services_daemon_test") {
204  testonly = true
205
206  deps = [
207    ":cloud_daemon_stub_test",
208    ":fuse_manager_test",
209  ]
210}
211