• 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")
15
16module_test_list = [
17  "addelementinternal",
18  "allocatearraybuffer",
19  "arrayderived",
20  "arraypushproto",
21  "arraySome",
22  "arrayEvery",
23  "arrayspeciescreate",
24  "arrayconstructor",
25  "arrayspliceproto",
26  "arrayunshiftproto",
27  "arrayfillproto",
28  "arrayconcat",
29  "arrayfind",
30  "arrayfindlast",
31  "arrayfill",
32  "arrayflat",
33  "arrayflatmap",
34  "arrayfindindex",
35  "arrayfindlastindex",
36  "arrayforeach",
37  "arrayfrom",
38  "arrayjoin",
39  "arraymap",
40  "getiterator",
41  "arraypop",
42  "arraytoreversed",
43  "arraytospliced",
44  "arraywith",
45  "arraystablecheck",
46  "arraysort",
47  "arrayspread",
48  "arrayprotochange",
49  "arrayshift",
50  "arrayslice",
51  "arraysplice",
52  "arktoolsgetundetectable",
53  "arktoolshavesamemap",
54  "assignproxy",
55  "asyncgenerator",
56  "asyncUseLazyValue",
57  "barrier",
58  "bigint",
59  "bindfunction",
60  "bitwiseop",
61  "builtins",
62  "callframe",
63  "calltype",
64  "changelistener",
65  "changelistener2",
66  "class",
67  "clampedarray",
68  "compareobjecthclass",
69  "concurrent",
70  "container",
71  "createarray",
72  "createobject",
73  "dataproperty",
74  "datecase",
75  "datecompare",
76  "dateparse",
77  "datetimezone",
78  "definefield",
79  "definefunc",
80  "definemethod",
81  "deleteobjproperty",
82  "div",
83  "dynamicimport",
84  "dynamicimportcontext",
85  "dyninstruction",
86  "ecmastringtable",
87  "internstring",
88  "equal",
89  "errorhelper",
90  "errorcause",
91  "exp",
92  "flatten",
93  "forawaitof",
94  "forin",
95  "forin_delete_property",
96  "forin_dictionary_mode",
97  "forin_empty_prototype",
98  "forin_enum_cache",
99  "forin_enum_cache_chain",
100  "forin_non_empty_prototype",
101  "forin_primitive",
102  "forin_special_object",
103  "fortest",
104  "funcprotochangeobjectandnew",
105  "functionapply",
106  "generator",
107  "getdeletedelementsat",
108  "getpropertybyindex",
109  "getunmappedargs",
110  "global",
111  "globalaccessor",
112  "globalrecord",
113  "globalthis",
114  "helloworld",
115  "ictest",
116  "includesindexof",
117  "instanceofic",
118  "intl",
119  "memleakobjectcreate",
120  "merge",
121  "module",
122  "moduleHandleException",
123  "moduleImportJson",
124  "moduleLazyImport",
125  "moduleTopLevelAwait",
126  "moduleUseCjs",
127  "multiargs",
128  "multiprotoic",
129  "negintmin",
130  "newobjdynrange",
131  "newtaggedsubarray",
132  "nextinternalslowpath",
133  "object",
134  "typedarraymapoverflow",
135  "objectcloneproperties",
136  "objectdefineproperties",
137  "objectgetownproperty",
138  "objecthasownproperty",
139  "objectkeys",
140  "objoperate",
141  "objseal",
142  "promise",
143  "promiseUseLazyValue",
144  "promiseUseLazyValueInDynamic",
145  "propertydetector",
146
147  #"protobuf",
148  "proxy",
149  "realm",
150  "regressproxy",
151  "rangeerror",
152  "regexpcallthrow",
153  "regexpflagd",
154  "regressfunction",
155  "regexpmaxindex",
156  "regress",
157  "regressparseInt",
158  "regressmathmaxmin",
159
160  "string",
161  "stringlocalecompare",
162  "stringrepeat",
163  "sharedcheck",
164  "sharedarray",
165  "shareduse",
166  "enum_cache_sendable",
167  "sharedtypedarray",
168  "sharedcollectionsexception",
169  "definesendableclass",
170  "sendableenv",
171  "sendablefunc",
172  "sendablecontext",
173  "sendableclassuseimport",
174  "sharedmodule",
175  "sharedset",
176  "sharedset_extern",
177  "sharedmap",
178  "sharedJSON",
179  "sharedic",
180  "sendable",
181  "sendablearray",
182  "sharedobjectstorebarrier_treestring",
183]
184
185# TODO: CMC-GC UT FIX LATER
186if (ets_runtime_enable_cmc_gc) {
187  module_test_list -= [
188    "allocatearraybuffer",
189    "builtins",
190    "object",
191  ]
192}
193
194group("ark_js_moduletest") {
195  testonly = true
196  test_list = module_test_list
197  test_list += [ "async" ]  # asm interpreter run too long
198  deps = []
199  foreach(test, test_list) {
200    deps += [ "${test}:${test}Action" ]
201    if (!is_debug) {
202      deps += [ "${test}:${test}ContextAction" ]
203    }
204  }
205
206  if (!is_debug) {
207    release_test_list = [ "typedarrayrelease" ]
208
209    foreach(test, release_test_list) {
210      deps += [
211        "${test}:${test}Action",
212        "${test}:${test}ContextAction",
213      ]
214    }
215  }
216}
217
218group("ark_js_assert_moduletest") {
219  testonly = true
220  assert_test_list = [
221    "array",
222    "addpropertybyname",
223    "cowarray",
224    "decodeuricomponent",
225    "isin",
226    "jsonparser",
227    "jsonstringifier",
228    "ldmodulensbyic",
229    "lexicalenv",
230    "arrch64stackoverflow",
231    "linkedhashtable",
232    "loadicbyname",
233    "loadicbyvalue",
234    "localelowercase",
235    "mapforeach",
236    "mapget",
237    "obj_dictionarymode",
238    "regressdefineproperty",
239    "regresssstring",
240    "require",
241    "setobjectwithproto",
242    "spreadoperator",
243    "stackoverflow",
244    "storeglobalvarIC",
245    "storeicbyname",
246    "storeicbyvalue",
247    "stringfromcharcode",
248    "stringreplace",
249    "stringreplaceall",
250    "stringsplit",
251    "stubbuilder",
252    "stable_hclass",
253    "throwdyn",
254    "throwerror",
255    "trycatch",
256    "typearray",
257    "typedarrayat",
258    "typedarrayfill",
259    "typedarrayfilter",
260    "typedarrayfindlast",
261    "typedarrayfrom",
262
263    #"typedarrayfrom_in_api14",
264    "typedarrayiterator",
265    "typedarraymap",
266    "typedarraynan",
267    "typedarrayreverse",
268    "typedarraysort",
269    "typedarraysubarray",
270    "typedarraytosorted",
271    "typedarraywith",
272    "typedarrayjoin",
273    "watch",
274    "weakcollectionswithsymbol",
275    "wrapperclassfunc",
276    "yieldstar",
277    "esmnestedimportcjs",
278    "regexp",
279    "regexpcache",
280    "deregistermodule",
281    "getpropertybyic",
282    "regressbufferdetach",
283    "regressdate",
284    "regresssuper",
285    "objectfreeze",
286    "getvaluefrombuffer",
287  ]
288
289  if (enable_next_optimization) {
290    assert_test_list += ["jsonstringifier_optimized"]
291  }
292
293  deps = []
294  foreach(test, assert_test_list) {
295    deps += [ "${test}:${test}AssertAction" ]
296    if (ark_standalone_build && host_os == "linux" && target_os == "ohos") {
297      deps += [ "${test}:${test}ActionWithQemu" ]
298    }
299    if (!is_debug) {
300      deps += [ "${test}:${test}ContextAssertAction" ]
301    }
302  }
303
304  if (!is_debug) {
305    release_test_assert_list = [
306      "hugearray",
307      "hugeictest",
308      "multiconstpoolarray",
309      "multiconstpoolclass",
310      "multiconstpoolconstructor",
311      "multiconstpoolfunc",
312      "multiconstpoolobj",
313      "proxyget",
314      "proxyrelease",
315      "proxyset",
316    ]
317
318    foreach(test, release_test_assert_list) {
319      deps += [
320        "${test}:${test}AssertAction",
321        "${test}:${test}ContextAssertAction",
322      ]
323    }
324  }
325}
326
327group("ark_asm_test") {
328  testonly = true
329  test_list = module_test_list
330  test_list += [
331    "arrayincludesindexof",  # C interpreter do not support elementskind.
332    "elements_kind",  # C interpreter do not support elementskind.
333    "allocatesizeoverflow",  # different bound check for C and ASM interpreter
334  ]
335
336  deps = []
337  foreach(test, test_list) {
338    deps += [ "${test}:${test}AsmAction" ]
339    if (!is_debug) {
340      deps += [ "${test}:${test}AsmContextAction" ]
341    }
342  }
343
344  if (!is_debug) {
345    release_test_list = [
346      "throwerrorrelease",
347      "typedarrayrelease",
348    ]
349
350    foreach(test, release_test_list) {
351      deps += [
352        "${test}:${test}AsmAction",
353        "${test}:${test}AsmContextAction",
354      ]
355    }
356  }
357}
358
359group("ark_asm_assert_test") {
360  testonly = true
361  assert_test_list = [
362    "array",
363    "addpropertybyname",
364    "cowarray",
365    "decodeuricomponent",
366    "isin",
367    "jsonparser",
368    "jsonstringifier",
369    "ldmodulensbyic",
370    "lexicalenv",
371    "linkedhashtable",
372    "loadicbyvalue",
373    "mapforeach",
374    "mapget",
375    "obj_dictionarymode",
376    "setobjectwithproto",
377    "spreadoperator",
378    "stackoverflow",
379    "stringreplace",
380    "stringreplaceall",
381    "stringsplit",
382    "stubbuilder",
383    "throwdyn",
384    "throwerror",
385    "trycatch",
386    "typearray",
387    "typedarrayat",
388    "typedarrayfill",
389    "typedarrayfilter",
390    "typedarrayfindlast",
391    "typedarrayfrom",
392
393    #"typedarrayfrom_in_api14",
394    "typedarrayiterator",
395    "typedarraymap",
396    "typedarraynan",
397    "typedarrayreverse",
398    "typedarraysort",
399    "typedarraytosorted",
400    "typedarraywith",
401    "watch",
402    "weakcollectionswithsymbol",
403    "wrapperclassfunc",
404    "yieldstar",
405    "regexp",
406    "deregistermodule",
407    "getpropertybyic",
408    "getvaluefrombuffer",
409  ]
410
411  if (enable_next_optimization) {
412    assert_test_list += ["jsonstringifier_optimized"]
413  }
414
415  deps = []
416
417  foreach(test, assert_test_list) {
418    deps += [ "${test}:${test}AsmAssertAction" ]
419    if (!is_debug) {
420      deps += [ "${test}:${test}AsmContextAssertAction" ]
421    }
422  }
423
424  if (!is_debug) {
425    release_test_assert_list = [
426      "asmstackoverflow",
427      "arrayRelease",
428      "hugearray",
429      "hugeictest",
430      "supercallRelease",
431      "multiconstpoolarray",
432      "multiconstpoolclass",
433      "multiconstpoolconstructor",
434      "multiconstpoolfunc",
435      "multiconstpoolobj",
436      "proxyget",
437      "proxyrelease",
438      "proxyset",
439      "releaseRegexp",
440    ]
441
442    # TODO: CMC-GC UT FIX LATER
443    if (ets_runtime_enable_cmc_gc) {
444      release_test_assert_list -= [ "hugearray" ]
445    }
446
447    foreach(test, release_test_assert_list) {
448      deps += [
449        "${test}:${test}AsmAssertAction",
450        "${test}:${test}AsmContextAssertAction",
451      ]
452    }
453  }
454}
455