• Home
Name Date Size #Lines LOC

..--

CI_tests.txtD06-May-2025215.1 KiB3,9733,972

README.mdD06-May-20258.1 KiB185149

babel-preprocessor.jsD06-May-2025966 3316

config.pyD06-May-20255.9 KiB155123

dynamicImport_tests.txtD06-May-202525.5 KiB534534

es2015_tests.txtD06-May-2025416.2 KiB6,9156,915

es2021_tests.txtD06-May-2025270.7 KiB3,4583,458

es2022_tests.txtD06-May-2025252.1 KiB2,8562,855

es2023_tests.txtD06-May-202519.2 KiB299286

es2abc_skip_tests.jsonD06-May-20257.2 KiB130129

es5_tests.txtD06-May-2025411.6 KiB8,4588,458

eshost.patchD06-May-202510.8 KiB373352

force_gc_skip_tests.jsonD06-May-20255 KiB6564

harness.patchD06-May-20259.5 KiB312293

ignored-test262-debug-x64-aot-pgo.txtD06-May-202554 31

ignored-test262-debug-x64-jit.txtD06-May-202549 21

ignored-test262-debug-x64.txtD06-May-202545 21

ignored-test262-fastverify-qemu-aot-pgo-litecg.txtD06-May-202511.6 KiB142136

ignored-test262-fastverify-qemu-aot-pgo.txtD06-May-202514.2 KiB178171

ignored-test262-fastverify-qemu-int.txtD06-May-202512.7 KiB165156

ignored-test262-fastverify-x64-abc2program.txtD06-May-202562 21

ignored-test262-fastverify-x64-aot-pgo-litecg.txtD06-May-202582 32

ignored-test262-fastverify-x64-aot-pgo.txtD06-May-20251.1 KiB2319

ignored-test262-fastverify-x64-jit.txtD06-May-20251.5 KiB2521

ignored-test262-fastverify-x64.txtD06-May-202550 21

ignored-test262-other-debug-x64-int.txtD06-May-202557 31

ignored-test262-other-fastverify-qemu-aot-pgo-litecg.txtD06-May-20254.6 KiB6763

ignored-test262-other-fastverify-qemu-aot-pgo.txtD06-May-20254 KiB5854

ignored-test262-other-fastverify-qemu-int.txtD06-May-20253.9 KiB6055

ignored-test262-other-fastverify-x64-aot-pgo-litecg.txtD06-May-202573 31

ignored-test262-other-fastverify-x64-aot-pgo.txtD06-May-202566 31

ignored-test262-other-fastverify-x64-int.txtD06-May-202561 41

ignored-test262-other-release-qemu-aot-pgo-litecg.txtD06-May-20252 KiB3128

ignored-test262-other-release-qemu-aot-pgo.txtD06-May-20252.1 KiB3430

ignored-test262-other-release-qemu-int.txtD06-May-20250

ignored-test262-other-release-x64-aot-pgo-litecg.txtD06-May-202570 31

ignored-test262-other-release-x64-aot-pgo.txtD06-May-202562 21

ignored-test262-other-release-x64-jit.txtD06-May-2025374 96

ignored-test262-release-qemu-aot-pgo-litecg.txtD06-May-20254.5 KiB5246

ignored-test262-release-qemu-aot-pgo.txtD06-May-202556 21

ignored-test262-release-qemu-int.txtD06-May-202553 21

ignored-test262-release-qemu-jit.txtD06-May-2025104 32

ignored-test262-release-x64-abc2program.txtD06-May-202559 21

ignored-test262-release-x64-aot-pgo-litecg.txtD06-May-202564 41

ignored-test262-release-x64-aot-pgo.txtD06-May-202556 31

ignored-test262-release-x64-jit.txtD06-May-20250

ignored-test262-release-x64.txtD06-May-202548 31

intl_skip_tests.jsonD06-May-20251.7 KiB3635

intl_tests.txtD06-May-202551.2 KiB895895

