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:
@ -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{}
|
||||
|
Reference in New Issue
Block a user