diff --git a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/BaseJvmAbiTest.kt b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/BaseJvmAbiTest.kt index a3ce28221f8..20b01627d5b 100644 --- a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/BaseJvmAbiTest.kt +++ b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/BaseJvmAbiTest.kt @@ -10,7 +10,6 @@ import junit.framework.TestCase import org.jetbrains.kotlin.cli.common.ExitCode import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler import org.jetbrains.kotlin.config.Services -import org.jetbrains.kotlin.incremental.utils.TestMessageCollector import java.io.File abstract class BaseJvmAbiTest : TestCase() { @@ -58,7 +57,7 @@ abstract class BaseJvmAbiTest : TestCase() { dep.abiDir } - val messageCollector = TestMessageCollector() + val messageCollector = LocationReportingTestMessageCollector() val compiler = K2JVMCompiler() val args = compiler.createArguments().apply { freeArgs = listOf(compilation.srcDir.canonicalPath) diff --git a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LocationReportingTestMessageCollector.kt b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LocationReportingTestMessageCollector.kt new file mode 100644 index 00000000000..18e8b105306 --- /dev/null +++ b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LocationReportingTestMessageCollector.kt @@ -0,0 +1,23 @@ +package org.jetbrains.kotlin.jvm.abi + +import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation +import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity +import org.jetbrains.kotlin.cli.common.messages.MessageCollector +import java.util.ArrayList + +internal class LocationReportingTestMessageCollector : MessageCollector { + val errors = ArrayList() + + override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) { + if (severity.isError) { + errors.add("e: $location: $message") + } + } + + override fun clear() { + errors.clear() + } + + override fun hasErrors(): Boolean = + errors.isNotEmpty() +} \ No newline at end of file