test: a wasm test declared with AddTest runs under wasmtime

WasmTestRuns declares a wasm32-wasip1 test on a fixture project and runs
it through RunTests, which builds it and hands it to the wasmtime runner
its target derives. The test has to pass and print its own output.
Before the fix every such test failed with "failed to open wasm module",
because RunTests left the .wasm off. It skips where the WASI sysroot
with exceptions or wasmtime is missing, as WasmHelloRuns does, so it
runs in the Flatpak and skips on a development box without them.
This commit is contained in:
Jorijn van der Graaf 2026-11-01 18:40:38 +01:00
commit 3044ac34a1
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 87 additions and 0 deletions

View file

@ -0,0 +1,9 @@
// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
import std;
int main() {
std::println("hello from a wasm test");
return 0;
}