Disable @SourceDebugExtension generation in jvm-abi-gen tests

In these two tests, contents of the annotation differ by design, and
that does not constitute a difference in ABI.
This commit is contained in:
Alexander Udalov
2022-07-17 02:29:21 +02:00
parent 7dad47cd76
commit 6e1cddd039
3 changed files with 14 additions and 7 deletions
@@ -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" }
}
}
}
@@ -1 +1,2 @@
// IGNORE_BACKEND_LEGACY: JVM
// IGNORE_BACKEND_LEGACY: JVM
// NO_SOURCE_DEBUG_EXTENSION
@@ -1 +1,2 @@
// IGNORE_BACKEND_LEGACY: JVM
// IGNORE_BACKEND_LEGACY: JVM
// NO_SOURCE_DEBUG_EXTENSION