@@ -52,10 +52,11 @@ fn test_out_files() {
52
52
alloptions := '-o ${os.quoted_path(pexe)} ${file_options.vflags} '
53
53
label := mj ('v' , file_options.vflags, 'run' , relpath) + ' == ${mm(out_relpath)} '
54
54
//
55
+ compile_cmd := '${os.quoted_path(vexe)} ${alloptions} ${os.quoted_path(path)} '
55
56
sw_compile := time.new_stopwatch ()
56
- compilation := os.execute (' ${os.quoted_path(vexe)} ${alloptions} ${os.quoted_path(path)} ' )
57
+ compilation := os.execute (compile_cmd )
57
58
compile_ms := sw_compile.elapsed ().milliseconds ()
58
- ensure_compilation_succeeded (compilation)
59
+ ensure_compilation_succeeded (compilation, compile_cmd )
59
60
//
60
61
sw_run := time.new_stopwatch ()
61
62
res := os.execute (os.quoted_path (pexe))
@@ -129,12 +130,12 @@ fn test_c_must_have_files() {
129
130
}
130
131
file_options := get_file_options (path)
131
132
alloptions := '-o - ${file_options.vflags} '
132
- description := mj ('v' , alloptions, relpath) + ' matches ${mm(must_have_relpath)} '
133
+ mut description := mj ('v' , alloptions, relpath) + ' matches ${mm(must_have_relpath)} '
133
134
cmd := '${os.quoted_path(vexe)} ${alloptions} ${os.quoted_path(path)} '
134
135
sw_compile := time.new_stopwatch ()
135
136
compilation := os.execute (cmd)
136
137
compile_ms := sw_compile.elapsed ().milliseconds ()
137
- ensure_compilation_succeeded (compilation)
138
+ ensure_compilation_succeeded (compilation, cmd )
138
139
expected_lines := os.read_lines (must_have_path) or { [] }
139
140
generated_c_lines := compilation.output.split_into_lines ()
140
141
mut nmatches := 0
@@ -145,6 +146,7 @@ fn test_c_must_have_files() {
145
146
// eprintln('> testing: $must_have_path has line: $eline')
146
147
} else {
147
148
failed_patterns << eline
149
+ description + = '\n failed pattern: `${eline} `'
148
150
println ('${term.red('FAIL')} C:${compile_ms:5} ms ${description} ' )
149
151
eprintln ('${must_have_path} :${idx_expected_line + 1} : expected match error:' )
150
152
eprintln ('`${cmd} ` did NOT produce expected line:' )
@@ -207,11 +209,13 @@ fn vroot_relative(opath string) string {
207
209
return npath.replace (nvroot, '' )
208
210
}
209
211
210
- fn ensure_compilation_succeeded (compilation os.Result) {
212
+ fn ensure_compilation_succeeded (compilation os.Result, cmd string ) {
211
213
if compilation.exit_code < 0 {
214
+ eprintln ('> cmd exit_code < 0, cmd: ${cmd} ' )
212
215
panic (compilation.output)
213
216
}
214
217
if compilation.exit_code != 0 {
218
+ eprintln ('> cmd exit_code != 0, cmd: ${cmd} ' )
215
219
panic ('compilation failed: ${compilation.output} ' )
216
220
}
217
221
}
0 commit comments