diff options
author | Thomas Lively <tlively@google.com> | 2024-06-17 11:16:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 18:16:20 +0000 |
commit | d849a43040dfc21d1593283ad38a12a3bd80e17c (patch) | |
tree | 7108e97aaff704aa94133d066fc681585a488264 /check.py | |
parent | cf2725b434c724fdcac89f5c2a21e09f33f5a121 (diff) | |
download | binaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.tar.gz binaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.tar.bz2 binaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.zip |
Enable more spec tests (#6669)
Re-triage all the disabled spec tests and re-enable many of them.
Improve the module splitting logic to correctly handle (by skipping)
quoted modules and their associated assertions.
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 48 |
1 files changed, 20 insertions, 28 deletions
@@ -221,38 +221,30 @@ def run_spec_tests(): check_expected(actual, expected) - # skip binary checks for tests that reuse previous modules by name, as that's a wast-only feature - if 'exports.wast' in base: # FIXME - continue - run_spec_test(wast) # check binary format. here we can verify execution of the final # result, no need for an output verification - # some wast files cannot be split: - # * comments.wast: contains characters that are not valid utf-8, - # so our string splitting code fails there - - # FIXME Remove reference type tests from this list after nullref is - # implemented in V8 - if base not in ['comments.wast', 'ref_null.wast', 'ref_is_null.wast', 'ref_func.wast', 'old_select.wast']: - split_num = 0 - actual = '' - with open('spec.wast', 'w') as transformed_spec_file: - for module, asserts in support.split_wast(wast): - print(' testing split module', split_num) - split_num += 1 - support.write_wast('split.wast', module) - run_opt_test('split.wast') # also that our optimizer doesn't break on it - result_wast_file = shared.binary_format_check('split.wast', verify_final_result=False) - with open(result_wast_file) as f: - result_wast = f.read() - # add the asserts, and verify that the test still passes - transformed_spec_file.write(result_wast + '\n' + '\n'.join(asserts)) - - # compare all the outputs to the expected output - actual = run_spec_test('spec.wast') - check_expected(actual, os.path.join(shared.get_test_dir('spec'), 'expected-output', base + '.log')) + split_num = 0 + actual = '' + with open('spec.wast', 'w') as transformed_spec_file: + for module, asserts in support.split_wast(wast): + if not module: + # Skip any initial assertions that don't have a module + continue + print(' testing split module', split_num) + split_num += 1 + support.write_wast('split.wast', module) + run_opt_test('split.wast') # also that our optimizer doesn't break on it + result_wast_file = shared.binary_format_check('split.wast', verify_final_result=False) + with open(result_wast_file) as f: + result_wast = f.read() + # add the asserts, and verify that the test still passes + transformed_spec_file.write(result_wast + '\n' + '\n'.join(asserts)) + + # compare all the outputs to the expected output + actual = run_spec_test('spec.wast') + check_expected(actual, os.path.join(shared.get_test_dir('spec'), 'expected-output', base + '.log')) def run_validator_tests(): |