Skip to content

Commit

Permalink
Remove wasm-opt/binary tests from test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
aheejin committed Dec 9, 2023
1 parent 2ef9b79 commit 428d2ae
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions scripts/test/wasm_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,6 @@ def check():
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).communicate()
shared.fail_if_not_identical(actual.strip(), open(os.path.join(shared.get_test_dir('print'), wasm + '.minified.txt')).read().strip())

print('\n[ checking wasm-opt testcases... ]\n')

for t in shared.get_tests(shared.options.binaryen_test, ['.wast']):
print('..', os.path.basename(t))
f = t + '.from-wast'
cmd = shared.WASM_OPT + [t, '--print', '-all']
actual = support.run_command(cmd)
actual = actual.replace('printing before:\n', '')

shared.fail_if_not_identical_to_file(actual, f)

# FIXME Remove this condition after nullref is implemented in V8
if 'reference-types.wast' not in t:
shared.binary_format_check(t, wasm_as_args=['-g']) # test with debuginfo
shared.binary_format_check(t, wasm_as_args=[], binary_suffix='.fromBinary.noDebugInfo') # test without debuginfo

shared.minify_check(t)

print('\n[ checking wasm-opt debugInfo read-write... ]\n')

for t in shared.get_tests(shared.options.binaryen_test, ['.fromasm']):
Expand Down Expand Up @@ -194,15 +176,6 @@ def update_wasm_opt_tests():
with open(t + '.wat', 'w') as o:
o.write(i.read())

print('\n[ checking wasm-opt testcases... ]\n')
for t in shared.get_tests(shared.options.binaryen_test, ['.wast']):
print('..', os.path.basename(t))
f = t + '.from-wast'
cmd = shared.WASM_OPT + [t, '--print', '-all']
actual = support.run_command(cmd)
actual = actual.replace('printing before:\n', '')
open(f, 'w').write(actual)

print('\n[ checking wasm-opt debugInfo read-write... ]\n')
for t in shared.get_tests(shared.options.binaryen_test, ['.fromasm']):
if 'debugInfo' not in t:
Expand All @@ -213,29 +186,3 @@ def update_wasm_opt_tests():
support.run_command(shared.WASM_OPT + ['a.wasm', '--input-source-map=a.map', '-o', 'b.wasm', '--output-source-map=b.map', '-g'])
actual = support.run_command(shared.WASM_DIS + ['b.wasm', '--source-map=b.map'])
open(f, 'w').write(actual)

print('\n[ checking binary format testcases... ]\n')
for wast in shared.get_tests(shared.options.binaryen_test, ['.wast']):
for debug_info in [0, 1]:
cmd = shared.WASM_AS + [wast, '-o', 'a.wasm', '-all']
if debug_info:
cmd += ['-g']
print(' '.join(cmd))
if os.path.exists('a.wasm'):
os.unlink('a.wasm')
subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert os.path.exists('a.wasm')

cmd = shared.WASM_DIS + ['a.wasm', '-o', 'a.wast', '-all']
print(' '.join(cmd))
if os.path.exists('a.wast'):
os.unlink('a.wast')
subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert os.path.exists('a.wast')
actual = open('a.wast').read()
binary_file = wast + '.fromBinary'
if not debug_info:
binary_file += '.noDebugInfo'
with open(binary_file, 'w') as o:
print('writey', binary_file)
o.write(actual)

0 comments on commit 428d2ae

Please sign in to comment.