@@ -52,10 +52,11 @@ fn test_out_files() {
5252 alloptions := '-o ${os .quoted_path (pexe )} ${file_options .vflags }'
5353 label := mj ('v' , file_options.vflags, 'run' , relpath) + ' == ${mm (out_relpath )} '
5454 //
55+ compile_cmd := '${os .quoted_path (vexe )} ${alloptions } ${os .quoted_path (path )}'
5556 sw_compile := time.new_stopwatch ()
56- compilation := os.execute ('${ os . quoted_path ( vexe )} ${ alloptions } ${ os . quoted_path ( path )}' )
57+ compilation := os.execute (compile_cmd )
5758 compile_ms := sw_compile.elapsed ().milliseconds ()
58- ensure_compilation_succeeded (compilation)
59+ ensure_compilation_succeeded (compilation, compile_cmd )
5960 //
6061 sw_run := time.new_stopwatch ()
6162 res := os.execute (os.quoted_path (pexe))
@@ -129,12 +130,12 @@ fn test_c_must_have_files() {
129130 }
130131 file_options := get_file_options (path)
131132 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 )} '
133134 cmd := '${os .quoted_path (vexe )} ${alloptions } ${os .quoted_path (path )}'
134135 sw_compile := time.new_stopwatch ()
135136 compilation := os.execute (cmd)
136137 compile_ms := sw_compile.elapsed ().milliseconds ()
137- ensure_compilation_succeeded (compilation)
138+ ensure_compilation_succeeded (compilation, cmd )
138139 expected_lines := os.read_lines (must_have_path) or { [] }
139140 generated_c_lines := compilation.output.split_into_lines ()
140141 mut nmatches := 0
@@ -145,6 +146,7 @@ fn test_c_must_have_files() {
145146 // eprintln('> testing: $must_have_path has line: $eline')
146147 } else {
147148 failed_patterns << eline
149+ description + = '\n failed pattern: `${eline }`'
148150 println ('${term .red ('FAIL ')} C:${compile_ms :5 }ms ${description }' )
149151 eprintln ('${must_have_path }:${idx_expected_line + 1 }: expected match error:' )
150152 eprintln ('`${cmd }` did NOT produce expected line:' )
@@ -207,11 +209,13 @@ fn vroot_relative(opath string) string {
207209 return npath.replace (nvroot, '' )
208210}
209211
210- fn ensure_compilation_succeeded (compilation os.Result) {
212+ fn ensure_compilation_succeeded (compilation os.Result, cmd string ) {
211213 if compilation.exit_code < 0 {
214+ eprintln ('> cmd exit_code < 0, cmd: ${cmd }' )
212215 panic (compilation.output)
213216 }
214217 if compilation.exit_code != 0 {
218+ eprintln ('> cmd exit_code != 0, cmd: ${cmd }' )
215219 panic ('compilation failed: ${compilation .output }' )
216220 }
217221}
0 commit comments