[Native][Tests] Improve reporting for external codegen tests
Add abort() method that adds tests that failed to compile to statistics with Error status.
This commit is contained in:
@@ -553,8 +553,8 @@ fun runTest() {
|
|||||||
project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex)
|
project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex)
|
||||||
project.logger.quiet("The following files were unable to compile:")
|
project.logger.quiet("The following files were unable to compile:")
|
||||||
ktFiles.each { project.logger.quiet(it.name) }
|
ktFiles.each { project.logger.quiet(it.name) }
|
||||||
suite.abort(ex, ktFiles.size())
|
suite.abort("Compilation failed for test suite: $name", ex, ktFiles.collect { it.name })
|
||||||
throw new RuntimeException("Compilation failed", ex)
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the tests.
|
// Run the tests.
|
||||||
|
|||||||
+10
-1
@@ -83,7 +83,16 @@ class KonanTestSuiteReportEnvironment(val name: String, val project: Project, va
|
|||||||
tests += KonanTestCaseReport(name, TestStatus.SKIPPED)
|
tests += KonanTestCaseReport(name, TestStatus.SKIPPED)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun abort(throwable: Throwable, count:Int) {
|
fun abort(comment: String, throwable: Throwable, testNames: List<String>) {
|
||||||
|
testNames.forEach {
|
||||||
|
tc?.startTest(it)
|
||||||
|
tc?.errorTest(it, java.lang.Exception(throwable))
|
||||||
|
tests += KonanTestCaseReport(it, TestStatus.ERROR, "$comment\n${throwable.toString()}")
|
||||||
|
}
|
||||||
|
abort(throwable, testNames.size)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun abort(throwable: Throwable, count: Int) {
|
||||||
statistics.error(count)
|
statistics.error(count)
|
||||||
project.logger.quiet("suite `$name` aborted with exception", throwable)
|
project.logger.quiet("suite `$name` aborted with exception", throwable)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user