Skip to content

Commit 31139d5

Browse files
committed
ci: make examples/build_examples.vsh print more details about failures, and about the used V executable
1 parent 00e6a09 commit 31139d5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

examples/build_examples.vsh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env -S v
22

3+
import os
4+
5+
const vexe = os.quoted_path(@VEXE)
6+
37
fn println_one_of_many(msg string, entry_idx int, entries_len int) {
48
eprintln('${entry_idx + 1:2}/${entries_len:-2} ${msg}')
59
}
610

7-
print('v version: ${execute('v version').output}')
11+
println('v executable: ${vexe}')
12+
print('v version: ${execute('${vexe} version').output}')
813

914
examples_dir := join_path(@VMODROOT, 'examples')
1015
mut all_entries := walk_ext(examples_dir, '.v')
@@ -31,13 +36,17 @@ mut err := 0
3136
mut failures := []string{}
3237
chdir(examples_dir)!
3338
for entry_idx, entry in entries {
34-
cmd := 'v -N -W ${entry}'
39+
cmd := '${vexe} -N -W ${entry}'
3540
println_one_of_many('compile with: ${cmd}', entry_idx, entries.len)
3641
ret := execute(cmd)
3742
if ret.exit_code != 0 {
3843
err++
39-
eprintln('>>> FAILURE')
4044
failures << cmd
45+
eprintln('>>> FAILURE')
46+
eprintln('>>> err:')
47+
eprintln('----------------------------------------------------------------------------------')
48+
eprintln(ret.output)
49+
eprintln('----------------------------------------------------------------------------------')
4150
}
4251
}
4352

0 commit comments

Comments
 (0)