[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:
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectArrayChildren.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val xs = intArrayOf(3, 5, 8)
|
||||
return
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectArrays.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val xs = IntArray(3)
|
||||
xs[0] = 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectCatchParameter.txt
|
||||
|
||||
fun main() {
|
||||
try {
|
||||
throw Exception("message 1")
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectClasses.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val point = Point(1, 2)
|
||||
val person = Person()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectStrings.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = "string literal"
|
||||
val b = buildString {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canInspectValuesOfPrimitiveTypes.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
var a: Byte = 1
|
||||
var b: Int = 2
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: canStepThroughCode.txt
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
var x = 1
|
||||
var y = 2
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
||||
// LLDB_TRACE: kt33055.txt
|
||||
|
||||
// FILE: kt33055.kt
|
||||
fun question(subject: String, names: Array<String> = emptyArray()): String {
|
||||
return buildString { // breakpoint here
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
||||
// LLDB_TRACE: kt33364.txt
|
||||
|
||||
// FILE: kt33364.kt
|
||||
fun main() {
|
||||
val param = 3
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: kt42208.txt
|
||||
|
||||
// FILE: kt42208-1.kt
|
||||
fun main() {
|
||||
foo()()
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// FREE_COMPILER_ARGS: -XXLanguage:+UnitConversionsOnArbitraryExpressions
|
||||
// LLDB_TRACE: kt42208WithPassingLambdaToAnotherFunction.txt
|
||||
|
||||
// FILE: kt42208-1.kt
|
||||
fun main() {
|
||||
val a = foo()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: kt42208WithVariable.txt
|
||||
|
||||
// FILE: kt42208-1.kt
|
||||
fun main() {
|
||||
val a = foo()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: kt47198.txt
|
||||
|
||||
// FILE: kt47198.kt
|
||||
fun foo(a:Int) = print("a: $a")
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: kt47198WithBody.txt
|
||||
|
||||
// FILE: kt47198.kt
|
||||
fun foo(a:Int){
|
||||
print("a: ${'$'}a")
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: kt61131.txt
|
||||
|
||||
// FILE: kt61131-1.kt
|
||||
class FooImpl : Foo {
|
||||
override fun bar() = "zzz"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: stepThroughInlineArguments.txt
|
||||
|
||||
// FILE: main.kt
|
||||
fun bar(x: Int): Int {
|
||||
val res = foo(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// KIND: STANDALONE_LLDB
|
||||
// LLDB_TRACE: standalone_lldb_stepping.txt
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
+4
-11
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -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()) }
|
||||
|
||||
Reference in New Issue
Block a user