summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2016-01-20 17:53:29 -0800
committerJF Bastien <jfb@chromium.org>2016-01-20 17:53:29 -0800
commit41952a28f66f63c19520b445aa5ef30da7bf9efd (patch)
tree66ce14a6798e273c1fcc1c771778b7213470fc36
parent4e7c814b4d37cbb1bffcb205f19ab2167ce6815d (diff)
downloadbinaryen-41952a28f66f63c19520b445aa5ef30da7bf9efd.tar.gz
binaryen-41952a28f66f63c19520b445aa5ef30da7bf9efd.tar.bz2
binaryen-41952a28f66f63c19520b445aa5ef30da7bf9efd.zip
Add --help test.
-rwxr-xr-xcheck.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/check.py b/check.py
index fe68e124b..bad6f0730 100755
--- a/check.py
+++ b/check.py
@@ -153,6 +153,22 @@ if not has_vanilla_emcc:
# tests
+print '[ checking --help is useful... ]\n'
+
+not_executable_suffix = ['.txt', '.js']
+executables = sorted(filter(lambda x: not any(x.endswith(s) for s in
+ not_executable_suffix),
+ os.listdir('bin')))
+for e in executables:
+ print '.. %s --help' % e
+ out, err = subprocess.Popen([os.path.join('bin', e), '--help'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+ assert len(out) == 0, 'Expected no stdout, got:\n%s' % out
+ assert e in err, 'Expected help to contain program name, got:\n%s' % err
+ assert len(err.split('\n')) > 8, 'Expected some help, got:\n%s' % err
+os.sys.exit(0)
+
print '[ checking asm2wasm testcases... ]\n'
for asm in tests: