1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/prod_test.v
Toby Webb ab37081f02 add production mode tests
Due to the inability to detect warnings in REPL tests, I implemented running something very similar, but with the -prod flag enabled.
(See https://github.com/vlang/v/pull/2536)

There is also a minor change in os.walk_ext to not add duplicated path separators:
/path//file.ext -> /path/file.ext
2019-11-09 19:35:26 +03:00

29 lines
771 B
V

// Build and run files in ./prod/ folder, comparing their output to *.expected.txt files.
// (Similar to REPL tests, but in -prod mode.)
// import os
import compiler.tests.repl.runner
import benchmark
fn test_all_v_prod_files() {
// TODO: Fix running this test on Windows:
$if !windows {
options := runner.new_prod_options()
mut bmark := benchmark.new_benchmark()
for file in options.files {
// println('file:$file')
bmark.step()
fres := runner.run_prod_file(options.wd, options.vexec, file) or {
bmark.fail()
eprintln( bmark.step_message(err) )
assert false
continue
}
bmark.ok()
println( bmark.step_message(fres) )
assert true
}
bmark.stop()
println( bmark.total_message('total time spent running PROD files') )
}
}