Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/actions/install-wasi-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ runs:
using: composite
steps:
- run: |
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-28/wasi-sdk-28.0-x86_64-linux.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-28.0-x86_64-linux" >> $GITHUB_ENV
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-x86_64-linux.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-29.0-x86_64-linux" >> $GITHUB_ENV
if: runner.os == 'Linux'
shell: bash
- run: |
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-28/wasi-sdk-28.0-x86_64-macos.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-28.0-x86_64-macos" >> $GITHUB_ENV
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-x86_64-macos.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-29.0-x86_64-macos" >> $GITHUB_ENV
if: runner.os == 'macOS'
shell: bash
- run: |
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-28/wasi-sdk-28.0-x86_64-windows.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-28.0-x86_64-windows" >> $GITHUB_ENV
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-x86_64-windows.tar.gz -L | tar xzvf -
echo "WASI_SDK_PATH=`pwd`/wasi-sdk-29.0-x86_64-windows" >> $GITHUB_ENV
if: runner.os == 'Windows'
shell: bash
- name: Setup `wasm-tools`
uses: bytecodealliance/actions/wasm-tools/setup@v1
with:
version: "1.240.0"
version: "1.241.2"
- name: Setup `wasmtime`
uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "38.0.3"
version: "dev"
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
with:
submodules: true
- name: Install Rust
run: rustup update beta --no-self-update && rustup default beta
run: rustup update nightly --no-self-update && rustup default nightly
- run: rustup target add wasm32-wasip2
- uses: ./.github/actions/install-wasi-sdk
- run: |
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime-async/async/cancel-import/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main() {
{
test_future_void_writer_t writer;
test_future_void_t reader = test_future_void_new(&writer);
runner_subtask_status_t status = test_async_pending_import(reader);
runner_subtask_status_t status = test_pending_import(reader);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t subtask = RUNNER_SUBTASK_HANDLE(status);
assert(subtask != 0);
Expand All @@ -31,15 +31,15 @@ int main() {
test_future_void_t reader2 = test_future_void_new(&writer2);

// start up one task, it'll be in "STARTED"
runner_subtask_status_t status = test_async_pending_import(reader1);
runner_subtask_status_t status = test_pending_import(reader1);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t subtask1 = RUNNER_SUBTASK_HANDLE(status);
assert(subtask1 != 0);

// Start up a second task after setting the backpressure flag, forcing it
// to be in the "STARTING" state.
test_backpressure_set(true);
status = test_async_pending_import(reader2);
status = test_pending_import(reader2);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTING);
runner_subtask_t subtask2 = RUNNER_SUBTASK_HANDLE(status);
assert(subtask2 != 0);
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime-async/async/cancel-import/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct my_task {
exports_test_future_void_t future;
};

test_callback_code_t exports_test_async_pending_import(exports_test_future_void_t x) {
test_callback_code_t exports_test_pending_import(exports_test_future_void_t x) {
struct my_task *task = (struct my_task*) malloc(sizeof(struct my_task));
assert(task != NULL);
test_waitable_status_t status = exports_test_future_void_read(x);
Expand All @@ -22,7 +22,7 @@ test_callback_code_t exports_test_async_pending_import(exports_test_future_void_
return TEST_CALLBACK_CODE_WAIT(task->set);
}

test_callback_code_t exports_test_async_pending_import_callback(test_event_t *event) {
test_callback_code_t exports_test_pending_import_callback(test_event_t *event) {
struct my_task *task = (struct my_task*) test_context_get();
if (event->event == TEST_EVENT_CANCEL) {
assert(event->waitable == 0);
Expand All @@ -37,7 +37,7 @@ test_callback_code_t exports_test_async_pending_import_callback(test_event_t *ev
assert(event->waitable == task->future);
assert(TEST_WAITABLE_STATE(event->code) == TEST_WAITABLE_COMPLETED);
assert(TEST_WAITABLE_COUNT(event->code) == 0);
exports_test_async_pending_import_return();
exports_test_pending_import_return();
}

test_waitable_join(task->future, 0);
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime-async/async/future-cancel-read/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main() {
test_future_u32_writer_t writer;
test_future_u32_t reader = test_future_u32_new(&writer);

runner_subtask_status_t status = test_async_cancel_before_read(reader);
runner_subtask_status_t status = test_cancel_before_read(reader);
assert(status == RUNNER_SUBTASK_RETURNED);
uint32_t value = 0;
runner_waitable_status_t wstatus = test_future_u32_write(writer, &value);
Expand All @@ -21,7 +21,7 @@ int main() {
test_future_u32_writer_t writer;
test_future_u32_t reader = test_future_u32_new(&writer);

runner_subtask_status_t status = test_async_cancel_after_read(reader);
runner_subtask_status_t status = test_cancel_after_read(reader);
assert(status == RUNNER_SUBTASK_RETURNED);

uint32_t value = 0;
Expand All @@ -36,7 +36,7 @@ int main() {
test_future_u32_t data_reader = test_future_u32_new(&data_writer);
test_future_void_writer_t signal_writer;
test_future_void_t signal_reader = test_future_void_new(&signal_writer);
runner_subtask_status_t status = test_async_start_read_then_cancel(data_reader, signal_reader);
runner_subtask_status_t status = test_start_read_then_cancel(data_reader, signal_reader);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t task = RUNNER_SUBTASK_HANDLE(status);

Expand Down
18 changes: 9 additions & 9 deletions tests/runtime-async/async/future-cancel-read/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
#include <stdlib.h>

// This is a test of a Rust-ism, nothing to do in C.
test_callback_code_t exports_test_async_cancel_before_read(exports_test_future_u32_t x) {
test_callback_code_t exports_test_cancel_before_read(exports_test_future_u32_t x) {
exports_test_future_u32_drop_readable(x);
exports_test_async_cancel_before_read_return();
exports_test_cancel_before_read_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_callback_code_t exports_test_async_cancel_before_read_callback(test_event_t *event) {
test_callback_code_t exports_test_cancel_before_read_callback(test_event_t *event) {
assert(0);
}

test_callback_code_t exports_test_async_cancel_after_read(exports_test_future_u32_t x) {
test_callback_code_t exports_test_cancel_after_read(exports_test_future_u32_t x) {
uint32_t result;
test_waitable_status_t status = exports_test_future_u32_read(x, &result);
assert(status == TEST_WAITABLE_STATUS_BLOCKED);
Expand All @@ -25,11 +25,11 @@ test_callback_code_t exports_test_async_cancel_after_read(exports_test_future_u3

exports_test_future_u32_drop_readable(x);

exports_test_async_cancel_after_read_return();
exports_test_cancel_after_read_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_callback_code_t exports_test_async_cancel_after_read_callback(test_event_t *event) {
test_callback_code_t exports_test_cancel_after_read_callback(test_event_t *event) {
assert(0);
}

Expand All @@ -40,7 +40,7 @@ struct start_read_then_cancel_state {
uint32_t result;
};

test_callback_code_t exports_test_async_start_read_then_cancel(
test_callback_code_t exports_test_start_read_then_cancel(
exports_test_future_u32_t data,
exports_test_future_void_t signal
) {
Expand All @@ -62,7 +62,7 @@ test_callback_code_t exports_test_async_start_read_then_cancel(
return TEST_CALLBACK_CODE_WAIT(state->set);
}

test_callback_code_t exports_test_async_start_read_then_cancel_callback(test_event_t *event) {
test_callback_code_t exports_test_start_read_then_cancel_callback(test_event_t *event) {
struct start_read_then_cancel_state *state =
(struct start_read_then_cancel_state*) test_context_get();
assert(event->event == TEST_EVENT_FUTURE_READ);
Expand All @@ -80,6 +80,6 @@ test_callback_code_t exports_test_async_start_read_then_cancel_callback(test_eve
exports_test_future_void_drop_readable(state->signal);
test_waitable_set_drop(state->set);

exports_test_async_start_read_then_cancel_return();
exports_test_start_read_then_cancel_return();
return TEST_CALLBACK_CODE_EXIT;
}
2 changes: 1 addition & 1 deletion tests/runtime-async/async/future-cancel-write/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main() {
runner_waitable_status_t status = test_future_string_write(writer, &string);
assert(status == RUNNER_WAITABLE_STATUS_BLOCKED);

runner_subtask_status_t status2 = test_async_read_and_drop(reader);
runner_subtask_status_t status2 = test_read_and_drop(reader);
assert(status2 == RUNNER_SUBTASK_RETURNED);

status = test_future_string_cancel_write(writer);
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime-async/async/future-cancel-write/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void exports_test_take_then_drop(exports_test_future_string_t x) {
exports_test_future_string_drop_readable(x);
}

test_callback_code_t exports_test_async_read_and_drop(exports_test_future_string_t x) {
test_callback_code_t exports_test_read_and_drop(exports_test_future_string_t x) {
test_string_t string;
test_waitable_status_t status = exports_test_future_string_read(x, &string);
assert(TEST_WAITABLE_STATE(status) == TEST_WAITABLE_COMPLETED);
Expand All @@ -16,10 +16,10 @@ test_callback_code_t exports_test_async_read_and_drop(exports_test_future_string
exports_test_future_string_drop_readable(x);
test_string_free(&string);

exports_test_async_read_and_drop_return();
exports_test_read_and_drop_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_callback_code_t exports_test_async_read_and_drop_callback(test_event_t *event) {
test_callback_code_t exports_test_read_and_drop_callback(test_event_t *event) {
assert(0);
}
2 changes: 1 addition & 1 deletion tests/runtime-async/async/pending-import/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
int main() {
test_future_void_writer_t writer;
test_future_void_t reader = test_future_void_new(&writer);
runner_subtask_status_t status = test_async_pending_import(reader);
runner_subtask_status_t status = test_pending_import(reader);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t subtask = RUNNER_SUBTASK_HANDLE(status);
assert(subtask != 0);
Expand Down
6 changes: 3 additions & 3 deletions tests/runtime-async/async/pending-import/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct my_task {
exports_test_future_void_t future;
};

test_callback_code_t exports_test_async_pending_import(exports_test_future_void_t x) {
test_callback_code_t exports_test_pending_import(exports_test_future_void_t x) {
struct my_task *task = (struct my_task*) malloc(sizeof(struct my_task));
assert(task != NULL);
test_waitable_status_t status = exports_test_future_void_read(x);
Expand All @@ -22,13 +22,13 @@ test_callback_code_t exports_test_async_pending_import(exports_test_future_void_
return TEST_CALLBACK_CODE_WAIT(task->set);
}

test_callback_code_t exports_test_async_pending_import_callback(test_event_t *event) {
test_callback_code_t exports_test_pending_import_callback(test_event_t *event) {
struct my_task *task = (struct my_task*) test_context_get();
assert(event->event == TEST_EVENT_FUTURE_READ);
assert(event->waitable == task->future);
assert(TEST_WAITABLE_STATE(event->code) == TEST_WAITABLE_COMPLETED);
assert(TEST_WAITABLE_COUNT(event->code) == 0);
exports_test_async_pending_import_return();
exports_test_pending_import_return();

test_waitable_join(task->future, 0);
exports_test_future_void_drop_readable(task->future);
Expand Down
4 changes: 2 additions & 2 deletions tests/runtime-async/async/ping-pong/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main() {
runner_string_t y;
runner_string_set(&y, "world");
test_future_string_t ping_result;
runner_subtask_status_t status = test_async_ping(reader, y, &ping_result);
runner_subtask_status_t status = test_ping(reader, y, &ping_result);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t ping = RUNNER_SUBTASK_HANDLE(status);

Expand Down Expand Up @@ -46,7 +46,7 @@ int main() {
// Start the `pong` subtask
runner_string_t pong_result;
reader = test_future_string_new(&writer);
status = test_async_pong(reader, &pong_result);
status = test_pong(reader, &pong_result);
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_STARTED);
runner_subtask_t pong = RUNNER_SUBTASK_HANDLE(status);

Expand Down
12 changes: 6 additions & 6 deletions tests/runtime-async/async/ping-pong/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ping_task {
exports_test_future_string_writer_t writer;
};

test_callback_code_t exports_test_async_ping(exports_test_future_string_t x, test_string_t *y) {
test_callback_code_t exports_test_ping(exports_test_future_string_t x, test_string_t *y) {
// Initialize a new task
struct ping_task *task = (struct ping_task*) malloc(sizeof(struct ping_task));
assert(task != NULL);
Expand All @@ -37,7 +37,7 @@ test_callback_code_t exports_test_async_ping(exports_test_future_string_t x, tes
return TEST_CALLBACK_CODE_WAIT(task->set);
}

test_callback_code_t exports_test_async_ping_callback(test_event_t *event) {
test_callback_code_t exports_test_ping_callback(test_event_t *event) {
struct ping_task *task = (struct ping_task*) test_context_get();
switch (task->state) {
case PING_S1: {
Expand All @@ -54,7 +54,7 @@ test_callback_code_t exports_test_async_ping_callback(test_event_t *event) {
// Create a new future and start the return of our task with this future.
exports_test_future_string_writer_t writer;
exports_test_future_string_t reader = exports_test_future_string_new(&writer);
exports_test_async_ping_return(reader);
exports_test_ping_return(reader);
task->writer = writer;

// Concatenate `task->read_result` and `task->arg`.
Expand Down Expand Up @@ -114,7 +114,7 @@ struct pong_task {
test_waitable_set_t set;
};

test_callback_code_t exports_test_async_pong(exports_test_future_string_t x) {
test_callback_code_t exports_test_pong(exports_test_future_string_t x) {
struct pong_task *task = (struct pong_task*) malloc(sizeof(struct pong_task));
assert(task != NULL);
task->future = x;
Expand All @@ -130,7 +130,7 @@ test_callback_code_t exports_test_async_pong(exports_test_future_string_t x) {
return TEST_CALLBACK_CODE_WAIT(task->set);
}

test_callback_code_t exports_test_async_pong_callback(test_event_t *event) {
test_callback_code_t exports_test_pong_callback(test_event_t *event) {
struct pong_task *task = (struct pong_task*) test_context_get();

// assert this event is a future read completion
Expand All @@ -149,7 +149,7 @@ test_callback_code_t exports_test_async_pong_callback(test_event_t *event) {
task->set = 0;

// return our string
exports_test_async_pong_return(task->read_result);
exports_test_pong_return(task->read_result);
test_string_free(&task->read_result);

free(task);
Expand Down
2 changes: 1 addition & 1 deletion tests/runtime-async/async/simple-call-import/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <runner.h>

int main() {
runner_subtask_status_t status = test_async_f();
runner_subtask_status_t status = test_f();
assert(RUNNER_SUBTASK_STATE(status) == RUNNER_SUBTASK_RETURNED);
assert(RUNNER_SUBTASK_HANDLE(status) == 0);
}
6 changes: 3 additions & 3 deletions tests/runtime-async/async/simple-call-import/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#include <assert.h>
#include <test.h>

test_subtask_status_t exports_test_async_f() {
exports_test_async_f_return();
test_subtask_status_t exports_test_f() {
exports_test_f_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_subtask_status_t exports_test_async_f_callback(test_event_t *event) {
test_subtask_status_t exports_test_f_callback(test_event_t *event) {
assert(0);
}
4 changes: 2 additions & 2 deletions tests/runtime-async/async/simple-future/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int main() {
runner_waitable_status_t status = test_future_void_write(writer);
assert(status == RUNNER_WAITABLE_STATUS_BLOCKED);

runner_subtask_status_t subtask = test_async_read_future(reader);
runner_subtask_status_t subtask = test_read_future(reader);
assert(RUNNER_SUBTASK_STATE(subtask) == RUNNER_SUBTASK_RETURNED);

runner_waitable_set_t set = runner_waitable_set_new();
Expand All @@ -34,7 +34,7 @@ int main() {
runner_waitable_status_t status = test_future_void_write(writer);
assert(status == RUNNER_WAITABLE_STATUS_BLOCKED);

runner_subtask_status_t subtask = test_async_drop_future(reader);
runner_subtask_status_t subtask = test_drop_future(reader);
assert(RUNNER_SUBTASK_STATE(subtask) == RUNNER_SUBTASK_RETURNED);

runner_waitable_set_t set = runner_waitable_set_new();
Expand Down
12 changes: 6 additions & 6 deletions tests/runtime-async/async/simple-future/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
#include <assert.h>
#include <test.h>

test_subtask_status_t exports_test_async_read_future(exports_test_future_void_t future) {
test_subtask_status_t exports_test_read_future(exports_test_future_void_t future) {
test_waitable_status_t status = exports_test_future_void_read(future);
assert(TEST_WAITABLE_STATE(status) == TEST_WAITABLE_COMPLETED);
assert(TEST_WAITABLE_COUNT(status) == 0);
exports_test_future_void_drop_readable(future);
exports_test_async_read_future_return();
exports_test_read_future_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_subtask_status_t exports_test_async_read_future_callback(test_event_t *event) {
test_subtask_status_t exports_test_read_future_callback(test_event_t *event) {
assert(0);
}

test_subtask_status_t exports_test_async_drop_future(exports_test_future_void_t future) {
test_subtask_status_t exports_test_drop_future(exports_test_future_void_t future) {
exports_test_future_void_drop_readable(future);
exports_test_async_drop_future_return();
exports_test_drop_future_return();
return TEST_CALLBACK_CODE_EXIT;
}

test_subtask_status_t exports_test_async_drop_future_callback(test_event_t *event) {
test_subtask_status_t exports_test_drop_future_callback(test_event_t *event) {
assert(0);
}
Loading