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") get() = if (name == null) workingDir.resolve("javaOut") else workingDir.resolve("$name/javaOut")
val directives: File val directives: File
get() = workingDir.resolve("directives.txt") get() = projectDir.resolve("directives.txt")
override fun toString(): String = override fun toString(): String =
"compilation '$name'" "compilation '$name'"
@@ -69,6 +69,8 @@ abstract class BaseJvmAbiTest : TestCase() {
dep.abiDir dep.abiDir
} }
val directives = if (compilation.directives.exists()) compilation.directives.readText() else null
val messageCollector = LocationReportingTestMessageCollector() val messageCollector = LocationReportingTestMessageCollector()
val compiler = K2JVMCompiler() val compiler = K2JVMCompiler()
val args = compiler.createArguments().apply { val args = compiler.createArguments().apply {
@@ -81,9 +83,12 @@ abstract class BaseJvmAbiTest : TestCase() {
).toTypedArray() ).toTypedArray()
destination = compilation.destinationDir.canonicalPath destination = compilation.destinationDir.canonicalPath
useOldBackend = !useIrBackend useOldBackend = !useIrBackend
languageVersion = if (!compilation.directives.exists()) null else { languageVersion =
InTextDirectivesUtils.findStringWithPrefixes(compilation.directives.readText(), "// LANGUAGE_VERSION:") 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) val exitCode = compiler.exec(messageCollector, Services.EMPTY, args)
if (exitCode != ExitCode.OK || messageCollector.errors.isNotEmpty()) { if (exitCode != ExitCode.OK || messageCollector.errors.isNotEmpty()) {
@@ -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