diff options
Diffstat (limited to 'scripts/test/lld.py')
-rwxr-xr-x | scripts/test/lld.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/scripts/test/lld.py b/scripts/test/lld.py index 41db2baa2..46e1023ec 100755 --- a/scripts/test/lld.py +++ b/scripts/test/lld.py @@ -14,11 +14,8 @@ # limitations under the License. import os -from .support import run_command -from .shared import ( - fail_with_error, get_test_dir, get_tests, - WASM_EMSCRIPTEN_FINALIZE, fail_if_not_identical_to_file -) +from . import shared +from . import support def args_for_finalize(filename): @@ -35,7 +32,7 @@ def args_for_finalize(filename): def test_wasm_emscripten_finalize(): print('\n[ checking wasm-emscripten-finalize testcases... ]\n') - for wast_path in get_tests(get_test_dir('lld'), ['.wast']): + for wast_path in shared.get_tests(shared.get_test_dir('lld'), ['.wast']): print('..', wast_path) is_passive = '.passive.' in wast_path mem_file = wast_path + '.mem' @@ -51,25 +48,28 @@ def test_wasm_emscripten_finalize(): if ext != '.out' and not os.path.exists(expected_file): continue - cmd = WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S'] + ext_args + cmd = shared.WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S'] + \ + ext_args cmd += args_for_finalize(os.path.basename(wast_path)) - actual = run_command(cmd) + actual = support.run_command(cmd) if not os.path.exists(expected_file): print(actual) - fail_with_error('output ' + expected_file + ' does not exist') - fail_if_not_identical_to_file(actual, expected_file) + shared.fail_with_error('output ' + expected_file + + ' does not exist') + shared.fail_if_not_identical_to_file(actual, expected_file) if ext == '.mem.out': with open(mem_file) as mf: mem = mf.read() - fail_if_not_identical_to_file(mem, wast_path + '.mem.mem') + shared.fail_if_not_identical_to_file(mem, wast_path + + '.mem.mem') os.remove(mem_file) def update_lld_tests(): print('\n[ updatring wasm-emscripten-finalize testcases... ]\n') - for wast_path in get_tests(get_test_dir('lld'), ['.wast']): + for wast_path in shared.get_tests(shared.get_test_dir('lld'), ['.wast']): print('..', wast_path) is_passive = '.passive.' in wast_path mem_file = wast_path + '.mem' @@ -84,9 +84,10 @@ def update_lld_tests(): out_path = wast_path + ext if ext != '.out' and not os.path.exists(out_path): continue - cmd = WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S'] + ext_args + cmd = shared.WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S'] + \ + ext_args cmd += args_for_finalize(os.path.basename(wast_path)) - actual = run_command(cmd) + actual = support.run_command(cmd) with open(out_path, 'w') as o: o.write(actual) |