Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from multiprocessing.pool import ThreadPool
from pathlib import Path

from scripts.test import binaryenjs, lld, shared, support, wasm2js, wasm_opt
from scripts.test import binaryenjs, finalize, shared, support, wasm2js, wasm_opt

assert sys.version_info >= (3, 10), 'requires Python 3.10'

Expand Down Expand Up @@ -433,7 +433,7 @@ def wrapper(*args, **kwargs):
'wasm-metadce': run_wasm_metadce_tests,
'wasm-reduce': run_wasm_reduce_tests,
'spec': run_spec_tests,
'lld': lld.test_wasm_emscripten_finalize,
'finalize': finalize.test_wasm_emscripten_finalize,
'wasm2js': wasm2js.test_wasm2js,
'validator': run_validator_tests,
'example': run_example_tests,
Expand Down
4 changes: 2 additions & 2 deletions scripts/auto_update_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import subprocess
import sys

from test import binaryenjs, lld, shared, support, wasm2js, wasm_opt
from test import binaryenjs, finalize, shared, support, wasm2js, wasm_opt


def update_example_tests():
Expand Down Expand Up @@ -166,7 +166,7 @@ def update_lit_tests():
'wasm-metadce': update_metadce_tests,
'wasm-reduce': update_reduce_tests,
'spec': update_spec_tests,
'lld': lld.update_lld_tests,
'finalize': finalize.update_finalize_tests,
'wasm2js': wasm2js.update_wasm2js_tests,
'binaryenjs': binaryenjs.update_binaryen_js_tests,
'lit': update_lit_tests,
Expand Down
6 changes: 3 additions & 3 deletions scripts/test/lld.py → scripts/test/finalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def run_test(input_path):
def test_wasm_emscripten_finalize():
print('\n[ checking wasm-emscripten-finalize testcases... ]\n')

for input_path in shared.get_tests(shared.get_test_dir('lld'), ['.wat', '.wasm']):
for input_path in shared.get_tests(shared.get_test_dir('finalize'), ['.wat', '.wasm']):
run_test(input_path)


def update_lld_tests():
def update_finalize_tests():
print('\n[ updating wasm-emscripten-finalize testcases... ]\n')

for input_path in shared.get_tests(shared.get_test_dir('lld'), ['.wat', '.wasm']):
for input_path in shared.get_tests(shared.get_test_dir('finalize'), ['.wat', '.wasm']):
print('..', input_path)
extension_arg_map = {
'.out': [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ def files_with_extensions(path, extensions):
def generate_wat_files(llvm_bin, emscripten_sysroot):
print('\n[ building wat files from C sources... ]\n')

lld_path = os.path.join(shared.options.binaryen_test, 'lld')
for src_file, ext in files_with_extensions(lld_path, ['.c', '.cpp', '.s']):
test_path = os.path.join(shared.options.binaryen_test, 'finalize')
for src_file, ext in files_with_extensions(test_path, ['.c', '.cpp', '.s']):
print('..', src_file)
obj_file = src_file.replace(ext, '.o')

src_path = os.path.join(lld_path, src_file)
obj_path = os.path.join(lld_path, obj_file)
src_path = os.path.join(test_path, src_file)
obj_path = os.path.join(test_path, obj_file)

wasm_file = src_file.replace(ext, '.wasm')
wat_file = src_file.replace(ext, '.wat')

obj_path = os.path.join(lld_path, obj_file)
wasm_path = os.path.join(lld_path, wasm_file)
wat_path = os.path.join(lld_path, wat_file)
obj_path = os.path.join(test_path, obj_file)
wasm_path = os.path.join(test_path, wasm_file)
wat_path = os.path.join(test_path, wat_file)
is_shared = 'shared' in src_file
is_64 = '64' in src_file

Expand Down Expand Up @@ -104,6 +104,6 @@ def generate_wat_files(llvm_bin, emscripten_sysroot):

if __name__ == '__main__':
if len(shared.options.positional_args) != 2:
print('Usage: generate_lld_tests.py [llvm/bin/dir] [path/to/emscripten]')
print('Usage: generate_finalize_tests.py [llvm/bin/dir] [path/to/emscripten]')
sys.exit(1)
generate_wat_files(*shared.options.positional_args)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading