summaryrefslogtreecommitdiff
path: root/scripts/test/lld.py
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-11-20 16:37:09 -0800
committerGitHub <noreply@github.com>2019-11-20 16:37:09 -0800
commit21888c253f775047bcfac28e8110abdcad9d6bcb (patch)
tree18b7cf5d6b76a554401d7edb3601fe7be9ae8739 /scripts/test/lld.py
parentf17f8f927c96c2e6ec25b4c2dbb8b9d70f7af9b7 (diff)
downloadbinaryen-21888c253f775047bcfac28e8110abdcad9d6bcb.tar.gz
binaryen-21888c253f775047bcfac28e8110abdcad9d6bcb.tar.bz2
binaryen-21888c253f775047bcfac28e8110abdcad9d6bcb.zip
Simplify test scripts (NFC) (#2457)
This makes test scripts simpler by reducing loop depths and extracting repeating code into methods or variables. - `get_tests` returns a list of tests with specified extensions. This includes files with a full path rather than just file names. - Reduces loop depths by using early exits and `get_tests`.
Diffstat (limited to 'scripts/test/lld.py')
-rwxr-xr-xscripts/test/lld.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/test/lld.py b/scripts/test/lld.py
index 7372698cd..41db2baa2 100755
--- a/scripts/test/lld.py
+++ b/scripts/test/lld.py
@@ -16,7 +16,7 @@
import os
from .support import run_command
from .shared import (
- fail_with_error, files_with_pattern, options,
+ fail_with_error, get_test_dir, get_tests,
WASM_EMSCRIPTEN_FINALIZE, fail_if_not_identical_to_file
)
@@ -35,7 +35,7 @@ def args_for_finalize(filename):
def test_wasm_emscripten_finalize():
print('\n[ checking wasm-emscripten-finalize testcases... ]\n')
- for wast_path in files_with_pattern(options.binaryen_test, 'lld', '*.wast'):
+ for wast_path in get_tests(get_test_dir('lld'), ['.wast']):
print('..', wast_path)
is_passive = '.passive.' in wast_path
mem_file = wast_path + '.mem'
@@ -69,7 +69,7 @@ def test_wasm_emscripten_finalize():
def update_lld_tests():
print('\n[ updatring wasm-emscripten-finalize testcases... ]\n')
- for wast_path in files_with_pattern(options.binaryen_test, 'lld', '*.wast'):
+ for wast_path in get_tests(get_test_dir('lld'), ['.wast']):
print('..', wast_path)
is_passive = '.passive.' in wast_path
mem_file = wast_path + '.mem'