2019-11-23 19:35:57 +03:00
|
|
|
module main
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
fn failed (msg string) {
|
|
|
|
println ("!!! failed: $msg")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn passed (msg string) {
|
|
|
|
println (">>> passed: $msg")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn vcheck(vfile string) {
|
2019-12-01 11:27:36 +03:00
|
|
|
run_check := "v -show_c_cmd -freestanding --enable-globals run "
|
2019-11-23 19:35:57 +03:00
|
|
|
if 0 == os.system("$run_check $vfile/${vfile}.v") {
|
|
|
|
passed(run_check)
|
|
|
|
} else {
|
|
|
|
failed(run_check)
|
|
|
|
}
|
2019-12-01 11:27:36 +03:00
|
|
|
os.system("ls -lh $vfile/$vfile")
|
2019-11-23 19:35:57 +03:00
|
|
|
os.system("rm -f $vfile/$vfile")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
vcheck("string")
|
|
|
|
vcheck("linuxsys")
|
|
|
|
exit(0)
|
|
|
|
}
|
|
|
|
|