spec-testsuite.js 934 B

1234567891011121314151617181920212223
  1. let haveSpecTestSuite = false;
  2. try {
  3. readBinaryWasmFile("Fixtures/SpecTests/address.wasm");
  4. haveSpecTestSuite = true;
  5. } catch {}
  6. let testFunction = haveSpecTestSuite ? test : test.skip;
  7. // prettier-ignore
  8. const tests = [
  9. "address", "align", "binary", "binary-leb128", "br_table", "comments", "endianness", "exports",
  10. "f32", "f32_bitwise", "f32_cmp", "f64", "f64_bitwise", "f64_cmp", "float_exprs", "float_literals",
  11. "float_memory", "float_misc", "forward", "func_ptrs", "int_exprs", "int_literals", "labels",
  12. "left-to-right", "linking", "load", "local_get", "memory", "memory_grow", "memory_redundancy",
  13. "memory_size", "memory_trap", "names", "return", "switch", "table", "traps", "type"
  14. ];
  15. for (let testName of tests) {
  16. testFunction(`parse ${testName}`, () => {
  17. const contents = readBinaryWasmFile(`Fixtures/SpecTests/${testName}.wasm`);
  18. parseWebAssemblyModule(contents);
  19. });
  20. }