From 9e24e41d36d1f323eb95ce70a39fca636ecc71f7 Mon Sep 17 00:00:00 2001 From: Pavel Punegov <32519625+PavelPunegov@users.noreply.github.com> Date: Thu, 23 Nov 2017 20:45:08 +0300 Subject: [PATCH] Add compilation failures into statistics --- .../org/jetbrains/kotlin/KonanTest.groovy | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 9a74d41b373..55ce2e71ce5 100644 --- a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -748,6 +748,9 @@ fun runTest() { } } + statistics = new Statistics() + def testSuite = createTestSuite(name, statistics) + testSuite.start() // Build tests in the group flags = (flags ?: []) + "-tr" def compileList = [] @@ -762,13 +765,19 @@ fun runTest() { } compileList.add(project.file("testUtils.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. def currentResult = null - statistics = new Statistics() - def testSuite = createTestSuite(name, statistics) - testSuite.start() outputDirectory = outputRootDirectory arguments = (arguments ?: []) + "--ktest_logger=SILENT" ktFiles.each {