1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: add test jobs for the wasm module, for macos, linux and windows (#17972)

This commit is contained in:
Delyan Angelov
2023-04-16 14:52:00 +03:00
committed by GitHub
parent a49cecc2b4
commit bf749b3559
8 changed files with 172 additions and 88 deletions

View File

@ -1,26 +1,6 @@
module main
import wasm
import os
const exe = os.find_abs_path_of_executable('wasm-validate') or { exit(0) }
fn validate(mod []u8) ! {
mut proc := os.new_process(exe)
proc.set_args(['-'])
proc.set_redirect_stdio()
proc.run()
{
os.fd_write(proc.stdio_fd[0], mod.bytestr())
os.fd_close(proc.stdio_fd[0])
}
proc.wait()
if proc.status != .exited {
return error('wasm-validate exited abormally')
}
if proc.code != 0 {
return error('wasm-validate exited with a non zero exit code')
}
proc.close()
}
fn test_call() {
mut m := wasm.Module{}