diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index d053eb08e7..989ecdabce 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -466,7 +466,15 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr { ts.append_message(.cmd_begin, cmd, mtc) d_cmd := time.new_stopwatch() - mut status := os.system(cmd) + + mut res := os.execute(cmd) + if res.exit_code != 0 { + eprintln(res.output) + } else { + println(res.output) + } + mut status := res.exit_code + mut cmd_duration := d_cmd.elapsed() ts.append_message_with_duration(.cmd_end, '', cmd_duration, mtc) @@ -498,6 +506,12 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr { goto test_passed_system } } + + // most probably compiler error + if res.output.contains(': error: ') { + ts.append_message(.cannot_compile, 'Cannot compile file ${file}', mtc) + } + ts.benchmark.fail() tls_bench.fail() ts.add_failed_cmd(cmd) diff --git a/cmd/tools/modules/testing/output.v b/cmd/tools/modules/testing/output.v index 99669ba7ae..b3b569d282 100644 --- a/cmd/tools/modules/testing/output.v +++ b/cmd/tools/modules/testing/output.v @@ -11,6 +11,8 @@ pub enum MessageKind { skip // the _test.v file was skipped for some reason info // a generic information message, detailing the actions of the `v test` program (some tests could be repeated for example, and the details are sent with an .info status) // + cannot_compile // when the _test.v file compiled with errors + // sentinel // send just once after all executions are done; it signals that the reporting/printing thread should stop the loop and exit } diff --git a/cmd/tools/modules/testing/output_teamcity.v b/cmd/tools/modules/testing/output_teamcity.v index 9b08741a99..b1d270a8f6 100644 --- a/cmd/tools/modules/testing/output_teamcity.v +++ b/cmd/tools/modules/testing/output_teamcity.v @@ -20,6 +20,9 @@ pub fn (r TeamcityReporter) report(index int, message LogMessage) { .cmd_end { eprintln("##teamcity[testSuiteFinished name='${name}' flowId='${message.flow_id}' duration='${message.took}']") } + .cannot_compile { + eprintln("##teamcity[testFailed name='${name}' message='${message.message}']") + } else {} } }