mix_compile.pyD06-May-20253.6 KiB8568

module_tests.txtD06-May-202523.6 KiB685684

other_tests.txtD06-May-20251.2 MiB17,03917,038

other_tests_23092024.txtD06-May-20251.6 MiB17,03917,038

other_tests_part1_0.txtD06-May-2025222.8 KiB2,8402,839

other_tests_part1_1.txtD06-May-2025230.5 KiB2,8412,840

other_tests_part2.txtD06-May-2025549.3 KiB5,6795,678

other_tests_part3.txtD06-May-2025555 KiB5,6825,681

run_sunspider.pyD06-May-202532.6 KiB787678

run_test262.pyD06-May-202534.3 KiB928783

sendable_tests.txtD06-May-2025381.3 KiB5,8015,801

skip-test262-fastverify-qemu.txtD06-May-20254.4 KiB4342

skip-test262-other-debug-qemu-nightly.txtD06-May-20253.3 KiB4544

skip-test262-other-fastverify-qemu-nightly.txtD06-May-202567 21

skip-test262-other-release-qemu-nightly.txtD06-May-202567 21

skip-test262-qemu-allmode.txtD06-May-20253.5 KiB3029

skip-test262-release-qemu-nightly.txtD06-May-20253.6 KiB3130

skip_tests.jsonD06-May-202597.3 KiB1,4531,452

test-list-test262-fastverify-qemu-aot-pgo-litecg-intl402-rest-part.txtD06-May-20251.6 KiB2222

test-list-test262-other-fastverify-qemu-aot-pgo-built-ins-RegExp-part1.txtD06-May-202512 KiB143143

test-list-test262-other-fastverify-qemu-aot-pgo-language-expressions-class-part1.txtD06-May-2025146.2 KiB1,3021,300

test-list-test262-other-fastverify-qemu-aot-pgo-language-expressions-class-part2.txtD06-May-2025133.7 KiB1,3021,300

test-list-test262-other-fastverify-qemu-aot-pgo-language-expressions-class-part3.txtD06-May-2025140.3 KiB1,2331,233

test-list-test262-other-fastverify-qemu-aot-pgo-language-statements-class-part1.txtD06-May-2025132.4 KiB1,3011,300

test-list-test262-other-fastverify-qemu-aot-pgo-language-statements-class-part2.txtD06-May-2025143.7 KiB1,3011,300

test-list-test262-other-fastverify-qemu-aot-pgo-language-statements-class-part3.txtD06-May-2025153.9 KiB1,3761,376

ts2abc_skip_tests.jsonD06-May-202588 KiB971970

utils.pyD06-May-20258.3 KiB298221

README.md

