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

Add some low level tests #19

Merged
merged 11 commits into from
Feb 16, 2023
Merged

Add some low level tests #19

merged 11 commits into from
Feb 16, 2023

Commits on Jan 23, 2023

  1. Add some low level tests

    ```
    (venv) spacetanuki% TOYWASM=~/git/toywasm/b/toywasm python3 test-runner/wasi_test_runner.py -t ~/git/wasm/wasi-threads/test/testsuite -r ~/git/toywasm/test/wasi-testsuite-adapter.py
    Test wasi_threads_exit_nonmain_wasi passed
    Test wasi_threads_exit_main_busy passed
    Test wasi_threads_exit_main_wasi passed
    Test wasi_threads_exit_nonmain_busy passed
    Test wasi_threads_spawn passed
    Test wasi_threads_exit_main_block passed
    Test wasi_threads_exit_nonmain_block passed
    
    ===== Test results =====
    Runtime: toywasm v0.0
    Suite: WASI threads proposal
      Total: 7
      Passed:  7
      Failed:  0
    
    Test suites: 1 passed, 0 total
    Tests:       7 passed, 0 total
    (venv) spacetanuki%
    ```
    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    4ad2f95 View commit details
    Browse the repository at this point in the history
  2. import shared memory in wat tests

    as suggested in WebAssembly/wasi-libc#369
    
    the corresponding toywasm change:
    yamt/toywasm@4d81846
    
    ```
    spacetanuki% TOYWASM=~/git/toywasm/b/toywasm python3 ~/git/wasm/wasi-testsuite/test-runner/wasi_test_runner.py -t ./test/testsuite -r ~/git/toywasm/test/wasi-testsuite-adapter.py
    Test wasi_threads_exit_nonmain_wasi passed
    Test wasi_threads_exit_main_busy passed
    Test wasi_threads_exit_main_wasi passed
    Test wasi_threads_exit_nonmain_busy passed
    Test wasi_threads_spawn passed
    Test wasi_threads_exit_main_block passed
    Test wasi_threads_exit_nonmain_block passed
    
    ===== Test results =====
    Runtime: toywasm v0.0
    Suite: WASI threads proposal
      Total: 7
      Passed:  7
      Failed:  0
    
    Test suites: 1 passed, 0 total
    Tests:       7 passed, 0 total
    spacetanuki%
    ```
    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    3d9d00d View commit details
    Browse the repository at this point in the history
  3. Make wat test export memory as well

    While it's a bit redundant to both import and export a memory,
    it's what WASI implementations expect.
    
    Emscripten, toywasm:
    Import alone is fine. But export wouldn't hurt.
    
    wasm-micro-runtime:
    Export is checked. Nothing actually seems to rely on it though.
    
    wasmtime:
    Export is necessary?
    
    References:
    https://github.com/WebAssembly/WASI/blob/main/legacy/application-abi.md#current-unstable-abi
    WebAssembly#22
    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    cd61a73 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d6206dd View commit details
    Browse the repository at this point in the history
  5. Rename build.sh to build-c.sh

    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    0f6a4fd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3b4f5b7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d12f784 View commit details
    Browse the repository at this point in the history
  8. Give names to some locals and params in wat

    Also add some comments
    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    43aaad2 View commit details
    Browse the repository at this point in the history
  9. wasi_threads_spawn.wat: sprinkle a few memory fences

    While I suspect wait and notify are memory barriers for most
    implementations, it's safer to issue explicit fences.
    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    276bd47 View commit details
    Browse the repository at this point in the history
  10. opecode -> opcode in comments

    yamt committed Jan 23, 2023
    Configuration menu
    Copy the full SHA
    7164d4b View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2023

  1. Configuration menu
    Copy the full SHA
    9082bca View commit details
    Browse the repository at this point in the history