|
18 | 18 | import shutil |
19 | 19 | import subprocess |
20 | 20 | import sys |
| 21 | +from collections import OrderedDict |
21 | 22 |
|
22 | 23 | from scripts.test.support import run_command, split_wast, write_wast, node_test_glue, node_has_webassembly |
23 | 24 | from scripts.test.shared import ( |
24 | 25 | ASM2WASM, MOZJS, NODEJS, WASM_OPT, WASM_AS, WASM_DIS, |
25 | 26 | WASM_CTOR_EVAL, WASM_REDUCE, WASM_METADCE, BINARYEN_INSTALL_DIR, |
26 | | - BINARYEN_JS, has_shell_timeout, options) |
| 27 | + BINARYEN_JS, has_shell_timeout, options, requested) |
27 | 28 |
|
28 | 29 | from scripts.test import lld |
29 | 30 | from scripts.test import wasm2js |
@@ -328,18 +329,29 @@ def update_reduce_tests(): |
328 | 329 | run_command(WASM_DIS + ['c.wasm', '-o', expected]) |
329 | 330 |
|
330 | 331 |
|
| 332 | +TEST_SUITES = OrderedDict([ |
| 333 | + ('wasm-opt', update_wasm_opt_tests), |
| 334 | + ('asm2wasm', update_asm_js_tests), |
| 335 | + ('wasm-dis', update_wasm_dis_tests), |
| 336 | + ('example', update_example_tests), |
| 337 | + ('ctor-eval', update_ctor_eval_tests), |
| 338 | + ('wasm-metadce', update_metadce_tests), |
| 339 | + ('wasm-reduce', update_reduce_tests), |
| 340 | + ('binaryenjs', update_binaryen_js_tests), |
| 341 | + ('lld', lld.update_lld_tests), |
| 342 | + ('wasm2js', wasm2js.update_wasm2js_tests), |
| 343 | + ('binfmt', update_bin_fmt_tests), |
| 344 | +]) |
| 345 | + |
| 346 | + |
331 | 347 | def main(): |
332 | | - update_asm_js_tests() |
333 | | - lld.update_lld_tests() |
334 | | - update_wasm_opt_tests() |
335 | | - update_bin_fmt_tests() |
336 | | - update_example_tests() |
337 | | - update_wasm_dis_tests() |
338 | | - update_ctor_eval_tests() |
339 | | - wasm2js.update_wasm2js_tests() |
340 | | - update_metadce_tests() |
341 | | - update_reduce_tests() |
342 | | - update_binaryen_js_tests() |
| 348 | + if options.list_suites: |
| 349 | + for suite in TEST_SUITES.keys(): |
| 350 | + print(suite) |
| 351 | + return 0 |
| 352 | + |
| 353 | + for test in requested or TEST_SUITES.keys(): |
| 354 | + TEST_SUITES[test]() |
343 | 355 |
|
344 | 356 | print('\n[ success! ]') |
345 | 357 |
|
|
0 commit comments