v2 / vlib / v / slow_tests / prod_test.v
30 lines · 28 sloc · 799 bytes · 2332ecff4811b8c97dfda8e825170e9397962519
Raw
1// vtest build: tinyc && !sanitized_job?
2
3// Build and run files in ./prod/ folder, comparing their output to *.expected.txt files.
4// (Similar to REPL tests, but in -prod mode.)
5import v.slow_tests.repl.runner
6import benchmark
7
8fn test_all_v_prod_files() {
9 // TODO: Fix running this test on Windows:
10 $if windows {
11 return
12 }
13 options := runner.new_prod_options()
14 mut bmark := benchmark.new_benchmark()
15 for file in options.files {
16 // println('file:${file}')
17 bmark.step()
18 fres := runner.run_prod_file(options.wd, options.vexec, file) or {
19 bmark.fail()
20 eprintln(bmark.step_message_fail(err.msg()))
21 assert false
22 continue
23 }
24 bmark.ok()
25 println(bmark.step_message_ok(fres))
26 assert true
27 }
28 bmark.stop()
29 println(bmark.total_message('total time spent running PROD files'))
30}
31