You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Create an environment variable called `WASI_SDK_PATH`` giving the path where you extracted the WASI SDK download, i.e., the directory containing `bin`/`lib`/`share`` folders.
- Create an environment variable called `WASI_SDK_PATH` giving the path where you extracted the WASI SDK download, i.e., the directory containing `bin`/`lib`/`share` folders.
There are two suites of tests: [codegen](#testing-wit-bindgen---codegen) and [runtime](#testing-wit-bindgen---runtime). To run all possible tests, across all supported languages, ensure the dependency above are installed then run:
23
+
## Test structure
24
+
There are two suites of tests: [codegen](#testing-wit-bindgen---codegen) and [runtime](#testing-wit-bindgen---runtime). To run all possible tests, across all supported languages, ensure the dependencies above are installed then run:
16
25
17
26
```
18
27
cargo test --workspace
@@ -55,11 +64,11 @@ Use `git submodule init` + `git submodule update` before running the tests.
55
64
56
65
The tests are generated by a macro `codegen_tests` in [crates/test-helpers](../crates/test-helpers/).
57
66
58
-
You can run all`codegen` tests in rust with the following command:
67
+
You can run the`codegen` tests for all languages with the following command:
59
68
60
69
```sh
61
70
cargo run test \
62
-
--languages rust \
71
+
--languages rust,c,cpp,csharp,moonbit \
63
72
--artifacts target/artifacts \
64
73
--rust-wit-bindgen-path ./crates/guest-rust \
65
74
tests/codegen
@@ -77,7 +86,6 @@ wasm and executed on hosts. The code compiled-to-wasm can be one of:
77
86
78
87
*`wasm.rs` - compiled with Rust to WebAssembly
79
88
*`wasm.c` - compiled with Clang
80
-
*`wasm.java` - compiled with TeaVM-WASI
81
89
*`wasm.cs` - compiled with NativeAOT and Mono
82
90
83
91
Existence of these files indicates that the language should be supported for the
@@ -90,6 +98,16 @@ Each of these hosts can also be omitted if the host doesn't implement the test
90
98
or something like that. Otherwise for each host that exists when the host's
91
99
crate generator crate is tested it will run all these tests.
92
100
101
+
You can run the `runtime` tests for all languages with the following command:
102
+
103
+
```sh
104
+
cargo run test \
105
+
--languages rust,c,cpp,csharp,moonbit \
106
+
--artifacts target/artifacts \
107
+
--rust-wit-bindgen-path ./crates/guest-rust \
108
+
tests/runtime
109
+
```
110
+
93
111
## Testing Layout
94
112
95
113
If you're adding a test, all you should generally have to do is edit files in
0 commit comments