• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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
14panda_ets_interop_js_test(ets_interop_js_test_promise1
15    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
16    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
17    LAUNCHER_ARGS "testPendingPromise"
18)
19
20panda_ets_interop_js_test(ets_interop_js_test_promise2
21    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
22    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
23    LAUNCHER_ARGS "testResolvedPromise"
24)
25
26panda_ets_interop_js_test(ets_interop_js_test_promise3
27    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
28    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
29    LAUNCHER_ARGS "testRejectedPromise"
30)
31
32panda_ets_interop_js_test(ets_interop_js_test_promise4
33    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
34    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
35    LAUNCHER_ARGS "testThenBeforeResolve"
36)
37
38panda_ets_interop_js_test(ets_interop_js_test_promise5
39    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
40    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
41    LAUNCHER_ARGS "testPromiseEmptyThen"
42)
43
44panda_ets_interop_js_test(ets_interop_js_test_promise6
45    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
46    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
47    LAUNCHER_ARGS "testPromiseChain"
48)
49
50panda_ets_interop_js_test(ets_interop_js_test_promise_catch_finally_chain
51    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
52    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
53    LAUNCHER_ARGS "testPromiseCatchFinallyChain"
54)
55
56panda_ets_interop_js_test(ets_interop_js_test_resolve_promise_then_finally
57    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
58    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
59    LAUNCHER_ARGS "testResolvePromiseThenFinally"
60)
61
62panda_ets_interop_js_test(ets_interop_js_test_reject_promise_then_finally
63    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
64    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
65    LAUNCHER_ARGS "testRejectPromiseThenFinally"
66)
67
68panda_ets_interop_js_test(ets_interop_js_test_promise7
69    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
70    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
71    LAUNCHER_ARGS "testReturnPromise" "Panda" 1
72)
73
74panda_ets_interop_js_test(ets_interop_js_test_promise8
75    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
76    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
77    LAUNCHER_ARGS "testReturnPromiseFromAsync" "Panda" 3
78)
79
80panda_ets_interop_js_test(ets_interop_js_test_promise9
81    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
82    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_pending_promise_to_js_test.js
83    LAUNCHER_ARGS "then"
84)
85
86panda_ets_interop_js_test(ets_interop_js_test_promise10
87    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
88    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_pending_promise_to_js_test.js
89    LAUNCHER_ARGS "await"
90)
91
92panda_ets_interop_js_test(ets_interop_js_test_promise11
93    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
94    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/await_js_promise.js
95    LAUNCHER_ARGS "pending"
96)
97
98panda_ets_interop_js_test(ets_interop_js_test_promise12
99    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
100    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/await_js_promise.js
101    LAUNCHER_ARGS "resolved"
102)
103
104panda_ets_interop_js_test(ets_interop_js_test_await_promise
105    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
106    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
107    LAUNCHER_ARGS "testAwaitPromise"
108)
109
110panda_ets_interop_js_test(ets_interop_js_test_async_bool
111    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
112    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
113    LAUNCHER_ARGS "testAsyncBoolean" true 1
114)
115
116panda_ets_interop_js_test(ets_interop_js_test_async_byte
117    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
118    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
119    LAUNCHER_ARGS "testAsyncByte" 127 1
120)
121
122panda_ets_interop_js_test(ets_interop_js_test_async_char
123    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
124    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
125    LAUNCHER_ARGS "testAsyncChar" "x" 1
126)
127
128panda_ets_interop_js_test(ets_interop_js_test_async_short
129    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
130    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
131    LAUNCHER_ARGS "testAsyncShort" 32767 1
132)
133
134panda_ets_interop_js_test(ets_interop_js_test_async_int
135    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
136    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
137    LAUNCHER_ARGS "testAsyncInt" 5 1
138)
139
140panda_ets_interop_js_test(ets_interop_js_test_async_long
141    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
142    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
143    LAUNCHER_ARGS "testAsyncLong" 9223372036854775807 1
144)
145
146panda_ets_interop_js_test(ets_interop_js_test_async_float
147    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
148    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
149    LAUNCHER_ARGS "testAsyncFloat" 3.14 1
150)
151
152panda_ets_interop_js_test(ets_interop_js_test_async_double
153    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
154    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
155    LAUNCHER_ARGS "testAsyncDouble" 3.2 1
156)
157
158panda_ets_interop_js_test(ets_interop_js_test_async_string
159    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
160    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
161    LAUNCHER_ARGS "testAsyncString" "Panda" 1
162)
163
164panda_ets_interop_js_test(ets_interop_js_test_async_void1
165    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
166    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
167    LAUNCHER_ARGS "testAsyncVoid" "undefined" 1
168)
169
170panda_ets_interop_js_test(ets_interop_js_test_async_void2
171    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
172    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
173    LAUNCHER_ARGS "testAsyncVoidEmpty" "undefined" 1
174)
175
176panda_ets_interop_js_test(ets_interop_js_test_async_void3
177    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
178    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/return_promise_to_js_test.js
179    LAUNCHER_ARGS "testAsyncVoidNothing" "undefined" 1
180)
181
182panda_ets_interop_js_test(ets_interop_js_test_promise_all_empty
183    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
184    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
185    LAUNCHER_ARGS "testPromiseAllEmpty"
186)
187
188panda_ets_interop_js_test(ets_interop_js_test_promise_all_resolved
189    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
190    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
191    LAUNCHER_ARGS "testPromiseAllResolved"
192)
193
194panda_ets_interop_js_test(ets_interop_js_test_promise_all_rejected
195    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
196    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
197    LAUNCHER_ARGS "testPromiseAllRejected"
198)
199
200panda_ets_interop_js_test(ets_interop_js_test_promise_all_raw
201    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
202    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
203    LAUNCHER_ARGS "testPromiseAllRawValues"
204)
205
206panda_ets_interop_js_test(ets_interop_js_test_promise_all_iterable
207    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
208    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
209    LAUNCHER_ARGS "testPromiseAllIterable"
210)
211
212panda_ets_interop_js_test(ets_interop_js_test_promise_allsettled_empty
213    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
214    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
215    LAUNCHER_ARGS "testPromiseAllSettledEmpty"
216)
217
218panda_ets_interop_js_test(ets_interop_js_test_promise_allsettled
219    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
220    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
221    LAUNCHER_ARGS "testPromiseAllSettled"
222)
223
224panda_ets_interop_js_test(ets_interop_js_test_promise_any_empty
225    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
226    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
227    LAUNCHER_ARGS "testPromiseAnyEmpty"
228)
229
230panda_ets_interop_js_test(ets_interop_js_test_promise_any_resolved
231    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
232    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
233    LAUNCHER_ARGS "testPromiseAnyResolved"
234)
235
236panda_ets_interop_js_test(ets_interop_js_test_promise_any_rejected
237    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
238    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
239    LAUNCHER_ARGS "testPromiseAnyRejected"
240)
241
242panda_ets_interop_js_test(ets_interop_js_test_promise_any_raw
243    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
244    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
245    LAUNCHER_ARGS "testPromiseAnyRawValues"
246)
247
248panda_ets_interop_js_test(ets_interop_js_test_promise_any_iterable
249    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
250    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
251    LAUNCHER_ARGS "testPromiseAnyRejected"
252)
253
254panda_ets_interop_js_test(ets_interop_js_test_promise_race_resolved
255    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
256    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
257    LAUNCHER_ARGS "testPromiseRaceResolved"
258)
259
260panda_ets_interop_js_test(ets_interop_js_test_promise_race_rejected
261    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
262    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_promise_test.js
263    LAUNCHER_ARGS "testPromiseRaceRejected"
264)
265
266panda_ets_interop_js_test(ets_interop_js_test_to_js_and_back
267    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
268    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_to_js_and_back_test.js
269)
270
271panda_ets_interop_js_test(ets_interop_js_test_to_ets_and_back
272    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/promise_tests.sts
273    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/run_to_ets_and_back_test.js
274)
275
276panda_ets_interop_js_test(ets_interop_js_test_resolve_js_promise_from_non_main_coro
277    ETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/resolve_js_promise_from_non_main_coro_test.sts
278    JS_LAUNCHER ${CMAKE_CURRENT_LIST_DIR}/resolve_js_promise_from_non_main_coro_test.js
279    LAUNCHER_ARGS "testPromiseResolve"
280)