1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:57:34 +00:00

Meta: Don't make wasm tests pass when they cannot read a module

Instead, just let them be treated as failing their respective test.
This commit is contained in:
Ali Mohammad Pur 2021-06-04 03:22:33 +04:30 committed by Ali Mohammad Pur
parent 977addf76d
commit d7ba15371b

View file

@ -234,10 +234,7 @@ def gentest(entry, main_name):
def gen_parse_module(name): def gen_parse_module(name):
return ( return (
f'let content;\n ' f'let content = readBinaryWasmFile("Fixtures/SpecTests/{name}.wasm");\n '
f'try {{\n '
f'content = readBinaryWasmFile("Fixtures/SpecTests/{name}.wasm");\n '
f'}} catch {{ read_okay = false; }}\n '
f'const module = parseWebAssemblyModule(content)\n ' f'const module = parseWebAssemblyModule(content)\n '
) )
@ -260,12 +257,10 @@ def main():
continue continue
sep = "" sep = ""
print(f'''{{ print(f'''describe({json.dumps(testname)}, () => {{
let readOkay = true;
{gen_parse_module(testname)} {gen_parse_module(testname)}
if (readOkay) {{
{sep.join(gentest(x, testname) for x in description["tests"])} {sep.join(gentest(x, testname) for x in description["tests"])}
}}}} }});
''') ''')