Skip to content

Commit bf4737b

Browse files
authored
Make auto_update_tests.py support selective updates (#2287)
1 parent 4c9cfeb commit bf4737b

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

auto_update_tests.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
import shutil
1919
import subprocess
2020
import sys
21+
from collections import OrderedDict
2122

2223
from scripts.test.support import run_command, split_wast, write_wast, node_test_glue, node_has_webassembly
2324
from scripts.test.shared import (
2425
ASM2WASM, MOZJS, NODEJS, WASM_OPT, WASM_AS, WASM_DIS,
2526
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)
2728

2829
from scripts.test import lld
2930
from scripts.test import wasm2js
@@ -328,18 +329,29 @@ def update_reduce_tests():
328329
run_command(WASM_DIS + ['c.wasm', '-o', expected])
329330

330331

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+
331347
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]()
343355

344356
print('\n[ success! ]')
345357

0 commit comments

Comments
 (0)