tests: fix cleanup of compiler_test.v on windows

pull/4697/head
yuyi 2020-05-04 17:33:54 +08:00 committed by GitHub
parent 068da2ea0f
commit c112b3aec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -23,18 +23,26 @@ fn test_all() {
os.cp(path, program) or { os.cp(path, program) or {
panic(err) panic(err)
} }
compilation := os.exec('$vexe -o exe -cflags "-w" -cg $program') or { compilation := os.exec('$vexe -o test -cflags "-w" -cg $program') or {
panic(err) panic(err)
} }
if compilation.exit_code != 0 { if compilation.exit_code != 0 {
panic('compilation failed: $compilation.output') panic('compilation failed: $compilation.output')
} }
// os.rm(program) // os.rm(program)
res := os.exec('./exe') or { res := os.exec('./test') or {
println('nope') println('nope')
panic(err) panic(err)
} }
os.rm('./exe') $if windows {
os.rm('./test.exe')
$if msvc {
os.rm('./test.ilk')
os.rm('./test.pdb')
}
} $else {
os.rm('./test')
}
// println('============') // println('============')
// println(res.output) // println(res.output)
// println('============') // println('============')