valgrind: run the tests

pull/4097/head
Alexander Medvednikov 2020-03-21 20:31:30 +01:00
parent 85e411bd7c
commit a02395fe2d
1 changed files with 22 additions and 0 deletions

View File

@ -8,6 +8,8 @@ fn test_all() {
} }
exe := os.executable() exe := os.executable()
dir := os.dir(exe) dir := os.dir(exe)
vexe := os.dir(os.dir(os.dir(os.dir(dir)))) + '/v'
println(vexe)
println(dir) println(dir)
println(111) println(111)
// files := os.ls('$dir/vlib/v/tests/valgrind/') or { // files := os.ls('$dir/vlib/v/tests/valgrind/') or {
@ -15,5 +17,25 @@ fn test_all() {
panic(err) panic(err)
} }
tests := files.filter(it.ends_with('.vv')) tests := files.filter(it.ends_with('.vv'))
for test in tests {
os.system('cp $dir/$test x.v') // cant run .vv file
println(test)
res := os.exec('$vexe x.v') or {
println('valgrind $test failed')
assert false
continue
}
println(res.output)
os.exec('valgrind ./x') or {
println('valgrind $test failed')
assert false
continue
}
println(res.output)
if res.exit_code != 0 {
println('valgrind $test failed')
assert false
}
}
println(tests) println(tests)
} }