• 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.
13import("//build/test.gni")
14import("//foundation/filemanagement/dfs_service/distributedfile.gni")
15
16ohos_unittest("cloud_sync_callback_client_test") {
17  module_out_path = "filemanagement/dfs_service"
18
19  sources = [ "cloud_sync_callback_client_test.cpp" ]
20
21  include_dirs = [
22    "${services_path}/cloudsyncservice/include/ipc",
23    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
24    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
25  ]
26
27  deps = [
28    "${utils_path}:libdistributedfileutils",
29    "//third_party/googletest:gmock_main",
30    "//third_party/googletest:gtest_main",
31  ]
32
33  external_deps = [
34    "dfs_service:cloudsync_kit_inner",
35    "hilog:libhilog",
36    "ipc:ipc_core",
37  ]
38
39  defines = [ "private=public" ]
40
41  use_exceptions = true
42}
43
44ohos_unittest("cloud_sync_callback_stub_test") {
45  module_out_path = "filemanagement/dfs_service"
46
47  sources = [ "cloud_sync_callback_stub_test.cpp" ]
48
49  include_dirs = [
50    "${services_path}/cloudsyncservice/include/ipc",
51    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
52    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
53  ]
54
55  deps = [
56    "${utils_path}:libdistributedfileutils",
57    "//third_party/googletest:gmock_main",
58    "//third_party/googletest:gtest_main",
59  ]
60
61  external_deps = [
62    "dfs_service:cloudsync_kit_inner",
63    "hilog:libhilog",
64    "ipc:ipc_core",
65  ]
66
67  defines = [ "private=public" ]
68
69  use_exceptions = true
70}
71
72ohos_unittest("cloud_sync_manager_impl_test") {
73  module_out_path = "filemanagement/dfs_service"
74
75  sources = [
76    "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_mock.cpp",
77    "cloud_sync_manager_impl_test.cpp",
78  ]
79
80  include_dirs = [
81    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
82    "${services_path}/cloudsyncservice/include/ipc",
83    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
84    "${distributedfile_path}/test/mock/ipc",
85    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
86  ]
87
88  deps = [
89    "${services_path}/cloudsyncservice:cloudsync_sa",
90    "${utils_path}:libdistributedfileutils",
91    "//third_party/googletest:gmock_main",
92    "//third_party/googletest:gtest_main",
93  ]
94
95  external_deps = [
96    "dfs_service:cloudsync_kit_inner",
97    "hilog:libhilog",
98    "ipc:ipc_core",
99  ]
100
101  defines = [ "private=public" ]
102
103  use_exceptions = true
104}
105
106ohos_unittest("cloud_sync_manager_impl_unnomal_test") {
107  module_out_path = "filemanagement/dfs_service"
108
109  sources = [
110    "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_unnomal_mock.cpp",
111    "cloud_sync_manager_impl_unnomal_test.cpp",
112  ]
113
114  include_dirs = [
115    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
116    "${services_path}/cloudsyncservice/include/ipc",
117    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
118    "${distributedfile_path}/test/mock/ipc",
119    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
120  ]
121
122  deps = [
123    "${services_path}/cloudsyncservice:cloudsync_sa",
124    "${utils_path}:libdistributedfileutils",
125    "//third_party/googletest:gmock_main",
126    "//third_party/googletest:gtest_main",
127  ]
128
129  external_deps = [
130    "dfs_service:cloudsync_kit_inner",
131    "hilog:libhilog",
132    "ipc:ipc_core",
133  ]
134
135  defines = [ "private=public" ]
136
137  use_exceptions = true
138}
139
140ohos_unittest("cloud_sync_manager_test") {
141  module_out_path = "filemanagement/dfs_service"
142
143  sources = [ "cloud_sync_manager_test.cpp" ]
144
145  include_dirs = [
146    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
147    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
148  ]
149
150  deps = [
151    "${utils_path}:libdistributedfileutils",
152    "//third_party/googletest:gmock_main",
153    "//third_party/googletest:gtest_main",
154  ]
155
156  external_deps = [
157    "dfs_service:cloudsync_kit_inner",
158    "hilog:libhilog",
159    "ipc:ipc_core",
160  ]
161
162  defines = [ "private=public" ]
163
164  use_exceptions = true
165}
166
167ohos_unittest("cloud_sync_service_proxy_test") {
168  module_out_path = "filemanagement/dfs_service"
169
170  sources = [ "cloud_sync_service_proxy_test.cpp" ]
171
172  include_dirs = [
173    "${services_path}/cloudsyncservice/include/ipc",
174    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
175    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
176  ]
177
178  deps = [
179    "${utils_path}:libdistributedfileutils",
180    "//third_party/googletest:gmock_main",
181    "//third_party/googletest:gtest_main",
182  ]
183
184  external_deps = [
185    "dfs_service:cloudsync_kit_inner",
186    "hilog:libhilog",
187    "ipc:ipc_core",
188  ]
189
190  defines = [ "private=public" ]
191
192  use_exceptions = true
193}
194
195ohos_unittest("cloud_download_callback_client_test") {
196  module_out_path = "filemanagement/dfs_service"
197
198  sources = [ "cloud_download_callback_client_test.cpp" ]
199
200  include_dirs = [
201    "${services_path}/cloudsyncservice/include/ipc",
202    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
203    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
204    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
205  ]
206
207  deps = [
208    "${utils_path}:libdistributedfileutils",
209    "//third_party/googletest:gmock_main",
210    "//third_party/googletest:gtest_main",
211  ]
212
213  external_deps = [
214    "dfs_service:cloudsync_kit_inner",
215    "hilog:libhilog",
216    "ipc:ipc_core",
217  ]
218
219  defines = [
220    "private=public",
221    "LOG_DOMAIN=0xD004307",
222    "LOG_TAG=\"CLOUDSYNC_TEST\"",
223  ]
224
225  use_exceptions = true
226}
227
228ohos_unittest("cloud_download_callback_stub_test") {
229  module_out_path = "filemanagement/dfs_service"
230
231  sources = [
232    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_download_callback_stub.cpp",
233    "../../../mock/cloud_download_uri_manager_hook.cpp",
234    "cloud_download_callback_stub_test.cpp",
235  ]
236
237  include_dirs = [
238    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
239    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
240    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
241  ]
242
243  deps = [
244    "${utils_path}:libdistributedfileutils",
245    "//third_party/googletest:gmock_main",
246    "//third_party/googletest:gtest_main",
247  ]
248
249  external_deps = [
250    "dfs_service:cloudsync_kit_inner",
251    "hilog:libhilog",
252    "ipc:ipc_core",
253  ]
254
255  defines = [
256    "private=public",
257    "protected=public",
258    "LOG_DOMAIN=0xD004307",
259    "LOG_TAG=\"CLOUDSYNC_TEST\"",
260  ]
261
262  use_exceptions = true
263}
264
265ohos_unittest("cloud_download_uri_manager_test") {
266  module_out_path = "filemanagement/dfs_service"
267
268  sources = [ "cloud_download_uri_manager_test.cpp" ]
269
270  include_dirs = [
271    "${services_path}/cloudsyncservice/include/ipc",
272    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
273    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
274  ]
275
276  deps = [
277    "${utils_path}:libdistributedfileutils",
278    "//third_party/googletest:gmock_main",
279    "//third_party/googletest:gtest_main",
280  ]
281
282  external_deps = [
283    "dfs_service:cloudsync_kit_inner",
284    "hilog:libhilog",
285    "ipc:ipc_core",
286  ]
287
288  defines = [ "private=public" ]
289
290  use_exceptions = true
291}
292
293ohos_unittest("cloud_sync_common_test") {
294  module_out_path = "filemanagement/dfs_service"
295
296  sources = [
297    "cloud_sync_common_test.cpp",
298    "file_hook/parcel.cpp",
299  ]
300
301  include_dirs = [
302    "${services_path}/cloudsyncservice/include/ipc",
303    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
304    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
305  ]
306
307  deps = [
308    "${utils_path}:libdistributedfileutils",
309    "//third_party/googletest:gmock_main",
310    "//third_party/googletest:gtest_main",
311  ]
312
313  external_deps = [
314    "dfs_service:cloudsync_kit_inner",
315    "ipc:ipc_core",
316  ]
317
318  defines = [ "private=public" ]
319
320  use_exceptions = true
321}
322
323ohos_unittest("cloud_sync_asset_manager_impl_test") {
324  module_out_path = "filemanagement/dfs_service"
325
326  sources = [
327    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager_impl.cpp",
328    "cloud_sync_asset_manager_impl_test.cpp",
329  ]
330
331  include_dirs = [
332    "${services_path}/cloudsyncservice/include/ipc",
333    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
334    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
335  ]
336
337  deps = [
338    "${utils_path}:libdistributedfileutils",
339    "//third_party/googletest:gmock_main",
340    "//third_party/googletest:gtest_main",
341  ]
342
343  external_deps = [
344    "dfs_service:cloudsync_kit_inner",
345    "hilog:libhilog",
346    "ipc:ipc_core",
347  ]
348
349  defines = [ "private=public" ]
350
351  use_exceptions = true
352}
353
354ohos_unittest("cloud_sync_asset_manager_impl_unnomal_test") {
355  module_out_path = "filemanagement/dfs_service"
356
357  sources = [
358    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_asset_manager_impl.cpp",
359    "${distributedfile_path}/test/mock/ipc/cloud_sync_service_proxy_unnomal_mock.cpp",
360    "cloud_sync_asset_manager_impl_unnomal_test.cpp",
361  ]
362
363  include_dirs = [
364    "${services_path}/cloudsyncservice/include/ipc",
365    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
366    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
367  ]
368
369  deps = [
370    "${utils_path}:libdistributedfileutils",
371    "//third_party/googletest:gmock_main",
372    "//third_party/googletest:gtest_main",
373  ]
374
375  external_deps = [
376    "dfs_service:cloudsync_asset_kit_inner",
377    "hilog:libhilog",
378    "ipc:ipc_core",
379  ]
380
381  defines = [ "private=public" ]
382
383  use_exceptions = true
384}
385
386ohos_unittest("cloud_sync_asset_manager_test") {
387  module_out_path = "filemanagement/dfs_service"
388
389  sources = [ "cloud_sync_asset_manager_test.cpp" ]
390
391  include_dirs = [
392    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include",
393    "${distributedfile_path}/interfaces/inner_api/native/cloudsync_kit_inner",
394  ]
395
396  deps = [
397    "${utils_path}:libdistributedfileutils",
398    "//third_party/googletest:gmock_main",
399    "//third_party/googletest:gtest_main",
400  ]
401
402  external_deps = [
403    "dfs_service:cloudsync_asset_kit_inner",
404    "hilog:libhilog",
405    "ipc:ipc_core",
406  ]
407
408  defines = [ "private=public" ]
409
410  use_exceptions = true
411}
412
413group("cloudsync_impl_test") {
414  testonly = true
415
416  deps = [
417    ":cloud_download_callback_client_test",
418    ":cloud_download_callback_stub_test",
419    ":cloud_download_uri_manager_test",
420    ":cloud_sync_asset_manager_impl_test",
421    ":cloud_sync_asset_manager_impl_unnomal_test",
422    ":cloud_sync_asset_manager_test",
423    ":cloud_sync_callback_client_test",
424    ":cloud_sync_callback_stub_test",
425    ":cloud_sync_common_test",
426    ":cloud_sync_manager_impl_test",
427    ":cloud_sync_manager_impl_unnomal_test",
428    ":cloud_sync_manager_test",
429    ":cloud_sync_service_proxy_test",
430  ]
431}
432