1## File overview:
2```
3es5_tests.txt:  This file contains a list of ES5 test cases. If useful cases are found missing, you can add them as needed.
4es2015_tests.txt:  This file contains a full list of use cases of ES2015 except those filtered out with'es6id'. If useful cases are found missing, you can add them as needed.
5es2021_tests.txt:  This file contains a full list of use cases of ES2021 except those filtered out with'es6id'. If useful cases are found missing, you can add them as needed.
6intl_tests.txt:  This file contains a list of internationalization test cases. If you find useful cases missing, you can add them as needed.
7skip_tests.json: This file contains a list of use cases that do not meet the requirements. If useful cases are found missing, you can add them according to the specified format.
8intl_skip_tests.json: This file contains a list of non-compliant internationalization use cases. If useful cases are found to be missing, they can be added in the specified format.
9```
10
11## 1. Compile ts2abc and ark_js_vm project
12```
13./build.sh --product-name hispark_taurus_standard --build-target ark_js_vm --build-target ark_ts2abc_build
14```
15
16## 2 Run test cases
17
18### 2.1 Options
19```
20usage: run_test262.py [-h] [--dir DIR] [--file FILE] [--mode [{1,2,3}]]
21                      [--es51] [--es2015 [{all,only}]] [--esnext]
22                      [--engine FILE] [--babel] [--timeout TIMEOUT]
23                      [--threads THREADS] [--hostArgs HOSTARGS]
24                      [--ark-aot]
25                      [--ark-aot-tool ARK_AOT_TOOL]
26                      [--ark-tool ARK_TOOL]
27                      [--ark-frontend-tool ARK_FRONTEND_TOOL]
28                      [--libs-dir LIBS_DIR]
29                      [--ark-frontend [{ts2panda,es2panda}]]
30
31optional arguments:
32  -h, --help            Show this help message and exit
33  --dir DIR             Directory to test
34  --file FILE           File to test
35  --mode [{1,2,3}]      selection information as: 1: only default 2:
36                        only strict mode 3: both default and strict mode
37  --es51                Run test262 ES5.1 version
38  --es2015 [{all,only}]
39                        Run test262 - ES2015. all: Contains all use cases for
40                        ES5 and ES2015, only: Only include use cases for
41                        ES2015
42  --esnext              Run test262 - ES.next.
43  --engine FILE         Other engine binarys to run tests with
44                        (as:d8,hermes,jsc,qjs...)
45  --babel               Whether to use Babel conversion
46  --timeout TIMEOUT     Set a custom test timeout in milliseconds !!!
47  --threads THREADS     Run this many tests in parallel. Note that the browser
48                        runners don't work great with t > 1.
49  --hostArgs HOSTARGS   command-line arguments to pass to eshost host
50  --ark-aot             Run test262 with aot
51  --ark-aot-tool ARK_AOT_TOOL
52                        ark's aot tool
53  --ark-tool ARK_TOOL   ark's binary tool
54  --ark-frontend-tool ARK_FRONTEND_TOOL
55                        ark frontend conversion tool
56  --libs-dir LIBS_DIR   The path collection of dependent so, divided by':'
57  --ark-frontend [{ts2panda,es2panda}]
58                        Choose one of them
59```
60
61### 2.2 Run all the test cases
62
63```
64python3 test262/run_test262.py
65```
66
67### 2.3 Run `es51` related test cases
68
69```python
70python3 test262/run_test262.py --es51
71```
72
73After the execution finished, a directory named `test_es51` is created under directory `test262/data` , which is used to store all `es51` cases.
74
75### 2.4 Run `es2015` related test cases
76#### 2.4.1 only include use cases for ES2015
77```python
78python3 test262/run_test262.py --es2015 only
79```
80#### 2.4.2  Contains all use cases for ES5 and ES2015
81```python
82python3 test262/run_test262.py --es2015 all
83```
84
85### 2.5 Run single test case
86
87```python
88python3 test262/run_test262.py --file test262/data/test_es5/language/statements/break/12.8-1.js
89```
90
91### 2.6 Run all the test cases under specified directory
92
93```python
94python3 test262/run_test262.py --dir test262/data/test_es5/language/statements
95```
96
97### 2.7 Run single test case with other engines. Take d8 as an example
98
99```python
100 python3 test262/run_test262.py --engine="/home/share/v8-code/v8/out.gn/x64.release/d8" --file test262/data/test_es5/language/statements/break/12.8-1.js
101```
102### 2.8 Run single test case with `babel` conversion
103```
104python3 test262/run_test262.py  --babel --file test262/data/test_es5/language/statements/break/12.8-1.js
105```
106
107### 2.9 Get test result
108
109take the following code as an example:
110
111```shell
112zgy@lfgphicprd23154:/home/share/OpenHarmony2.0_20210604/ark/ts2abc$ python3 -B test262/run_test262.py --file test262/data/test_es51/language/statements/break/12.8-1.js
113
114Wait a moment..........
115
11607-30 16:56:03.857383 D:>>>       command: npm install | dir: /home/share/OpenHarmony2.0_20210604/out/ohos-arm-release/clang_x64/arkcompiler/ets_frontend/build/src/..
117npm WARN ts2panda@1.0.0 No description
118npm WARN ts2panda@1.0.0 No repository field.
119npm WARN ts2panda@1.0.0 No license field.
120npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
121npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
122
123up to date in 2.225s
124
12528 packages are looking for funding
126  run `npm fund` for details
127
12807-30 16:56:06.746184 D:>>>       command: npm install | dir: test262/eshost
129up to date in 1.446s
130
1311 package is looking for funding
132  run `npm fund` for details
133
13407-30 16:56:08.767037 D:>>>       command: npm install | dir: test262/harness
135up to date in 2.412s
13607-30 16:56:11.836409 D:>>>       command: git checkout -- . | dir: test262/data
13707-30 16:56:12.012115 D:>>>       command: git checkout 9ca13b12728b7e0089c7eb03fa2bd17f8abe297f | dir: test262/data
138HEAD is now at 9ca13b1272 Fix typo in BigIntArray property descriptor test
13907-30 16:56:12.275768 D:>>>       command: git checkout -- . | dir: test262/eshost
14007-30 16:56:12.280134 D:>>>       command: git apply ../eshost.patch | dir: test262/eshost
14107-30 16:56:12.283263 D:>>>       command: git checkout -- . | dir: test262/harness
14207-30 16:56:12.288134 D:>>>       command: git apply ../harness.patch | dir: test262/harness
143Test command:
144        node
145        test262/harness/bin/run.js
146        --hostType=panda
147        --hostPath=python3
148        --hostArgs='-B test262/run_sunspider.py --ark-tool=/home/share/OpenHarmony2.0_20210604/out/ohos-arm-release/clang_x64/arkcompiler/ets_runtime/ark_js_vm --ark-frontend-tool=/home/share/OpenHarmony2.0_20210604/out/ohos-arm-release/clang_x64/arkcompiler/ets_frontend/build/src/index.js --libs-dir=/home/share/OpenHarmony2.0_20210604/out/ohos-arm-release/clang_x64/arkcompiler/ets_runtime:/home/share/OpenHarmony2.0_20210604/out/ohos-arm-release/clang_x64/global/i18n_standard:/home/share/OpenHarmony2.0_20210604/prebuilts/clang/ohos/linux-x86_64/llvm/lib/ --ark-frontend=ts2panda '
149        --threads=15
150        --mode=only strict mode
151        --timeout=60000
152        --tempDir=out/test262
153        --test262Dir=test262/data
154        --saveCompiledTests
155        test262/data/test_es51/language/statements/break/12.8-1.js
156
157FAIL test262/data/test_es51/language/statements/break/12.8-1.js (strict mode)
158
159Ran 1 tests
1600 passed
1611 failed
162used time is: 0:00:13.303865
163```
164
165* `default` indicates `non-strict` mode; `strict mode` indicates the strict mode.
166
167* After the execution finished, the following files are generated under directory `out/test262/` (you can specified it in `test262/config.py`):
168
169```
170-rw-rw-r-- 1 zgy zgy 7583 Nov 21 18:18 12.8-1-default.abc
171-rw-rw-r-- 1 zgy zgy 415 Nov 21 18:18 12.8-1.js.panda.default.err
172-rw-rw-r-- 1 zgy zgy 4389 Nov 21 18:18 12.8-1.js.panda.default.fail
173-rw-rw-r-- 1 zgy zgy 415 Nov 21 18:18 12.8-1.js.panda.strict.err
174-rw-rw-r-- 1 zgy zgy 4403 Nov 21 18:18 12.8-1.js.panda.strict.fail
175-rw-rw-r-- 1 zgy zgy 7601 Nov 21 18:18 12.8-1-strict.abc
176```
177
178`.abc` indicates the generated binary `abc` file.
179
180`.err` indicates that an error occurred during the test.
181
182`.fail/.pass` is the file saved after `js` file has been preprocessed.
183
184The `result.txt` file is generated under directory `out/test262` to save statistics after the test finished.
185