v2: compiler_test.v should fail on errors.

pull/4205/head
Delyan Angelov 2020-04-02 19:01:31 +03:00
parent d41b7bc813
commit 61f79270a8
3 changed files with 8 additions and 4 deletions

View File

@ -5,6 +5,7 @@ fn test_all() {
$if windows { $if windows {
return return
} }
mut total_errors := 0
vexe := os.getenv('VEXE') vexe := os.getenv('VEXE')
vroot := os.dir(vexe) vroot := os.dir(vexe)
dir := os.join_path(vroot,'vlib/v/tests/inout') dir := os.join_path(vroot,'vlib/v/tests/inout')
@ -25,7 +26,7 @@ fn test_all() {
panic(err) panic(err)
} }
os.rm('exe') os.rm('exe')
x := os.exec('v -o exe -cflags "-w" -cg -backend experimental $program') or { x := os.exec('$vexe -o exe -cflags "-w" -cg -backend experimental $program') or {
panic(err) panic(err)
} }
// os.rm(program) // os.rm(program)
@ -50,9 +51,11 @@ fn test_all() {
println('\nfound:') println('\nfound:')
println(found) println(found)
println('============') println('============')
total_errors++
} }
else { else {
println(term.green('OK')) println(term.green('OK'))
} }
} }
assert total_errors == 0
} }

View File

@ -1,4 +1,4 @@
CODE_OF_CONDUCT.md
CHANGELOG.md CHANGELOG.md
README.md CODE_OF_CONDUCT.md
CONTRIBUTING.md CONTRIBUTING.md
README.md

View File

@ -3,7 +3,8 @@ import os
fn main() { fn main() {
vexe := os.getenv('VEXE') vexe := os.getenv('VEXE')
vroot := os.dir(vexe) vroot := os.dir(vexe)
files := os.ls(vroot) or { panic(err) } mut files := os.ls(vroot) or { panic(err) }
files.sort()
for file in files { for file in files {
if file.ends_with('.md') { if file.ends_with('.md') {
println(file) println(file)