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
// convert the .wat file to a .wasm file (also validates the .wat)
207
209
let output = Command::new(cmd)
@@ -249,30 +251,37 @@ fn main() {
249
251
mod tests {
250
252
usesuper::*;
251
253
254
+
/// Here's how this works.
255
+
///
256
+
/// We can take two inputs:
257
+
/// - one is a .wat file from the `test/from-wat` directory
258
+
/// - the other is a .c file from the `test/from-c` directory.
259
+
///
260
+
/// If it starts as a C file, we generate a .wat from that.
261
+
///
262
+
/// In both cases we generate `.wasm` files.
263
+
///
264
+
/// The `.dump` file is a debug representation of the `.wat` file's parsed contents.
265
+
///
266
+
/// We then generate a `.ts` file from our program.
267
+
///
268
+
/// #### from-wat
269
+
/// 1. read .wat
270
+
/// 2. generate and write .wasm from .wat with `wat2wasm`
271
+
///
272
+
/// #### from-c
273
+
/// 1. read .c files
274
+
/// 2. generate and write .wasm from the .c files with `emcc` (which uses `clang`)
275
+
/// 3. generate and write .wat with `wasm2wat`
276
+
///
277
+
/// #### point of convergence
278
+
/// 1. parse .wat and write .dump
279
+
/// 2. generate and write .ts file
280
+
///
281
+
/// #### runtime tests
282
+
/// runtime tests are done from JavaScript, so they need to be run with `pnpm test` in a separate step
252
283
#[test]
253
284
fnrun_conformance_tests(){
254
-
/*
255
-
256
-
Here's how this works. We can take two inputs. One is a .wat file from the `test/from-wat` directory, and the other is a .c file from the `test/from-c` directory. If it starts as a C file, we generate a .wat from that. In both cases we generate `.wasm` files. The `.dump` file is a debug representation of the `.wat` file's parsed contents. We then generate a `.ts` file from our program.
257
-
258
-
## from-wat
259
-
1. read .wat
260
-
2. generate and write .wasm from .wat with wat2wasm
261
-
262
-
## from-c
263
-
1. read .c
264
-
2. generate and write .wasm from the .c with emcc
265
-
3. generate and write .wat with wasm2wat
266
-
267
-
## point of convergence
268
-
- parse .wat and write .dump
269
-
- generate and write .ts file
270
-
271
-
## runtime tests
272
-
runtime tests are done from javascript, so they need to be run with `pnpm test` in a separate step
0 commit comments