tests: support .vv in compiler_test.v too
parent
55fdae77d5
commit
e3f79df3ac
|
@ -24,17 +24,13 @@ fn test_all() {
|
||||||
})
|
})
|
||||||
for path in paths {
|
for path in paths {
|
||||||
print(path + ' ')
|
print(path + ' ')
|
||||||
program := path.replace('.vv', '.v')
|
program := path
|
||||||
os.cp(path, program) or {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
compilation := os.exec('$vexe -o test -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)
|
|
||||||
res := os.exec('./test') or {
|
res := os.exec('./test') or {
|
||||||
println('nope')
|
println('nope')
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -52,7 +48,7 @@ fn test_all() {
|
||||||
// println(res.output)
|
// println(res.output)
|
||||||
// println('============')
|
// println('============')
|
||||||
mut found := res.output.trim_right('\r\n').replace('\r\n', '\n')
|
mut found := res.output.trim_right('\r\n').replace('\r\n', '\n')
|
||||||
mut expected := os.read_file(program.replace('.v', '') + '.out') or {
|
mut expected := os.read_file(program.replace('.vv', '') + '.out') or {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
expected = expected.trim_right('\r\n').replace('\r\n', '\n')
|
expected = expected.trim_right('\r\n').replace('\r\n', '\n')
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
module: main
|
module: main
|
||||||
function: buggy_function()
|
function: buggy_function()
|
||||||
message: panicing...
|
message: panicing...
|
||||||
file: vlib/v/tests/inout/panic_with_cg.v
|
file: vlib/v/tests/inout/panic_with_cg.vv
|
||||||
line: 3
|
line: 3
|
||||||
|
|
Loading…
Reference in New Issue