Skip to content

Commit 02e2a30

Browse files
Make lit tests work with filter argument
1 parent c2e47d3 commit 02e2a30

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ def run_unittest():
382382
def run_lit():
383383
def run():
384384
lit_script = os.path.join(shared.options.binaryen_bin, 'binaryen-lit')
385-
lit_tests = os.path.join(shared.options.binaryen_root, 'test', 'lit')
385+
lit_tests = shared.get_tests(shared.get_test_dir('lit'), extensions=support.LIT_TEST_SUFFIXES, recursive=True)
386386
# lit expects to be run as its own executable
387-
cmd = [sys.executable, lit_script, lit_tests, '-vv']
387+
cmd = [sys.executable, lit_script, '-vv'] + lit_tests
388388
result = subprocess.run(cmd)
389389
if result.returncode != 0:
390390
shared.num_failures += 1

scripts/test/support.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def to_end(j):
174174
return ret
175175

176176

177+
LIT_TEST_SUFFIXES = frozenset({'.wat', '.wast', '.test'})
178+
177179
# write a split wast from split_wast. the wast may be binary if the original
178180
# file was binary
179181
def write_wast(filename, wast, asserts=[]):

test/lit/lit.cfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
import sys
33
import lit.formats
44

5+
sys.path.append(config.binaryen_src_root)
6+
from scripts.test.support import LIT_TEST_SUFFIXES
7+
58
config.name = "Binaryen lit tests"
69
config.test_format = lit.formats.ShTest()
710

8-
config.suffixes = ['.wat', '.wast', '.test']
11+
config.suffixes = LIT_TEST_SUFFIXES
912

1013
config.test_source_root = os.path.dirname(__file__)
1114
config.test_exec_root = os.path.join(config.binaryen_build_root, 'out', 'test')

0 commit comments

Comments
 (0)