This repository contains isolated integration tests for wasm-rtos.
Every test must have its own directory under tests/. The directory name is the test name.
tests/
queue_api/
main.c
queue_api.c
queue_api.wasm
queue_api.log
Each test directory contains:
main.c— the complete native test runner for one specific OS feature;<test_name>.c— the guest C program compiled to WebAssembly;<test_name>.wasm— the generated WebAssembly module;<test_name>.log— the log generated when the localmain.cruns the module.
There is no repository-level main.c, build/, or logs/ directory.
Every test must be fully self-contained.
- The complete test scenario must be readable in that test's
main.c. main.cmust initialize the OS, load its local.wasm, create the required tasks, run the scheduler, verify the expected behavior, clean up, and write its local.log.- A test must not call a shared test runner.
- A test must not select behavior through
TEST_KIND,HOST_TEST_KIND, or similar dispatch macros. - A test must not include C source files from another test directory.
- A test must not depend on state created by another test.
- Shared test-support code is forbidden. The
tests/support/directory must not exist.
Code may be duplicated between test runners when that keeps each test independent and makes the tested OS behavior explicit.
Run the same automation locally with:
bash ./run-tests.shFor every directory under tests/, the script:
- verifies that
main.cand<test_name>.cexist; - compiles
<test_name>.cinto<test_name>.wasm; - compiles the directory's standalone
main.cinto a temporary native runner; - executes the runner from inside the test directory;
- leaves
<test_name>.login that directory; - removes the temporary native runner.
A missing file, build failure, failed assertion, or non-zero runner exit code fails the complete run.
.github/workflows/run-tests.yml runs run-tests.sh automatically for pushes, pull requests, and manual workflow dispatches.
The workflow installs the native and WASI toolchains, builds and executes every isolated test, and uploads the complete tests/ directory as the isolated-tests artifact. The artifact contains the generated .wasm modules and .log files.
The workflow does not maintain a central list of tests. Adding a correctly structured directory automatically adds that test to CI.
Create a directory whose name describes the OS feature being tested:
tests/new_feature/
main.c
new_feature.c
new_feature.c must expose the WebAssembly entry point needed by the test. main.c must contain the complete host-side verification for that feature and must create new_feature.log when executed.
Do not add shared test helpers or modify a central test dispatcher. The GitHub workflow discovers the new directory automatically.