2019-09-15 17:08:16 +02:00
|
|
|
module main
|
|
|
|
|
2019-10-21 13:14:28 +02:00
|
|
|
import compiler.tests.repl.runner
|
2019-09-15 17:08:16 +02:00
|
|
|
import log
|
2019-09-16 16:29:06 +02:00
|
|
|
import benchmark
|
2019-09-15 17:08:16 +02:00
|
|
|
|
2019-12-30 05:23:54 +01:00
|
|
|
fn main() {
|
2019-11-28 09:46:52 +01:00
|
|
|
mut logger := log.Log{}
|
|
|
|
logger.set_level(log.DEBUG)
|
2019-09-15 17:08:16 +02:00
|
|
|
options := runner.new_options()
|
2019-09-16 16:29:06 +02:00
|
|
|
mut bmark := benchmark.new_benchmark()
|
2019-09-15 17:08:16 +02:00
|
|
|
for file in options.files {
|
2019-09-16 16:29:06 +02:00
|
|
|
bmark.step()
|
2019-09-15 17:08:16 +02:00
|
|
|
fres := runner.run_repl_file(options.wd, options.vexec, file) or {
|
2019-09-16 16:29:06 +02:00
|
|
|
bmark.fail()
|
2019-12-30 05:23:54 +01:00
|
|
|
logger.error(bmark.step_message_fail(err))
|
2019-09-15 17:08:16 +02:00
|
|
|
continue
|
|
|
|
}
|
2019-09-16 16:29:06 +02:00
|
|
|
bmark.ok()
|
2019-12-30 05:23:54 +01:00
|
|
|
logger.info(bmark.step_message_ok(fres))
|
2019-09-15 17:08:16 +02:00
|
|
|
}
|
2019-09-16 16:29:06 +02:00
|
|
|
bmark.stop()
|
2019-12-30 05:23:54 +01:00
|
|
|
logger.info(bmark.total_message('total time spent running REPL files'))
|
2019-09-15 17:08:16 +02:00
|
|
|
}
|