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 1cfe31af884..bc4617ed90c 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 @@ -54,7 +54,7 @@ abstract class BaseJvmAbiTest : TestCase() { get() = if (name == null) workingDir.resolve("javaOut") else workingDir.resolve("$name/javaOut") val directives: File - get() = workingDir.resolve("directives.txt") + get() = projectDir.resolve("directives.txt") override fun toString(): String = "compilation '$name'" @@ -69,6 +69,8 @@ abstract class BaseJvmAbiTest : TestCase() { dep.abiDir } + val directives = if (compilation.directives.exists()) compilation.directives.readText() else null + val messageCollector = LocationReportingTestMessageCollector() val compiler = K2JVMCompiler() val args = compiler.createArguments().apply { @@ -81,9 +83,12 @@ abstract class BaseJvmAbiTest : TestCase() { ).toTypedArray() destination = compilation.destinationDir.canonicalPath useOldBackend = !useIrBackend - languageVersion = if (!compilation.directives.exists()) null else { - InTextDirectivesUtils.findStringWithPrefixes(compilation.directives.readText(), "// LANGUAGE_VERSION:") - } + languageVersion = + if (directives != null) + InTextDirectivesUtils.findStringWithPrefixes(directives, "// LANGUAGE_VERSION:") + else null + noSourceDebugExtension = + directives != null && InTextDirectivesUtils.findStringWithPrefixes(directives, "// NO_SOURCE_DEBUG_EXTENSION") != null } val exitCode = compiler.exec(messageCollector, Services.EMPTY, args) if (exitCode != ExitCode.OK || messageCollector.errors.isNotEmpty()) { @@ -118,4 +123,4 @@ abstract class BaseJvmAbiTest : TestCase() { protected val kotlinJvmStdlib = File("dist/kotlinc/lib/kotlin-stdlib.jar").also { check(it.exists()) { "Stdlib file '$it' does not exist" } } -} \ No newline at end of file +} diff --git a/plugins/jvm-abi-gen/testData/compare/declarationOrderPrivateInline/directives.txt b/plugins/jvm-abi-gen/testData/compare/declarationOrderPrivateInline/directives.txt index 3f7eb8b3500..ccc89f0cbd1 100644 --- a/plugins/jvm-abi-gen/testData/compare/declarationOrderPrivateInline/directives.txt +++ b/plugins/jvm-abi-gen/testData/compare/declarationOrderPrivateInline/directives.txt @@ -1 +1,2 @@ -// IGNORE_BACKEND_LEGACY: JVM \ No newline at end of file +// IGNORE_BACKEND_LEGACY: JVM +// NO_SOURCE_DEBUG_EXTENSION diff --git a/plugins/jvm-abi-gen/testData/compare/lambdas/directives.txt b/plugins/jvm-abi-gen/testData/compare/lambdas/directives.txt index 3f7eb8b3500..ccc89f0cbd1 100644 --- a/plugins/jvm-abi-gen/testData/compare/lambdas/directives.txt +++ b/plugins/jvm-abi-gen/testData/compare/lambdas/directives.txt @@ -1 +1,2 @@ -// IGNORE_BACKEND_LEGACY: JVM \ No newline at end of file +// IGNORE_BACKEND_LEGACY: JVM +// NO_SOURCE_DEBUG_EXTENSION