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