Skip to content

Refactor testing to avoid shell scripts, make matching more robust#626

Merged
alexcrichton merged 1 commit intoWebAssembly:mainfrom
alexcrichton:refactor-running-tests
Apr 20, 2026
Merged

Refactor testing to avoid shell scripts, make matching more robust#626
alexcrichton merged 1 commit intoWebAssembly:mainfrom
alexcrichton:refactor-running-tests

Conversation

@alexcrichton
Copy link
Copy Markdown
Collaborator

This commit is a refactor of how the test suite in this repository is specified. Previously an all-encompassing testcase.sh script would run all tests and assert various properties using various scripts and files that were present throughout the test suite. This has a number of downsides:

  • With CMake configuration it's not a fan of using glob to discover tests.
  • Using scripts is generally not that portable as commands can differ between platforms or be missing entirely (e.g. Windows).
  • The current "filter" scripts are pretty brittle and often need changes with newer Wasmtime versions. For example some tests don't pass with more recent Wasmtime versions due to output changes.

Instead tests are now specified manually in CMakeLists.txt rather than globbed up, and various options are plumbed through to CTest in CMake. This makes the tests literally just a single invocation of wasmtime where CTest has various assertions about the result of the process execution after-the-fact. This gets all tests passing with the latest version of Wasmtime and additionally updates CI as well.

This commit is a refactor of how the test suite in this repository is
specified. Previously an all-encompassing `testcase.sh` script would run
all tests and assert various properties using various scripts and files
that were present throughout the test suite. This has a number of
downsides:

* With CMake configuration it's not a fan of using `glob` to discover tests.
* Using scripts is generally not that portable as commands can differ
  between platforms or be missing entirely (e.g. Windows).
* The current "filter" scripts are pretty brittle and often need changes
  with newer Wasmtime versions. For example some tests don't pass with
  more recent Wasmtime versions due to output changes.

Instead tests are now specified manually in `CMakeLists.txt` rather than
globbed up, and various options are plumbed through to CTest in CMake.
This makes the tests literally just a single invocation of `wasmtime`
where CTest has various assertions about the result of the process
execution after-the-fact. This gets all tests passing with the latest
version of Wasmtime and additionally updates CI as well.
@alexcrichton alexcrichton requested a review from dicej April 20, 2026 15:32
@alexcrichton alexcrichton enabled auto-merge (squash) April 20, 2026 15:56
@alexcrichton alexcrichton merged commit dde480a into WebAssembly:main Apr 20, 2026
10 of 11 checks passed
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

Successfully merging this pull request may close these issues.

2 participants