summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-rwxr-xr-xauto_update_tests.py6
-rwxr-xr-xcheck.py40
-rw-r--r--src/tools/wasm-shell.cpp (renamed from src/tools/binaryen-shell.cpp)2
4 files changed, 32 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cff081c7..10120844e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,16 +109,16 @@ ELSE()
ENDIF()
TARGET_LINK_LIBRARIES(binaryen asmjs ${all_passes} support)
-SET(binaryen-shell_SOURCES
- src/tools/binaryen-shell.cpp
+SET(wasm-shell_SOURCES
+ src/tools/wasm-shell.cpp
src/wasm.cpp
)
-ADD_EXECUTABLE(binaryen-shell
- ${binaryen-shell_SOURCES})
-TARGET_LINK_LIBRARIES(binaryen-shell asmjs emscripten-optimizer ${all_passes} support)
-SET_PROPERTY(TARGET binaryen-shell PROPERTY CXX_STANDARD 11)
-SET_PROPERTY(TARGET binaryen-shell PROPERTY CXX_STANDARD_REQUIRED ON)
-INSTALL(TARGETS binaryen-shell DESTINATION bin)
+ADD_EXECUTABLE(wasm-shell
+ ${wasm-shell_SOURCES})
+TARGET_LINK_LIBRARIES(wasm-shell asmjs emscripten-optimizer ${all_passes} support)
+SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD_REQUIRED ON)
+INSTALL(TARGETS wasm-shell DESTINATION bin)
SET(asm2wasm_SOURCES
src/tools/asm2wasm.cpp
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 8e33e1517..9505c2dc4 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -54,11 +54,11 @@ for t in sorted(os.listdir(os.path.join('test', 'print'))):
if t.endswith('.wast'):
print '..', t
wasm = os.path.basename(t).replace('.wast', '')
- cmd = [os.path.join('bin', 'binaryen-shell'), os.path.join('test', 'print', t), '--print']
+ cmd = [os.path.join('bin', 'wasm-shell'), os.path.join('test', 'print', t), '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
open(os.path.join('test', 'print', wasm + '.txt'), 'w').write(actual)
- cmd = [os.path.join('bin', 'binaryen-shell'), os.path.join('test', 'print', t), '--print-minified']
+ cmd = [os.path.join('bin', 'wasm-shell'), os.path.join('test', 'print', t), '--print-minified']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
open(os.path.join('test', 'print', wasm + '.minified.txt'), 'w').write(actual)
@@ -68,7 +68,7 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
opts = ['-O'] if passname == 'O' else ['--' + p for p in passname.split('_')]
- cmd = [os.path.join('bin', 'binaryen-shell')] + opts + [os.path.join('test', 'passes', t), '--print']
+ cmd = [os.path.join('bin', 'wasm-shell')] + opts + [os.path.join('test', 'passes', t), '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
open(os.path.join('test', 'passes', passname + '.txt'), 'w').write(actual)
diff --git a/check.py b/check.py
index 658746dff..4e6cd5e52 100755
--- a/check.py
+++ b/check.py
@@ -254,7 +254,7 @@ def binary_format_check(wast, verify_final_result=True):
assert os.path.exists('ab.wast')
# make sure it is a valid wast
- cmd = [os.path.join('bin', 'binaryen-shell'), 'ab.wast']
+ cmd = [os.path.join('bin', 'wasm-shell'), 'ab.wast']
print ' ', ' '.join(cmd)
subprocess.check_call(cmd, stdout=subprocess.PIPE)
@@ -270,11 +270,11 @@ def minify_check(wast, verify_final_result=True):
# checks we can parse minified output
print ' (minify check)'
- cmd = [os.path.join('bin', 'binaryen-shell'), wast, '--print-minified']
+ cmd = [os.path.join('bin', 'wasm-shell'), wast, '--print-minified']
print ' ', ' '.join(cmd)
- subprocess.check_call([os.path.join('bin', 'binaryen-shell'), wast, '--print-minified'], stdout=open('a.wasm', 'w'), stderr=subprocess.PIPE)
+ subprocess.check_call([os.path.join('bin', 'wasm-shell'), wast, '--print-minified'], stdout=open('a.wasm', 'w'), stderr=subprocess.PIPE)
assert os.path.exists('a.wasm')
- subprocess.check_call([os.path.join('bin', 'binaryen-shell'), 'a.wasm', '--print-minified'], stdout=open('b.wasm', 'w'), stderr=subprocess.PIPE)
+ subprocess.check_call([os.path.join('bin', 'wasm-shell'), 'a.wasm', '--print-minified'], stdout=open('b.wasm', 'w'), stderr=subprocess.PIPE)
assert os.path.exists('b.wasm')
if verify_final_result:
expected = open('a.wasm').read()
@@ -301,22 +301,22 @@ for e in executables:
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
-print '\n[ checking binaryen-shell -o notation... ]\n'
+print '\n[ checking wasm-shell -o notation... ]\n'
wast = os.path.join('test', 'hello_world.wast')
delete_from_orbit('a.wast')
-cmd = [os.path.join('bin', 'binaryen-shell'), wast, '-o', 'a.wast']
+cmd = [os.path.join('bin', 'wasm-shell'), wast, '-o', 'a.wast']
run_command(cmd)
fail_if_not_identical(open('a.wast').read(), open(wast).read())
-print '\n[ checking binaryen-shell passes... ]\n'
+print '\n[ checking wasm-shell passes... ]\n'
for t in sorted(os.listdir(os.path.join('test', 'passes'))):
if t.endswith('.wast'):
print '..', t
passname = os.path.basename(t).replace('.wast', '')
opts = ['-O'] if passname == 'O' else ['--' + p for p in passname.split('_')]
- cmd = [os.path.join('bin', 'binaryen-shell')] + opts + [os.path.join('test', 'passes', t), '--print']
+ cmd = [os.path.join('bin', 'wasm-shell')] + opts + [os.path.join('test', 'passes', t), '--print']
actual = run_command(cmd)
fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
@@ -350,7 +350,7 @@ for asm in tests:
# verify in wasm
if interpreter:
# remove imports, spec interpreter doesn't know what to do with them
- subprocess.check_call([os.path.join('bin', 'binaryen-shell'), '--remove-imports', '--print', wasm], stdout=open('ztemp.wast', 'w'), stderr=subprocess.PIPE)
+ subprocess.check_call([os.path.join('bin', 'wasm-shell'), '--remove-imports', '--print', wasm], stdout=open('ztemp.wast', 'w'), stderr=subprocess.PIPE)
proc = subprocess.Popen([interpreter, 'ztemp.wast'], stderr=subprocess.PIPE)
out, err = proc.communicate()
if proc.returncode != 0:
@@ -370,28 +370,28 @@ for asm in tests:
raise Exception('wasm interpreter error: ' + err) # failed to pretty-print
raise Exception('wasm interpreter error')
-print '\n[ checking binaryen-shell parsing & printing... ]\n'
+print '\n[ checking wasm-shell parsing & printing... ]\n'
for t in sorted(os.listdir(os.path.join('test', 'print'))):
if t.endswith('.wast'):
print '..', t
wasm = os.path.basename(t).replace('.wast', '')
- cmd = [os.path.join('bin', 'binaryen-shell'), os.path.join('test', 'print', t), '--print']
+ cmd = [os.path.join('bin', 'wasm-shell'), os.path.join('test', 'print', t), '--print']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
fail_if_not_identical(actual, open(os.path.join('test', 'print', wasm + '.txt')).read())
- cmd = [os.path.join('bin', 'binaryen-shell'), os.path.join('test', 'print', t), '--print-minified']
+ cmd = [os.path.join('bin', 'wasm-shell'), os.path.join('test', 'print', t), '--print-minified']
print ' ', ' '.join(cmd)
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
fail_if_not_identical(actual.strip(), open(os.path.join('test', 'print', wasm + '.minified.txt')).read().strip())
-print '\n[ checking binaryen-shell testcases... ]\n'
+print '\n[ checking wasm-shell testcases... ]\n'
for t in tests:
if t.endswith('.wast') and not t.startswith('spec'):
print '..', t
t = os.path.join('test', t)
- cmd = [os.path.join('bin', 'binaryen-shell'), t, '--print']
+ cmd = [os.path.join('bin', 'wasm-shell'), t, '--print']
actual = run_command(cmd)
actual = actual.replace('printing before:\n', '')
@@ -402,7 +402,7 @@ for t in tests:
binary_format_check(t)
minify_check(t)
-print '\n[ checking binaryen-shell spec testcases... ]\n'
+print '\n[ checking wasm-shell spec testcases... ]\n'
if len(requested) == 0:
BLACKLIST = []
@@ -416,8 +416,8 @@ for t in spec_tests:
wast = os.path.join('test', t)
def run_spec_test(wast):
- print ' run binaryen-shell on', wast
- cmd = [os.path.join('bin', 'binaryen-shell'), wast]
+ print ' run wasm-shell on', wast
+ cmd = [os.path.join('bin', 'wasm-shell'), wast]
return run_command(cmd, stderr=subprocess.PIPE)
def check_expected(actual, expected):
@@ -547,8 +547,8 @@ for dot_s_dir in ['dot_s', 'llvm_autogenerated']:
cmd = [os.path.join('bin', 's2wasm'), full, '--global-base=1024'] + stack_alloc
run_command(cmd)
- # run binaryen-shell on the .wast to verify that it parses
- cmd = [os.path.join('bin', 'binaryen-shell'), expected_file]
+ # run wasm-shell on the .wast to verify that it parses
+ cmd = [os.path.join('bin', 'wasm-shell'), expected_file]
run_command(cmd)
print '\n[ running linker tests... ]\n'
@@ -609,7 +609,7 @@ if torture:
import test.waterfall.src.execute_files as execute_files
unexpected_result_count += execute_files.run(
- runner=os.path.abspath(os.path.join('bin', 'binaryen-shell')),
+ runner=os.path.abspath(os.path.join('bin', 'wasm-shell')),
files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
fails=os.path.abspath(os.path.join('test', 's2wasm_known_binaryen_shell_test_failures.txt')),
out='',
diff --git a/src/tools/binaryen-shell.cpp b/src/tools/wasm-shell.cpp
index 79c01c5bf..27fa6cd50 100644
--- a/src/tools/binaryen-shell.cpp
+++ b/src/tools/wasm-shell.cpp
@@ -171,7 +171,7 @@ int main(int argc, const char* argv[]) {
Name entry;
std::vector<std::string> passes;
- Options options("binaryen-shell", "Execute .wast files");
+ Options options("wasm-shell", "Execute .wast files");
options
.add("--output", "-o", "Output file (stdout if not specified)",
Options::Arguments::One,