| 1 | // vtest build: !musl? && !sanitized_job? |
| 2 | import os |
| 3 | |
| 4 | fn test_all_samples_can_be_compiled() { |
| 5 | vexe := @VEXE |
| 6 | vroot := os.dir(vexe) |
| 7 | samples := os.walk_ext('${vroot}/vlib/gg/testdata', '.vv') |
| 8 | mut fails := []string{} |
| 9 | for program_source in samples { |
| 10 | compile_cmd := '${os.quoted_path(vexe)} ${os.quoted_path(program_source)}' |
| 11 | res := os.execute(compile_cmd) |
| 12 | if res.exit_code != 0 { |
| 13 | eprintln('>>> FAIL ${compile_cmd}') |
| 14 | eprintln(res.output) |
| 15 | fails << compile_cmd |
| 16 | } |
| 17 | println('OK ${compile_cmd}') |
| 18 | } |
| 19 | if fails.len > 0 { |
| 20 | eprintln('> Failed summary:') |
| 21 | for f in fails { |
| 22 | eprintln(' failed cmd: ${f}') |
| 23 | } |
| 24 | assert false |
| 25 | } |
| 26 | } |
| 27 | |