Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running spec test suite #110

Closed
17 tasks done
gumb0 opened this issue Jan 30, 2020 · 0 comments
Closed
17 tasks done

Running spec test suite #110

gumb0 opened this issue Jan 30, 2020 · 0 comments

Comments

@gumb0
Copy link
Collaborator

gumb0 commented Jan 30, 2020

Spec test suite: https://github.com/WebAssembly/spec/tree/master/test/core

Converting *.wast files with a wast2json tool produces wasm files + json files like these:
https://gist.github.com/gumb0/a826ed24a6f16e5a6e88c7a9a88a8b3b
https://gist.github.com/gumb0/f7f3e443ced081fd1902c67881d0ac31

Basically for each command in json file we need to do one of the following:

  • module - instantiate module from file (it is then used in the following commands)
    • when instantiate failed, skip following tests
    • provide imports to instantiate when required (link exports of registered modules)
    • spectest module provided by test harness for importing in tests
  • register - register module to be used in the following commands for linking exports-imports of several modules (used in linking.wast, imports.wast, elem.wast)
  • actions
    • invoke an exported function (by name)
    • get exported global value (by name)
    • choosing module for action by name (many cases in linking.json)
  • assertions - check result of an action or module instantiation
    • assert_return
      • support case when no returned value expected (see break-drop.wast)
    • assert_trap
    • assert_exhaustion
    • assert_malformed (support needed only for "module_type": "binary")
    • assert_invalid
    • assert_unlinkable
    • assert_uninstantiable (in start.json and linking.json; in original wast it's assert_trap with module inside)
  • action without assert (see memory_redundancy.wast)

The spec for all possible asserts/actions/commands is at https://github.com/WebAssembly/spec/tree/master/interpreter#scripts
(all of the assertions mentioned there are used in test suite)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants