Add compilation failures into statistics

This commit is contained in:
Pavel Punegov
2017-11-23 20:45:08 +03:00
committed by Pavel Punegov
parent b1641a2c3b
commit 9e24e41d36
@@ -748,6 +748,9 @@ fun runTest() {
} }
} }
statistics = new Statistics()
def testSuite = createTestSuite(name, statistics)
testSuite.start()
// Build tests in the group // Build tests in the group
flags = (flags ?: []) + "-tr" flags = (flags ?: []) + "-tr"
def compileList = [] def compileList = []
@@ -762,13 +765,19 @@ fun runTest() {
} }
compileList.add(project.file("testUtils.kt").absolutePath) compileList.add(project.file("testUtils.kt").absolutePath)
compileList.add(project.file("helpers.kt").absolutePath) compileList.add(project.file("helpers.kt").absolutePath)
runCompiler(compileList, buildExePath(), flags) try {
runCompiler(compileList, buildExePath(), flags)
} catch (Exception ex) {
println("ERROR: Compilation failed for test suite: ${testSuite.name} with exception: ${ex}")
ktFiles.each {
def testCase = testSuite.createTestCase(it.name)
testCase.error(ex)
}
throw new RuntimeException("Compilation failed", ex)
}
// Run the tests. // Run the tests.
def currentResult = null def currentResult = null
statistics = new Statistics()
def testSuite = createTestSuite(name, statistics)
testSuite.start()
outputDirectory = outputRootDirectory outputDirectory = outputRootDirectory
arguments = (arguments ?: []) + "--ktest_logger=SILENT" arguments = (arguments ?: []) + "--ktest_logger=SILENT"
ktFiles.each { ktFiles.each {