• 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/distributeddatamgr/udmf/udmf.gni")
15
16module_output_path = "udmf/innerkitsImpl"
17
18###############################################################################
19config("module_private_config") {
20  include_dirs = [
21    "${udmf_interfaces_path}/innerkits/client",
22    "${udmf_interfaces_path}/innerkits/common",
23    "${udmf_interfaces_path}/innerkits/data",
24    "${udmf_interfaces_path}/innerkits/convert",
25    "${udmf_interfaces_path}/ndk/data",
26    "${udmf_framework_path}/common",
27    "${udmf_framework_path}/innerkits/service",
28    "${udmf_framework_path}/innerkitsimpl/client/",
29    "${udmf_framework_path}/innerkitsimpl/test/unittest/mock/include",
30    "${udmf_framework_path}/ndkimpl/data",
31  ]
32}
33
34common_deps = [
35  "${udmf_interfaces_path}/innerkits:udmf_client",
36  "${udmf_interfaces_path}/innerkits:utd_client",
37  "${udmf_interfaces_path}/ndk:libudmf",
38]
39
40common_external_deps = [
41  "ability_base:want",
42  "access_token:libaccesstoken_sdk",
43  "access_token:libnativetoken",
44  "access_token:libtoken_setproc",
45  "bundle_framework:appexecfwk_core",
46  "c_utils:utils",
47  "hilog:libhilog",
48  "image_framework:image",
49  "image_framework:image",
50  "image_framework:image_native",
51  "image_framework:pixelmap",
52  "ipc:ipc_core",
53  "kv_store:distributeddata_inner",
54  "samgr:samgr_proxy",
55]
56
57ohos_unittest("UdmfClientTest") {
58  module_out_path = module_output_path
59
60  sources = [
61    "${udmf_framework_path}/common/graph.cpp",
62    "${udmf_framework_path}/innerkitsimpl/convert/udmf_conversion.cpp",
63    "${udmf_framework_path}/innerkitsimpl/service/udmf_service_proxy.cpp",
64    "udmf_client_test.cpp",
65  ]
66
67  configs = [ ":module_private_config" ]
68
69  deps = common_deps
70
71  external_deps = common_external_deps
72}
73
74ohos_unittest("UdmfClientSystemHapTest") {
75  module_out_path = module_output_path
76
77  sources = [ "udmf_client_system_hap_test.cpp" ]
78
79  configs = [ ":module_private_config" ]
80
81  deps = common_deps
82
83  external_deps = common_external_deps
84}
85
86ohos_unittest("UdmfClientHapPermissionTest") {
87  module_out_path = module_output_path
88
89  sources = [ "udmf_client_hap_permission_test.cpp" ]
90
91  include_dirs = [
92    "${udmf_interfaces_path}/innerkits/client",
93    "${udmf_interfaces_path}/innerkits/common",
94    "${udmf_interfaces_path}/innerkits/data",
95    "${udmf_interfaces_path}/innerkits/convert",
96    "${udmf_framework_path}/common",
97    "${udmf_framework_path}/innerkits/service",
98    "${udmf_framework_path}/innerkitsimpl/client/",
99    "${udmf_framework_path}/innerkitsimpl/test/unittest/mock/include",
100  ]
101
102  deps = common_deps
103
104  external_deps = common_external_deps
105}
106
107ohos_unittest("UdmfClientSaInvokeTest") {
108  module_out_path = module_output_path
109
110  sources = [ "udmf_client_sa_invoke_test.cpp" ]
111
112  deps = [ "${udmf_interfaces_path}/innerkits:udmf_client" ]
113
114  external_deps = common_external_deps
115}
116
117ohos_unittest("UdmfAsyncClientTest") {
118  module_out_path = module_output_path
119
120  sources = [ "udmf_async_client_test.cpp" ]
121
122  deps = common_deps
123
124  external_deps = common_external_deps
125}
126
127ohos_unittest("UtdClientTest") {
128  module_out_path = module_output_path
129
130  sources = [
131    "${udmf_framework_path}/common/graph.cpp",
132    "custom_utd_json_parser_test.cpp",
133    "custom_utd_store_test.cpp",
134    "graph_test.cpp",
135    "utd_client_test.cpp",
136  ]
137
138  configs = [ ":module_private_config" ]
139
140  deps = [ "${udmf_interfaces_path}/innerkits:utd_client" ]
141
142  external_deps = common_external_deps
143}
144
145ohos_unittest("NdkDataConversionTest") {
146  module_out_path = module_output_path
147
148  sources = [ "ndk_data_conversion_test.cpp" ]
149
150  configs = [ ":module_private_config" ]
151
152  deps = common_deps
153
154  external_deps = common_external_deps
155}
156
157ohos_unittest("ApplicationDefineRecordTest") {
158  module_out_path = module_output_path
159
160  sources = [ "application_defined_record_test.cpp" ]
161
162  deps = common_deps
163
164  external_deps = common_external_deps
165
166  defines = [
167    "private=public",
168    "protected=public",
169  ]
170}
171
172ohos_unittest("AudioTest") {
173  module_out_path = module_output_path
174
175  sources = [ "audio_test.cpp" ]
176
177  deps = common_deps
178
179  external_deps = common_external_deps
180
181  defines = [
182    "private=public",
183    "protected=public",
184  ]
185}
186
187ohos_unittest("FileDataTest") {
188  module_out_path = module_output_path
189
190  sources = [ "file_test.cpp" ]
191
192  configs = [ ":module_private_config" ]
193
194  deps = common_deps
195
196  external_deps = common_external_deps
197
198  defines = [
199    "private=public",
200    "protected=public",
201  ]
202}
203
204ohos_unittest("FlexibleTypeTest") {
205  module_out_path = module_output_path
206
207  sources = [ "flexible_type_test.cpp" ]
208
209  deps = common_deps
210
211  external_deps = common_external_deps
212
213  defines = [
214    "private=public",
215    "protected=public",
216  ]
217}
218
219ohos_unittest("FolderTest") {
220  module_out_path = module_output_path
221
222  sources = [ "folder_test.cpp" ]
223
224  deps = common_deps
225
226  external_deps = common_external_deps
227
228  defines = [
229    "private=public",
230    "protected=public",
231  ]
232}
233
234ohos_unittest("HtmlTest") {
235  module_out_path = module_output_path
236
237  sources = [ "html_test.cpp" ]
238
239  deps = common_deps
240
241  external_deps = common_external_deps
242
243  defines = [
244    "private=public",
245    "protected=public",
246  ]
247}
248
249ohos_unittest("ImageTest") {
250  module_out_path = module_output_path
251
252  sources = [ "image_test.cpp" ]
253
254  deps = common_deps
255
256  external_deps = common_external_deps
257
258  defines = [
259    "private=public",
260    "protected=public",
261  ]
262}
263
264ohos_unittest("LinkTest") {
265  module_out_path = module_output_path
266
267  sources = [ "link_test.cpp" ]
268
269  deps = common_deps
270
271  external_deps = common_external_deps
272
273  defines = [
274    "private=public",
275    "protected=public",
276  ]
277}
278
279ohos_unittest("PlainTextTest") {
280  module_out_path = module_output_path
281
282  sources = [ "plain_text_test.cpp" ]
283
284  deps = common_deps
285
286  external_deps = common_external_deps
287
288  defines = [
289    "private=public",
290    "protected=public",
291  ]
292}
293
294ohos_unittest("SystemDefinedAppitemTest") {
295  module_out_path = module_output_path
296
297  sources = [ "system_defined_appitem_test.cpp" ]
298
299  deps = common_deps
300
301  external_deps = common_external_deps
302
303  defines = [
304    "private=public",
305    "protected=public",
306  ]
307}
308
309ohos_unittest("SystemDefinedFormTest") {
310  module_out_path = module_output_path
311
312  sources = [ "system_defined_form_test.cpp" ]
313
314  deps = common_deps
315
316  external_deps = common_external_deps
317
318  defines = [
319    "private=public",
320    "protected=public",
321  ]
322}
323
324ohos_unittest("SystemDefinedPixelMapTest") {
325  module_out_path = module_output_path
326
327  sources = [ "system_defined_pixelmap_test.cpp" ]
328
329  deps = common_deps
330
331  external_deps = common_external_deps
332
333  defines = [
334    "private=public",
335    "protected=public",
336  ]
337}
338
339ohos_unittest("SystemDefinedRecordTest") {
340  module_out_path = module_output_path
341
342  sources = [ "system_defined_record_test.cpp" ]
343
344  deps = common_deps
345
346  external_deps = common_external_deps
347
348  defines = [
349    "private=public",
350    "protected=public",
351  ]
352}
353
354ohos_unittest("TextTest") {
355  module_out_path = module_output_path
356
357  sources = [ "text_test.cpp" ]
358
359  deps = common_deps
360
361  external_deps = common_external_deps
362
363  defines = [
364    "private=public",
365    "protected=public",
366  ]
367}
368
369ohos_unittest("UnifiedDataTest") {
370  module_out_path = module_output_path
371
372  sources = [ "unified_data_test.cpp" ]
373
374  deps = common_deps
375
376  external_deps = common_external_deps
377
378  defines = [
379    "private=public",
380    "protected=public",
381  ]
382}
383
384###############################################################################
385group("unittest") {
386  testonly = true
387
388  deps = [
389    ":ApplicationDefineRecordTest",
390    ":AudioTest",
391    ":FileDataTest",
392    ":FlexibleTypeTest",
393    ":FolderTest",
394    ":HtmlTest",
395    ":ImageTest",
396    ":LinkTest",
397    ":NdkDataConversionTest",
398    ":PlainTextTest",
399    ":SystemDefinedAppitemTest",
400    ":SystemDefinedFormTest",
401    ":SystemDefinedPixelMapTest",
402    ":SystemDefinedRecordTest",
403    ":TextTest",
404    ":UdmfAsyncClientTest",
405    ":UdmfClientHapPermissionTest",
406    ":UdmfClientSaInvokeTest",
407    ":UdmfClientSystemHapTest",
408    ":UdmfClientTest",
409    ":UnifiedDataTest",
410    ":UtdClientTest",
411  ]
412}
413###############################################################################
414