summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/check.py b/check.py
index 6b4d1833a..c3233b8f7 100755
--- a/check.py
+++ b/check.py
@@ -42,9 +42,12 @@ def get_changelog_version():
def run_version_tests():
print('[ checking --version ... ]\n')
- not_executable_suffix = ['.DS_Store', '.txt', '.js', '.ilk', '.pdb', '.dll', '.wasm', '.manifest', 'binaryen-lit']
+ not_executable_suffix = ['.DS_Store', '.txt', '.js', '.ilk', '.pdb', '.dll', '.wasm', '.manifest']
+ not_executable_prefix = ['binaryen-lit', 'binaryen-unittests']
bin_files = [os.path.join(shared.options.binaryen_bin, f) for f in os.listdir(shared.options.binaryen_bin)]
- executables = [f for f in bin_files if os.path.isfile(f) and not any(f.endswith(s) for s in not_executable_suffix)]
+ executables = [f for f in bin_files if os.path.isfile(f) and
+ not any(f.endswith(s) for s in not_executable_suffix) and
+ not any(os.path.basename(f).startswith(s) for s in not_executable_prefix)]
executables = sorted(executables)
assert len(executables)
@@ -337,6 +340,18 @@ def run_lit():
shared.with_pass_debug(run)
+def run_gtest():
+ def run():
+ gtest = os.path.join(shared.options.binaryen_bin, 'binaryen-unittests')
+ result = subprocess.run(gtest)
+ if result.returncode != 0:
+ shared.num_failures += 1
+ if shared.options.abort_on_first_failure and shared.num_failures:
+ raise Exception("gtest test failed")
+
+ shared.with_pass_debug(run)
+
+
TEST_SUITES = OrderedDict([
('version', run_version_tests),
('wasm-opt', wasm_opt.test_wasm_opt),
@@ -355,6 +370,7 @@ TEST_SUITES = OrderedDict([
('binaryenjs', binaryenjs.test_binaryen_js),
('binaryenjs_wasm', binaryenjs.test_binaryen_wasm),
('lit', run_lit),
+ ('gtest', run_gtest),
])