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
14group("ark_js_moduletest") {
15  testonly = true
16  test_list = [
17    "addelementinternal",
18    "allocatearraybuffer",
19    "array",
20    "arrayfindlast",
21    "arrayflat",
22    "arrayflatmap",
23    "arrayfindindex",
24    "arrayfindlastindex",
25    "arrayforeach",
26    "arrayfrom",
27    "arrayjoin",
28    "arraymap",
29
30    # (issue 18938)
31    #"arraypop",
32    "arraytoreversed",
33    "arraytospliced",
34    "arraywith",
35    "arraysort",
36    "arrayspread",
37    "arrayprotochange",
38    "arrayshift",
39    "arrayslice",
40    "arraysplice",
41    "arktoolsgetundetectable",
42    "arktoolshavesamemap",
43    "assignproxy",
44    "async",
45    "asyncgenerator",
46    "barrier",
47    "bigint",
48    "bindfunction",
49    "bitwiseop",
50    "builtins",
51    "callframe",
52    "calltype",
53    "changelistener",
54    "class",
55    "clampedarray",
56    "compareobjecthclass",
57    "concurrent",
58    "container",
59    "createarray",
60    "createobject",
61    "dataproperty",
62    "datecase",
63    "datecompare",
64    "dateparse",
65    "decodeuricomponent",
66    "definefield",
67    "definefunc",
68    "deleteobjproperty",
69    "div",
70    "dynamicimport",
71    "dyninstruction",
72    "ecmastringtable",
73    "equal",
74    "errorhelper",
75    "errorcause",
76    "flatten",
77    "forawaitof",
78    "forin",
79    "forin_delete_property",
80    "forin_dictionary_mode",
81    "forin_empty_prototype",
82    "forin_enum_cache",
83    "forin_non_empty_prototype",
84    "forin_primitive",
85    "forin_special_object",
86    "fortest",
87    "funcprotochangeobjectandnew",
88    "functionapply",
89    "generator",
90    "getpropertybyindex",
91    "getunmappedargs",
92    "global",
93    "globalaccessor",
94    "globalrecord",
95    "globalthis",
96    "helloworld",
97    "instanceofic",
98    "intl",
99    "jsonparser",
100    "jsonstringifier",
101    "ldmodulensbyic",
102    "lexicalenv",
103    "linkedhashtable",
104    "loadicbyname",
105    "loadicbyvalue",
106    "localelowercase",
107    "mapforeach",
108    "mapget",
109    "memleakobjectcreate",
110    "merge",
111    "module",
112    "moduleImportJson",
113    "moduleLazyImport",
114    "moduleTopLevelAwait",
115    "moduleUseCjs",
116    "multiargs",
117    "multiprotoic",
118    "negintmin",
119    "newobjdynrange",
120    "object",
121    "objectcloneproperties",
122    "objectdefineproperties",
123    "objectgetownproperty",
124    "objecthasownproperty",
125    "objectkeys",
126    "objoperate",
127    "objseal",
128    "promise",
129    "propertydetector",
130    "protobuf",
131    "proxy",
132    "regressproxy",
133    "rangeerror",
134    "regexpcallthrow",
135    "regexpflagd",
136    "regressfunction",
137    "regexpmaxindex",
138    "regress",
139    "regressmathmaxmin",
140
141    #"regressdatetime",
142    "regressdefineproperty",
143    "regresssstring",
144    "require",
145    "setobjectwithproto",
146    "spreadoperator",
147    "stackoverflow",
148    "storeglobalvarIC",
149    "storeicbyname",
150    "storeicbyvalue",
151    "string",
152    "stringfromcharcode",
153    "stringlocalecompare",
154    "stringreplace",
155    "stringreplaceall",
156    "stringsplit",
157    "stubbuilder",
158    "throwdyn",
159    "throwerror",
160    "trycatch",
161    "typearray",
162    "typedarrayat",
163    "typedarrayfill",
164    "typedarrayfilter",
165    "typedarrayfindlast",
166    "typedarrayfrom",
167    "typedarraynan",
168    "typedarraysort",
169    "typedarraysubarray",
170    "typedarraytosorted",
171    "typedarraywith",
172    "typedarrayjoin",
173    "watch",
174    "weakcollectionswithsymbol",
175    "wrapperclassfunc",
176    "yieldstar",
177    "esmnestedimportcjs",
178    "regexp",
179    "deregistermodule",
180    "getpropertybyic",
181    "regressbufferdetach",
182    "regressdate",
183    "regresssuper",
184    "objectfreeze",
185    "sharedcheck",
186    "sharedarray",
187    "sharedtypedarray",
188    "sharedcollectionsexception",
189    "definesendableclass",
190    "sendableenv",
191    "sendablefunc",
192    "sendablecontext",
193    "sendableclassuseimport",
194    "sharedmodule",
195    "sharedset",
196    "sharedmap",
197    "sharedJSON",
198    "sharedic",
199    "sendable",
200  ]
201
202  deps = []
203  foreach(test, test_list) {
204    deps += [ "${test}:${test}Action" ]
205    if (!is_debug) {
206      deps += [ "${test}:${test}ContextAction" ]
207    }
208  }
209
210  if (!is_debug) {
211    release_test_list = [
212      "multiconstpoolclass",
213      "multiconstpoolconstructor",
214      "multiconstpoolfunc",
215      "multiconstpoolobj",
216    ]
217
218    foreach(test, release_test_list) {
219      deps += [
220        "${test}:${test}Action",
221        "${test}:${test}ContextAction",
222      ]
223    }
224  }
225}
226
227group("ark_js_assert_moduletest") {
228  testonly = true
229  assert_test_list = [ "addpropertybyname" ]
230
231  deps = []
232  foreach(test, assert_test_list) {
233    deps += [ "${test}:${test}AssertAction" ]
234    if (!is_debug) {
235      deps += [ "${test}:${test}ContextAssertAction" ]
236    }
237  }
238
239  if (!is_debug) {
240    release_test_assert_list = [
241      "hugearray",
242      "hugeictest",
243      "multiconstpoolarray",
244    ]
245
246    foreach(test, release_test_assert_list) {
247      deps += [
248        "${test}:${test}AssertAction",
249        "${test}:${test}ContextAssertAction",
250      ]
251    }
252  }
253}
254
255group("ark_asm_test") {
256  testonly = true
257  test_list = [
258    "addelementinternal",
259    "allocatearraybuffer",
260    "allocatesizeoverflow",
261    "array",
262    "arrayfindlast",
263    "arrayfill",
264    "arrayflat",
265    "arrayflatmap",
266    "arrayfindlastindex",
267    "arrayfindindex",
268    "arrayforeach",
269    "arrayjoin",
270    "arraymap",
271
272    # (issue 18938)
273    #"arraypop",
274    "arraysort",
275    "arrayspread",
276    "arrayprotochange",
277    "arrayshift",
278    "arrayslice",
279    "assignproxy",
280    "barrier",
281    "bigint",
282    "bindfunction",
283    "bitwiseop",
284    "builtins",
285    "callframe",
286    "calltype",
287    "changelistener",
288    "class",
289    "compareobjecthclass",
290    "concurrent",
291    "container",
292    "createobject",
293    "dataproperty",
294    "dateparse",
295    "datetimezone",
296
297    # "datetimezonetitleid",
298    "decodeuricomponent",
299    "definefield",
300    "definefunc",
301    "deleteobjproperty",
302    "div",
303    "dynamicimport",
304    "dyninstruction",
305    "ecmastringtable",
306    "elements_kind",
307    "equal",
308    "errorcause",
309    "flatten",
310    "forin",
311    "forin_delete_property",
312    "forin_dictionary_mode",
313    "forin_empty_prototype",
314    "forin_enum_cache",
315    "forin_non_empty_prototype",
316    "forin_primitive",
317    "forin_special_object",
318    "fortest",
319    "funcprotochangeobjectandnew",
320    "functionapply",
321    "generator",
322    "getunmappedargs",
323    "global",
324    "globalaccessor",
325    "globalrecord",
326    "globalthis",
327    "helloworld",
328    "ictest",
329    "instanceofic",
330    "intl",
331    "jsonparser",
332    "jsonstringifier",
333    "ldmodulensbyic",
334    "lexicalenv",
335    "linkedhashtable",
336    "loadicbyvalue",
337    "mapforeach",
338    "mapget",
339    "module",
340    "multiargs",
341    "multiprotoic",
342    "negintmin",
343    "newobjdynrange",
344    "number",
345    "objectcloneproperties",
346    "objecthasownproperty",
347    "objectkeys",
348    "objoperate",
349    "objseal",
350    "promise",
351    "propertydetector",
352    "proxy",
353    "rangeerror",
354    "regexpcallthrow",
355    "regexpflagd",
356    "regressparseInt",
357    "setobjectwithproto",
358    "spreadoperator",
359    "stackoverflow",
360    "string",
361    "stringreplace",
362    "stringreplaceall",
363    "stringrepeat",
364    "stringsplit",
365    "stubbuilder",
366    "throwdyn",
367    "throwerror",
368    "trycatch",
369    "typedarrayat",
370    "typedarrayfill",
371    "typedarrayfilter",
372    "typedarrayfindlast",
373    "typedarrayfrom",
374    "typedarraynan",
375    "typedarraysort",
376    "typedarraytosorted",
377    "typedarraywith",
378    "watch",
379    "weakcollectionswithsymbol",
380    "wrapperclassfunc",
381    "yieldstar",
382    "regexp",
383    "deregistermodule",
384    "getpropertybyic",
385    "sharedcheck",
386    "sharedarray",
387    "sharedtypedarray",
388    "sharedcollectionsexception",
389    "definesendableclass",
390    "sendableenv",
391    "sendablefunc",
392    "sendablecontext",
393    "sendableclassuseimport",
394    "sharedmodule",
395    "sharedset",
396    "sharedmap",
397    "sharedJSON",
398    "sharedic",
399    "sendable",
400  ]
401
402  deps = []
403  foreach(test, test_list) {
404    deps += [ "${test}:${test}AsmAction" ]
405    if (!is_debug) {
406      deps += [ "${test}:${test}AsmContextAction" ]
407    }
408  }
409
410  if (!is_debug) {
411    release_test_list = [
412      "asmstackoverflow",
413      "arrayRelease",
414      "supercallRelease",
415      "multiconstpoolclass",
416      "multiconstpoolconstructor",
417      "multiconstpoolfunc",
418      "multiconstpoolobj",
419    ]
420
421    foreach(test, release_test_list) {
422      deps += [
423        "${test}:${test}AsmAction",
424        "${test}:${test}AsmContextAction",
425      ]
426    }
427  }
428}
429
430group("ark_asm_assert_test") {
431  testonly = true
432  assert_test_list = [ "addpropertybyname" ]
433  deps = []
434
435  foreach(test, assert_test_list) {
436    deps += [ "${test}:${test}AsmAssertAction" ]
437    if (!is_debug) {
438      deps += [ "${test}:${test}AsmContextAssertAction" ]
439    }
440  }
441
442  if (!is_debug) {
443    release_test_assert_list = [
444      "hugearray",
445      "hugeictest",
446      "multiconstpoolarray",
447    ]
448
449    foreach(test, release_test_assert_list) {
450      deps += [
451        "${test}:${test}AsmAssertAction",
452        "${test}:${test}AsmContextAssertAction",
453      ]
454    }
455  }
456}
457
458group("ark_asm_single_step_test") {
459  testonly = true
460  test_list = [
461    "addelementinternal",
462    "allocatearraybuffer",
463    "allocatesizeoverflow",
464    "arrayfindindex",
465    "arrayfindlast",
466    "arrayflat",
467    "arrayflatmap",
468    "arrayfindlastindex",
469    "arrayforeach",
470    "arrayjoin",
471    "arraymap",
472
473    # (issue 18938)
474    #"arraypop",
475    "arrayprotochange",
476    "arrayshift",
477    "arrayslice",
478    "arrayspread",
479    "assignproxy",
480    "barrier",
481    "bigint",
482    "bindfunction",
483    "bitwiseop",
484    "callframe",
485    "calltype",
486    "changelistener",
487    "class",
488    "compareobjecthclass",
489    "concurrent",
490    "container",
491    "createobject",
492    "dataproperty",
493    "decodeuricomponent",
494    "definefield",
495    "dynamicimport",
496    "dyninstruction",
497    "ecmastringtable",
498    "errorcause",
499    "forin",
500    "forin_delete_property",
501    "forin_dictionary_mode",
502    "forin_empty_prototype",
503    "forin_enum_cache",
504    "forin_non_empty_prototype",
505    "forin_primitive",
506    "forin_special_object",
507    "fortest",
508    "funcprotochangeobjectandnew",
509    "functionapply",
510    "generator",
511    "getunmappedargs",
512    "global",
513    "globalaccessor",
514    "globalrecord",
515    "globalthis",
516    "helloworld",
517    "instanceofic",
518    "jsonparser",
519    "jsonstringifier",
520    "ldmodulensbyic",
521    "lexicalenv",
522    "loadicbyvalue",
523    "mapforeach",
524    "mapget",
525    "module",
526    "multiargs",
527    "multiprotoic",
528    "negintmin",
529    "newobjdynrange",
530    "objectcloneproperties",
531    "objecthasownproperty",
532    "objectkeys",
533    "objoperate",
534    "objseal",
535    "promise",
536    "propertydetector",
537    "proxy",
538    "rangeerror",
539    "regexpcallthrow",
540    "regexpflagd",
541    "setobjectwithproto",
542    "spreadoperator",
543    "stackoverflow",
544    "string",
545    "stringreplace",
546    "stringreplaceall",
547    "stringsplit",
548    "stubbuilder",
549    "throwdyn",
550    "throwerror",
551    "trycatch",
552    "typedarrayat",
553    "typedarrayfill",
554    "typedarrayfilter",
555    "typedarrayfindlast",
556    "typedarrayfrom",
557    "typedarraynan",
558    "typedarraysort",
559    "typedarraytosorted",
560    "typedarraywith",
561    "watch",
562    "weakcollectionswithsymbol",
563    "yieldstar",
564    "getpropertybyic",
565    "regressarraybuffer",
566    "sharedcheck",
567    "sharedarray",
568    "sharedtypedarray",
569    "sharedcollectionsexception",
570    "definesendableclass",
571    "sendableenv",
572    "sendablefunc",
573    "sendablecontext",
574    "sendableclassuseimport",
575    "sharedmodule",
576    "sharedic",
577    "sharedset",
578    "sharedmap",
579    "sharedJSON",
580    "sendable",
581  ]
582
583  deps = []
584  foreach(test, test_list) {
585    deps += [ "${test}:${test}AsmSingleStepAction" ]
586    if (!is_debug) {
587      deps += [ "${test}:${test}AsmSingleStepContextAction" ]
588    }
589  }
590  if (!is_debug) {
591    release_test_list = [
592      "asmstackoverflow",
593      "arrayRelease",
594      "supercallRelease",
595      "multiconstpoolclass",
596      "multiconstpoolconstructor",
597      "multiconstpoolfunc",
598      "multiconstpoolobj",
599    ]
600
601    foreach(test, release_test_list) {
602      deps += [
603        "${test}:${test}AsmSingleStepAction",
604        "${test}:${test}AsmSingleStepContextAction",
605      ]
606    }
607  }
608}
609
610group("ark_asm_single_step_assert_test") {
611  testonly = true
612  assert_test_list = [ "addpropertybyname" ]
613
614  deps = []
615  foreach(test, assert_test_list) {
616    deps += [ "${test}:${test}AsmSingleStepAssertAction" ]
617    if (!is_debug) {
618      deps += [ "${test}:${test}AsmSingleStepContextAssertAction" ]
619    }
620  }
621  if (!is_debug) {
622    release_test_assert_list = [ "multiconstpoolarray" ]
623
624    foreach(test, release_test_assert_list) {
625      deps += [
626        "${test}:${test}AsmSingleStepAssertAction",
627        "${test}:${test}AsmSingleStepContextAssertAction",
628      ]
629    }
630  }
631}
632