2021-12-17 20:19:18 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
fn test_all_samples_can_be_compiled() {
|
|
|
|
vexe := @VEXE
|
|
|
|
vroot := os.dir(vexe)
|
|
|
|
samples := os.walk_ext('$vroot/vlib/gg/testdata', '.vv')
|
|
|
|
mut fails := []string{}
|
|
|
|
for program_source in samples {
|
2022-01-22 21:35:18 +01:00
|
|
|
compile_cmd := '${os.quoted_path(vexe)} ${os.quoted_path(program_source)}'
|
2021-12-17 20:19:18 +01:00
|
|
|
res := os.execute(compile_cmd)
|
|
|
|
if res.exit_code != 0 {
|
|
|
|
eprintln('>>> FAIL $compile_cmd')
|
2022-02-22 15:53:06 +01:00
|
|
|
eprintln(res.output)
|
2021-12-17 20:19:18 +01:00
|
|
|
fails << compile_cmd
|
|
|
|
}
|
|
|
|
println('OK $compile_cmd')
|
|
|
|
}
|
|
|
|
if fails.len > 0 {
|
|
|
|
eprintln('> Failed summary:')
|
|
|
|
for f in fails {
|
|
|
|
eprintln(' failed cmd: $f')
|
|
|
|
}
|
|
|
|
assert false
|
|
|
|
}
|
|
|
|
}
|