• 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("cloud_sync_service_stub_test") {
18  module_out_path = "filemanagement/dfs_service"
19
20  sources = [
21    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_service_stub.cpp",
22    "cloud_sync_service_stub_test.cpp",
23  ]
24
25  include_dirs = [
26    "${services_path}/cloudsyncservice/include/ipc",
27    "${services_path}/cloudsyncservice/include",
28    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
29  ]
30
31  deps = [
32    "${services_path}/cloudsyncservice:cloudsync_sa",
33    "${utils_path}:libdistributedfileutils",
34    "//third_party/googletest:gmock_main",
35    "//third_party/googletest:gtest_main",
36  ]
37
38  external_deps = [
39    "ability_base:want",
40    "ability_base:zuri",
41    "ability_runtime:dataobs_manager",
42    "dfs_service:cloudsync_kit_inner",
43    "hilog:libhilog",
44    "ipc:ipc_core",
45    "safwk:system_ability_fwk",
46    "samgr:samgr_proxy",
47  ]
48
49  defines = [ "private=public" ]
50
51  use_exceptions = true
52}
53
54ohos_unittest("cloud_sync_service_test") {
55  module_out_path = "filemanagement/dfs_service"
56
57  sources = [
58    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp",
59    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp",
60    "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp",
61    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp",
62    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/battery_status_mock.cpp",
63    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/cloud_status_mock.cpp",
64    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/network_status_mock.cpp",
65    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/sdk_helper_mock.cpp",
66    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/src/base_column.cpp",
67    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/src/media_column.cpp",
68    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/src/photo_album_column.cpp",
69    "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/src/photo_map_column.cpp",
70    "${services_path}/cloudsyncservice/src/data_sync/data_handler.cpp",
71    "${services_path}/cloudsyncservice/src/data_sync/data_sync_const.cpp",
72    "${services_path}/cloudsyncservice/src/data_sync/data_sync_manager.cpp",
73    "${services_path}/cloudsyncservice/src/data_sync/data_sync_notifier.cpp",
74    "${services_path}/cloudsyncservice/src/data_sync/data_syncer.cpp",
75    "${services_path}/cloudsyncservice/src/data_sync/gallery_data_sync/album_data_handler.cpp",
76    "${services_path}/cloudsyncservice/src/data_sync/gallery_data_sync/data_convertor.cpp",
77    "${services_path}/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_convertor.cpp",
78    "${services_path}/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_handler.cpp",
79    "${services_path}/cloudsyncservice/src/data_sync/gallery_data_sync/gallery_data_syncer.cpp",
80    "${services_path}/cloudsyncservice/src/data_sync/rdb_data_handler.cpp",
81    "${services_path}/cloudsyncservice/src/data_sync/sync_state_manager.cpp",
82    "${services_path}/cloudsyncservice/src/data_sync/task.cpp",
83    "${services_path}/cloudsyncservice/src/ipc/cloud_download_callback_manager.cpp",
84    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_callback_manager.cpp",
85    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_callback_proxy.cpp",
86    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_service.cpp",
87    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_service_stub.cpp",
88    "${services_path}/cloudsyncservice/src/sync_rule/battery_status_listener.cpp",
89    "${services_path}/cloudsyncservice/src/sync_rule/net_conn_callback_observer.cpp",
90    "cloud_sync_service_test.cpp",
91  ]
92
93  include_dirs = [
94    "${services_path}/cloudsyncservice/include/ipc",
95    "${services_path}/cloudsyncservice/include",
96    "${services_path}/cloudsyncservice/include/data_sync",
97    "${services_path}/cloudsyncservice/include/data_sync/gallery_data_sync",
98    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
99    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
100    "${media_library_path}/frameworks/services/media_thumbnail/include",
101    "${media_library_path}/frameworks/utils/include",
102    "${distributedfile_path}/adapter/cloud_adapter_example/include",
103  ]
104
105  deps = [
106    "${utils_path}:libdistributedfiledentry",
107    "${utils_path}:libdistributedfileutils",
108    "//third_party/googletest:gmock_main",
109    "//third_party/googletest:gtest_main",
110  ]
111
112  external_deps = [
113    "ability_base:want",
114    "ability_base:zuri",
115    "ability_runtime:dataobs_manager",
116    "common_event_service:cesfwk_innerkits",
117    "dfs_service:cloudsync_kit_inner",
118    "hilog:libhilog",
119    "init:libbegetutil",
120    "ipc:ipc_core",
121    "netmanager_base:net_conn_manager_if",
122    "relational_store:native_rdb",
123    "safwk:system_ability_fwk",
124    "samgr:samgr_proxy",
125  ]
126
127  defines = [
128    "private=public",
129    "LOG_DOMAIN=0xD004307",
130    "LOG_TAG=\"CLOUDSYNC_TEST\"",
131  ]
132
133  use_exceptions = true
134}
135
136ohos_unittest("cloud_sync_callback_proxy_test") {
137  module_out_path = "filemanagement/dfs_service"
138
139  sources = [
140    "${services_path}/cloudsyncservice/src/ipc/cloud_sync_callback_proxy.cpp",
141    "cloudsync_callback_proxy_test.cpp",
142  ]
143
144  include_dirs = [
145    "${services_path}/cloudsyncservice/include",
146    "${services_path}/cloudsyncservice/include/ipc",
147    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
148  ]
149
150  deps = [
151    "${services_path}/cloudsyncservice:cloudsync_sa",
152    "${utils_path}:libdistributedfileutils",
153    "//third_party/googletest:gmock_main",
154    "//third_party/googletest:gtest_main",
155  ]
156
157  external_deps = [
158    "ability_base:want",
159    "ability_base:zuri",
160    "ability_runtime:dataobs_manager",
161    "dfs_service:cloudsync_kit_inner",
162    "hilog:libhilog",
163    "ipc:ipc_core",
164    "safwk:system_ability_fwk",
165    "samgr:samgr_proxy",
166  ]
167
168  defines = [ "private=public" ]
169
170  use_exceptions = true
171}
172
173ohos_unittest("cloud_sync_callback_manager_test") {
174  module_out_path = "filemanagement/dfs_service"
175
176  sources = [ "cloudsync_callback_manager_test.cpp" ]
177
178  include_dirs = [
179    "${services_path}/cloudsyncservice/include/ipc",
180    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
181  ]
182
183  deps = [
184    "${services_path}/cloudsyncservice:cloudsync_sa",
185    "${utils_path}:libdistributedfileutils",
186    "//third_party/googletest:gmock_main",
187    "//third_party/googletest:gtest_main",
188  ]
189
190  external_deps = [
191    "ability_base:want",
192    "ability_base:zuri",
193    "ability_runtime:dataobs_manager",
194    "dfs_service:cloudsync_kit_inner",
195    "hilog:libhilog",
196    "ipc:ipc_core",
197    "safwk:system_ability_fwk",
198    "samgr:samgr_proxy",
199  ]
200
201  defines = [
202    "private=public",
203    "protected=public",
204  ]
205
206  use_exceptions = true
207}
208
209ohos_unittest("cloud_download_callback_manager_test") {
210  module_out_path = "filemanagement/dfs_service"
211
212  sources = [
213    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_container.cpp",
214    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_database.cpp",
215    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp",
216    "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp",
217    "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp",
218    "cloud_download_callback_manager_test.cpp",
219  ]
220
221  include_dirs = [
222    "${services_path}/cloudsyncservice/include/ipc",
223    "${services_path}/cloudsyncservice/src/ipc",
224    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
225    "${distributedfile_path}/test/unittests/cloudsync_sa/data_sync",
226    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
227    "${distributedfile_path}/adapter/cloud_adapter_example/include",
228    "${distributedfile_path}/services/cloudsyncservice/include/data_sync",
229
230    "${services_path}/cloudsyncservice/include",
231    "${services_path}/cloudsyncservice/include/data_sync",
232    "${services_path}/cloudsyncservice/include/data_sync/gallery_data_sync",
233    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
234    "${media_library_path}/interfaces/inner_api/media_library_helper/include",
235    "${media_library_path}/frameworks/services/media_thumbnail/include",
236    "${media_library_path}/frameworks/utils/include",
237  ]
238
239  deps = [
240    "${services_path}/cloudsyncservice:cloudsync_sa",
241    "${utils_path}:libdistributedfiledentry",
242    "${utils_path}:libdistributedfileutils",
243    "//third_party/googletest:gmock_main",
244    "//third_party/googletest:gtest_main",
245  ]
246
247  external_deps = [
248    "ability_base:want",
249    "ability_base:zuri",
250    "ability_runtime:dataobs_manager",
251    "dfs_service:cloudsync_kit_inner",
252    "hilog:libhilog",
253    "init:libbegetutil",
254    "ipc:ipc_core",
255    "netmanager_base:net_conn_manager_if",
256    "relational_store:native_rdb",
257    "safwk:system_ability_fwk",
258    "samgr:samgr_proxy",
259  ]
260
261  defines = [
262    "private=public",
263    "protected=public",
264
265    "LOG_DOMAIN=0xD004310",
266    "LOG_TAG=\"DATA_SYNC_TEST\"",
267  ]
268
269  use_exceptions = true
270}
271
272ohos_unittest("cloud_download_callback_proxy_test") {
273  module_out_path = "filemanagement/dfs_service"
274
275  sources = [
276    "${services_path}/cloudsyncservice/src/ipc/cloud_download_callback_proxy.cpp",
277    "cloud_download_callback_proxy_test.cpp",
278  ]
279
280  include_dirs = [
281    "${services_path}/cloudsyncservice/include",
282    "${services_path}/cloudsyncservice/include/ipc",
283    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
284  ]
285
286  deps = [
287    "${services_path}/cloudsyncservice:cloudsync_sa",
288    "${utils_path}:libdistributedfiledentry",
289    "${utils_path}:libdistributedfileutils",
290    "//third_party/googletest:gmock_main",
291    "//third_party/googletest:gtest_main",
292  ]
293
294  external_deps = [
295    "ability_base:want",
296    "dfs_service:cloudsync_kit_inner",
297    "hilog:libhilog",
298    "init:libbegetutil",
299    "ipc:ipc_core",
300    "netmanager_base:net_conn_manager_if",
301    "relational_store:native_rdb",
302    "safwk:system_ability_fwk",
303    "samgr:samgr_proxy",
304  ]
305
306  defines = [ "private=public" ]
307
308  use_exceptions = true
309}
310
311group("cloudsync_sa_ipc_test") {
312  testonly = true
313  deps = [
314    ":cloud_download_callback_proxy_test",
315    ":cloud_sync_callback_proxy_test",
316    ":cloud_sync_service_stub_test",
317  ]
318}
319