From 7a83bc744fff43349e6612263f11bce1fe8dbf34 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 21 Jan 2021 19:34:57 -0500 Subject: Introduce a script for updating lit tests (#3503) And demonstrate its capabilities by porting all tests of the optimize-instructions pass to use lit and FileCheck. --- auto_update_tests.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'auto_update_tests.py') diff --git a/auto_update_tests.py b/auto_update_tests.py index 1135adeb2..76728f8a7 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -138,6 +138,19 @@ def update_spec_tests(): o.write(stdout) +def update_lit_tests(): + print('\n[ updating lit testcases... ]\n') + script = os.path.join(shared.options.binaryen_root, + 'scripts', + 'update_lit_checks.py') + lit_dir = shared.get_test_dir('lit') + subprocess.check_output([sys.executable, + script, + '--binaryen-bin=' + shared.options.binaryen_bin, + os.path.join(lit_dir, '**', '*.wast'), + os.path.join(lit_dir, '**', '*.wat')]) + + TEST_SUITES = OrderedDict([ ('wasm-opt', wasm_opt.update_wasm_opt_tests), ('wasm-dis', update_wasm_dis_tests), @@ -149,6 +162,7 @@ TEST_SUITES = OrderedDict([ ('lld', lld.update_lld_tests), ('wasm2js', wasm2js.update_wasm2js_tests), ('binaryenjs', binaryenjs.update_binaryen_js_tests), + ('lit', update_lit_tests), ]) -- cgit v1.2.3