[Native] Drop LLDB_TRACE test directive

This directive doesn't have a lot of meaning. It is always set this
way that we are getting text file with the same name as test file.
This commit is contained in:
Ivan Kylchik
2023-12-27 17:08:51 +01:00
committed by Space Team
parent d18660c8f1
commit 2ded62c53e
19 changed files with 22 additions and 35 deletions
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.FREE_CINT
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.FREE_COMPILER_ARGS
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.INPUT_DATA_FILE
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.KIND
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.LLDB_TRACE
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.OUTPUT_DATA_FILE
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.OUTPUT_REGEX
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.PROGRAM_ARGS
@@ -136,12 +135,6 @@ internal object TestDirectives : SimpleDirectivesContainer() {
description = "Specify free CInterop tool arguments"
)
val LLDB_TRACE by stringDirective(
description = """
Specify a filename containing the LLDB commands and the patterns that
the output should match""".trimIndent(),
)
// TODO "MUTED_WHEN" directive should be supported not only in AbstractNativeSimpleTest, but also in other hierarchies
val MUTED_WHEN by enumDirective<MutedOption>(
description = """
@@ -327,13 +320,13 @@ internal fun parseEntryPoint(registeredDirectives: RegisteredDirectives, locatio
return entryPoint
}
internal fun parseLLDBSpec(baseDir: File, registeredDirectives: RegisteredDirectives, location: Location): LLDBSessionSpec {
val specFile = parseFileBasedDirective(baseDir, LLDB_TRACE, registeredDirectives, location)
?: fail { "$location: An LLDB session specification must be provided" }
internal fun parseLLDBSpec(testDataFile: File): LLDBSessionSpec {
val specFileLocation = testDataFile.absolutePath.removeSuffix(testDataFile.extension) + "txt"
val specFile = File(specFileLocation)
return try {
LLDBSessionSpec.parse(specFile.readText())
} catch (e: Exception) {
Assertions.fail<Nothing>("$location: Cannot parse LLDB session specification: " + e.message, e)
Assertions.fail<Nothing>("${testDataFile.absolutePath}: Cannot parse LLDB session specification: " + e.message, e)
}
}
@@ -204,13 +204,7 @@ internal class StandardTestCaseGroupProvider : TestCaseGroupProvider {
fixPackageNames(testModules.values, nominalPackageName, testDataFile)
}
val lldbSpec = if (testKind == TestKind.STANDALONE_LLDB)
parseLLDBSpec(
baseDir = testDataFile.parentFile,
registeredDirectives,
location
)
else null
val lldbSpec = if (testKind == TestKind.STANDALONE_LLDB) parseLLDBSpec(testDataFile) else null
val outputMatcher = lldbSpec?.let {
OutputMatcher(Output.STDOUT) { output -> lldbSpec.checkLLDBOutput(output, settings.get()) }