• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//arkcompiler/ets_runtime/js_runtime_config.gni")
15import("//arkcompiler/ets_runtime/test/test_helper.gni")
16
17module_output_path = "ets_runtime"
18
19host_unittest_action("JSHelper_ArrayHelper_Test") {
20  module_out_path = module_output_path
21
22  sources = [
23    # test file
24    "array_helper_test.cpp",
25  ]
26
27  configs = [
28    "../../../:ecma_test_config",
29    "../../../:icu_path_test_config",
30  ]
31
32  deps = [ "../../../:libark_jsruntime_test" ]
33
34  # hiviewdfx libraries
35  external_deps = hiviewdfx_ext_deps
36  external_deps += [
37    "icu:shared_icui18n",
38    "icu:shared_icuuc",
39    "runtime_core:libarkassembler_static",
40    "zlib:libz",
41
42    #sdk_libc_secshared_dep,
43  ]
44  deps += hiviewdfx_deps
45}
46
47host_unittest_action("JSHelper_AtomicHelper_Test") {
48  module_out_path = module_output_path
49
50  sources = [
51    # test file
52    "atomic_helper_test.cpp",
53  ]
54
55  configs = [
56    "../../../:ecma_test_config",
57    "../../../:icu_path_test_config",
58  ]
59
60  deps = [ "../../../:libark_jsruntime_test" ]
61
62  # hiviewdfx libraries
63  external_deps = hiviewdfx_ext_deps
64  external_deps += [
65    "icu:shared_icui18n",
66    "icu:shared_icuuc",
67    "runtime_core:libarkassembler_static",
68    "zlib:libz",
69
70    #sdk_libc_secshared_dep,
71  ]
72  deps += hiviewdfx_deps
73}
74
75host_unittest_action("JSHelper_BitHelper_Test") {
76  module_out_path = module_output_path
77
78  sources = [
79    # test file
80    "bit_helper_test.cpp",
81  ]
82
83  configs = [
84    "../../../:ecma_test_config",
85    "../../../:icu_path_test_config",
86  ]
87
88  deps = [ "../../../:libark_jsruntime_test" ]
89
90  # hiviewdfx libraries
91  external_deps = hiviewdfx_ext_deps
92  external_deps += [
93    "icu:shared_icui18n",
94    "icu:shared_icuuc",
95    "runtime_core:libarkassembler_static",
96    "zlib:libz",
97
98    #sdk_libc_secshared_dep,
99  ]
100  deps += hiviewdfx_deps
101}
102
103host_unittest_action("Builtins_Base_Test") {
104  module_out_path = module_output_path
105
106  sources = [
107    # test file
108    "builtins_base_test.cpp",
109  ]
110
111  configs = [
112    "../../../:ecma_test_config",
113    "../../../:icu_path_test_config",
114  ]
115
116  deps = [ "../../../:libark_jsruntime_test" ]
117
118  # hiviewdfx libraries
119  external_deps = hiviewdfx_ext_deps
120  external_deps += [
121    "icu:shared_icui18n",
122    "icu:shared_icuuc",
123    "runtime_core:libarkassembler_static",
124    "zlib:libz",
125
126    #sdk_libc_secshared_dep,
127  ]
128  deps += hiviewdfx_deps
129}
130
131host_unittest_action("JSHelper_ErrorHelper_Test") {
132  module_out_path = module_output_path
133
134  sources = [
135    # test file
136    "error_helper_test.cpp",
137  ]
138
139  configs = [
140    "../../../:ecma_test_config",
141    "../../../:icu_path_test_config",
142  ]
143
144  deps = [ "../../../:libark_jsruntime_test" ]
145
146  # hiviewdfx libraries
147  external_deps = hiviewdfx_ext_deps
148  external_deps += [
149    "icu:shared_icui18n",
150    "icu:shared_icuuc",
151    "runtime_core:libarkassembler_static",
152    "zlib:libz",
153
154    #sdk_libc_secshared_dep,
155  ]
156  deps += hiviewdfx_deps
157}
158
159host_unittest_action("JS_Ason_Test") {
160  module_out_path = module_output_path
161
162  sources = [
163    # test file
164    "ason_test.cpp",
165  ]
166
167  configs = [
168    "../../../:ecma_test_config",
169    "../../../:icu_path_test_config",
170  ]
171
172  deps = [ "../../../:libark_jsruntime_test" ]
173
174  # hiviewdfx libraries
175  external_deps = hiviewdfx_ext_deps
176  external_deps += [
177    "icu:shared_icui18n",
178    "icu:shared_icuuc",
179    "runtime_core:libarkassembler_static",
180    "zlib:libz",
181
182    #sdk_libc_secshared_dep,
183  ]
184  deps += hiviewdfx_deps
185}
186
187host_unittest_action("JSHelper_FilePathHelper_Test") {
188  module_out_path = module_output_path
189
190  sources = [
191    # test file
192    "file_path_helper_test.cpp",
193  ]
194
195  configs = [
196    "../../../:ecma_test_config",
197    "../../../:icu_path_test_config",
198  ]
199
200  deps = [ "../../../:libark_jsruntime_test" ]
201
202  # hiviewdfx libraries
203  external_deps = hiviewdfx_ext_deps
204  external_deps += [
205    "icu:shared_icui18n",
206    "icu:shared_icuuc",
207    "runtime_core:libarkassembler_static",
208    "zlib:libz",
209
210    #sdk_libc_secshared_dep,
211  ]
212  deps += hiviewdfx_deps
213}
214
215host_unittest_action("GC_RingBuffer_Test") {
216  module_out_path = module_output_path
217
218  sources = [
219    # test file
220    "gc_ring_buffer_test.cpp",
221  ]
222
223  configs = [
224    "../../../:ecma_test_config",
225    "../../../:icu_path_test_config",
226  ]
227
228  deps = [ "../../../:libark_jsruntime_test" ]
229
230  # hiviewdfx libraries
231  external_deps = hiviewdfx_ext_deps
232  external_deps += [
233    "icu:shared_icui18n",
234    "icu:shared_icuuc",
235    "runtime_core:libarkassembler_static",
236    "zlib:libz",
237
238    #sdk_libc_secshared_dep,
239  ]
240  deps += hiviewdfx_deps
241}
242
243host_unittest_action("JS_JsonParser_Test") {
244  module_out_path = module_output_path
245
246  sources = [
247    # test file
248    "json_parser_test.cpp",
249  ]
250
251  configs = [
252    "../../../:ecma_test_config",
253    "../../../:icu_path_test_config",
254  ]
255
256  deps = [ "../../../:libark_jsruntime_test" ]
257
258  # hiviewdfx libraries
259  external_deps = hiviewdfx_ext_deps
260  external_deps += [
261    "icu:shared_icui18n",
262    "icu:shared_icuuc",
263    "runtime_core:libarkassembler_static",
264    "zlib:libz",
265
266    #sdk_libc_secshared_dep,
267  ]
268  deps += hiviewdfx_deps
269}
270
271host_unittest_action("JS_JsonStringIfier_Test") {
272  module_out_path = module_output_path
273
274  sources = [
275    # test file
276    "json_stringifier_test.cpp",
277  ]
278
279  configs = [
280    "../../../:ecma_test_config",
281    "../../../:icu_path_test_config",
282  ]
283
284  deps = [ "../../../:libark_jsruntime_test" ]
285
286  # hiviewdfx libraries
287  external_deps = hiviewdfx_ext_deps
288  external_deps += [
289    "icu:shared_icui18n",
290    "icu:shared_icuuc",
291    "runtime_core:libarkassembler_static",
292    "zlib:libz",
293
294    #sdk_libc_secshared_dep,
295  ]
296  deps += hiviewdfx_deps
297}
298
299host_unittest_action("JSHelper_MathHelper_Test") {
300  module_out_path = module_output_path
301
302  sources = [
303    # test file
304    "math_helper_test.cpp",
305  ]
306
307  configs = [
308    "../../../:ecma_test_config",
309    "../../../:icu_path_test_config",
310  ]
311
312  deps = [ "../../../:libark_jsruntime_test" ]
313
314  # hiviewdfx libraries
315  external_deps = hiviewdfx_ext_deps
316  external_deps += [
317    "icu:shared_icui18n",
318    "icu:shared_icuuc",
319    "runtime_core:libarkassembler_static",
320    "zlib:libz",
321
322    #sdk_libc_secshared_dep,
323  ]
324  deps += hiviewdfx_deps
325}
326
327host_unittest_action("JSHelper_DtoaHelper_Test") {
328  module_out_path = module_output_path
329
330  sources = [
331    # test file
332    "dtoa_helper_test.cpp",
333  ]
334
335  configs = [
336    "../../../:ecma_test_config",
337    "../../../:icu_path_test_config",
338  ]
339
340  deps = [ "../../../:libark_jsruntime_test" ]
341
342  # hiviewdfx libraries
343  external_deps = hiviewdfx_ext_deps
344  external_deps += [
345    "icu:shared_icui18n",
346    "icu:shared_icuuc",
347    "runtime_core:libarkassembler_static",
348    "zlib:libz",
349
350    #sdk_libc_secshared_dep,
351  ]
352  deps += hiviewdfx_deps
353}
354
355host_unittest_action("JSHelper_NumberHelper_Test") {
356  module_out_path = module_output_path
357
358  sources = [
359    # test file
360    "number_helper_test.cpp",
361  ]
362
363  configs = [
364    "../../../:ecma_test_config",
365    "../../../:icu_path_test_config",
366  ]
367
368  deps = [ "../../../:libark_jsruntime_test" ]
369
370  # hiviewdfx libraries
371  external_deps = hiviewdfx_ext_deps
372  external_deps += [
373    "icu:shared_icui18n",
374    "icu:shared_icuuc",
375    "runtime_core:libarkassembler_static",
376    "zlib:libz",
377
378    #sdk_libc_secshared_dep,
379  ]
380  deps += hiviewdfx_deps
381}
382
383host_unittest_action("JSHelper_StringHelper_Test") {
384  module_out_path = module_output_path
385
386  sources = [
387    # test file
388    "string_helper_test.cpp",
389  ]
390
391  configs = [
392    "../../../:ecma_test_config",
393    "../../../:icu_path_test_config",
394  ]
395
396  deps = [ "../../../:libark_jsruntime_test" ]
397
398  # hiviewdfx libraries
399  external_deps = hiviewdfx_ext_deps
400  external_deps += [
401    "icu:shared_icui18n",
402    "icu:shared_icuuc",
403    "runtime_core:libarkassembler_static",
404    "zlib:libz",
405
406    #sdk_libc_secshared_dep,
407  ]
408  deps += hiviewdfx_deps
409}
410
411host_unittest_action("JSHelper_TypeArrayHelper_Test") {
412  module_out_path = module_output_path
413
414  sources = [
415    # test file
416    "typed_array_helper_test.cpp",
417  ]
418
419  configs = [
420    "../../../:ecma_test_config",
421    "../../../:icu_path_test_config",
422  ]
423
424  deps = [ "../../../:libark_jsruntime_test" ]
425
426  # hiviewdfx libraries
427  external_deps = hiviewdfx_ext_deps
428  external_deps += [
429    "icu:shared_icui18n",
430    "icu:shared_icuuc",
431    "runtime_core:libarkassembler_static",
432    "zlib:libz",
433
434    #sdk_libc_secshared_dep,
435  ]
436  deps += hiviewdfx_deps
437}
438
439host_unittest_action("JSHelper_UtfHelper_Test") {
440  module_out_path = module_output_path
441
442  sources = [
443    # test file
444    "utf_helper_test.cpp",
445  ]
446
447  configs = [
448    "../../../:ecma_test_config",
449    "../../../:icu_path_test_config",
450  ]
451
452  deps = [ "../../../:libark_jsruntime_test" ]
453
454  # hiviewdfx libraries
455  external_deps = hiviewdfx_ext_deps
456  external_deps += [
457    "icu:shared_icui18n",
458    "icu:shared_icuuc",
459    "runtime_core:libarkassembler_static",
460    "zlib:libz",
461
462    #sdk_libc_secshared_dep,
463  ]
464  deps += hiviewdfx_deps
465}
466
467group("unittest") {
468  testonly = true
469
470  # deps file
471  deps = [
472    ":Builtins_Base_Test",
473    ":GC_RingBuffer_Test",
474    ":JSHelper_ArrayHelper_Test",
475    ":JSHelper_AtomicHelper_Test",
476    ":JSHelper_BitHelper_Test",
477    ":JSHelper_DtoaHelper_Test",
478    ":JSHelper_ErrorHelper_Test",
479    ":JSHelper_FilePathHelper_Test",
480    ":JSHelper_MathHelper_Test",
481    ":JSHelper_NumberHelper_Test",
482    ":JSHelper_StringHelper_Test",
483    ":JSHelper_TypeArrayHelper_Test",
484    ":JSHelper_UtfHelper_Test",
485    ":JS_Ason_Test",
486    ":JS_JsonParser_Test",
487    ":JS_JsonStringIfier_Test",
488  ]
489}
490
491group("host_unittest") {
492  testonly = true
493
494  # deps file
495  deps = [
496    ":Builtins_Base_TestAction",
497    ":GC_RingBuffer_TestAction",
498    ":JSHelper_ArrayHelper_TestAction",
499    ":JSHelper_AtomicHelper_TestAction",
500    ":JSHelper_BitHelper_TestAction",
501    ":JSHelper_DtoaHelper_TestAction",
502    ":JSHelper_ErrorHelper_TestAction",
503    ":JSHelper_FilePathHelper_TestAction",
504    ":JSHelper_MathHelper_TestAction",
505    ":JSHelper_NumberHelper_TestAction",
506    ":JSHelper_StringHelper_TestAction",
507    ":JSHelper_TypeArrayHelper_TestAction",
508    ":JSHelper_UtfHelper_TestAction",
509    ":JS_Ason_TestAction",
510    ":JS_JsonParser_TestAction",
511    ":JS_JsonStringIfier_TestAction",
512  ]
513  if (is_mac) {
514    deps -= [
515      ":Builtins_Base_TestAction",
516      ":GC_RingBuffer_TestAction",
517      ":JSHelper_ArrayHelper_TestAction",
518      ":JSHelper_AtomicHelper_TestAction",
519      ":JSHelper_BitHelper_TestAction",
520      ":JSHelper_DtoaHelper_TestAction",
521      ":JSHelper_ErrorHelper_TestAction",
522      ":JSHelper_FilePathHelper_TestAction",
523      ":JSHelper_MathHelper_TestAction",
524      ":JSHelper_NumberHelper_TestAction",
525      ":JSHelper_StringHelper_TestAction",
526      ":JSHelper_TypeArrayHelper_TestAction",
527      ":JSHelper_UtfHelper_TestAction",
528      ":JS_Ason_TestAction",
529      ":JS_JsonParser_TestAction",
530      ":JS_JsonStringIfier_TestAction",
531    ]
532  }
533}
534