| 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.) |
| 5 | import v.slow_tests.repl.runner |
| 6 | import benchmark |
| 7 | |
| 8 | fn 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 | |