[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
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectArrayChildren.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val xs = intArrayOf(3, 5, 8)
|
val xs = intArrayOf(3, 5, 8)
|
||||||
return
|
return
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectArrays.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val xs = IntArray(3)
|
val xs = IntArray(3)
|
||||||
xs[0] = 1
|
xs[0] = 1
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectCatchParameter.txt
|
|
||||||
fun main() {
|
fun main() {
|
||||||
try {
|
try {
|
||||||
throw Exception("message 1")
|
throw Exception("message 1")
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectClasses.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val point = Point(1, 2)
|
val point = Point(1, 2)
|
||||||
val person = Person()
|
val person = Person()
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectStrings.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val a = "string literal"
|
val a = "string literal"
|
||||||
val b = buildString {
|
val b = buildString {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canInspectValuesOfPrimitiveTypes.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
var a: Byte = 1
|
var a: Byte = 1
|
||||||
var b: Int = 2
|
var b: Int = 2
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: canStepThroughCode.txt
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
var x = 1
|
var x = 1
|
||||||
var y = 2
|
var y = 2
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
||||||
// LLDB_TRACE: kt33055.txt
|
|
||||||
// FILE: kt33055.kt
|
// FILE: kt33055.kt
|
||||||
fun question(subject: String, names: Array<String> = emptyArray()): String {
|
fun question(subject: String, names: Array<String> = emptyArray()): String {
|
||||||
return buildString { // breakpoint here
|
return buildString { // breakpoint here
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
// FREE_COMPILER_ARGS: -Xg-generate-debug-trampoline=enable
|
||||||
// LLDB_TRACE: kt33364.txt
|
|
||||||
// FILE: kt33364.kt
|
// FILE: kt33364.kt
|
||||||
fun main() {
|
fun main() {
|
||||||
val param = 3
|
val param = 3
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: kt42208.txt
|
|
||||||
// FILE: kt42208-1.kt
|
// FILE: kt42208-1.kt
|
||||||
fun main() {
|
fun main() {
|
||||||
foo()()
|
foo()()
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// FREE_COMPILER_ARGS: -XXLanguage:+UnitConversionsOnArbitraryExpressions
|
// FREE_COMPILER_ARGS: -XXLanguage:+UnitConversionsOnArbitraryExpressions
|
||||||
// LLDB_TRACE: kt42208WithPassingLambdaToAnotherFunction.txt
|
|
||||||
// FILE: kt42208-1.kt
|
// FILE: kt42208-1.kt
|
||||||
fun main() {
|
fun main() {
|
||||||
val a = foo()
|
val a = foo()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: kt42208WithVariable.txt
|
|
||||||
// FILE: kt42208-1.kt
|
// FILE: kt42208-1.kt
|
||||||
fun main() {
|
fun main() {
|
||||||
val a = foo()
|
val a = foo()
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: kt47198.txt
|
|
||||||
// FILE: kt47198.kt
|
// FILE: kt47198.kt
|
||||||
fun foo(a:Int) = print("a: $a")
|
fun foo(a:Int) = print("a: $a")
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: kt47198WithBody.txt
|
|
||||||
// FILE: kt47198.kt
|
// FILE: kt47198.kt
|
||||||
fun foo(a:Int){
|
fun foo(a:Int){
|
||||||
print("a: ${'$'}a")
|
print("a: ${'$'}a")
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: kt61131.txt
|
|
||||||
// FILE: kt61131-1.kt
|
// FILE: kt61131-1.kt
|
||||||
class FooImpl : Foo {
|
class FooImpl : Foo {
|
||||||
override fun bar() = "zzz"
|
override fun bar() = "zzz"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: stepThroughInlineArguments.txt
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun bar(x: Int): Int {
|
fun bar(x: Int): Int {
|
||||||
val res = foo(
|
val res = foo(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// KIND: STANDALONE_LLDB
|
// KIND: STANDALONE_LLDB
|
||||||
// LLDB_TRACE: standalone_lldb_stepping.txt
|
|
||||||
import kotlin.test.*
|
import kotlin.test.*
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
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.FREE_COMPILER_ARGS
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.INPUT_DATA_FILE
|
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.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_DATA_FILE
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.OUTPUT_REGEX
|
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.OUTPUT_REGEX
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.TestDirectives.PROGRAM_ARGS
|
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"
|
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
|
// TODO "MUTED_WHEN" directive should be supported not only in AbstractNativeSimpleTest, but also in other hierarchies
|
||||||
val MUTED_WHEN by enumDirective<MutedOption>(
|
val MUTED_WHEN by enumDirective<MutedOption>(
|
||||||
description = """
|
description = """
|
||||||
@@ -327,13 +320,13 @@ internal fun parseEntryPoint(registeredDirectives: RegisteredDirectives, locatio
|
|||||||
return entryPoint
|
return entryPoint
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun parseLLDBSpec(baseDir: File, registeredDirectives: RegisteredDirectives, location: Location): LLDBSessionSpec {
|
internal fun parseLLDBSpec(testDataFile: File): LLDBSessionSpec {
|
||||||
val specFile = parseFileBasedDirective(baseDir, LLDB_TRACE, registeredDirectives, location)
|
val specFileLocation = testDataFile.absolutePath.removeSuffix(testDataFile.extension) + "txt"
|
||||||
?: fail { "$location: An LLDB session specification must be provided" }
|
val specFile = File(specFileLocation)
|
||||||
return try {
|
return try {
|
||||||
LLDBSessionSpec.parse(specFile.readText())
|
LLDBSessionSpec.parse(specFile.readText())
|
||||||
} catch (e: Exception) {
|
} 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)
|
fixPackageNames(testModules.values, nominalPackageName, testDataFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
val lldbSpec = if (testKind == TestKind.STANDALONE_LLDB)
|
val lldbSpec = if (testKind == TestKind.STANDALONE_LLDB) parseLLDBSpec(testDataFile) else null
|
||||||
parseLLDBSpec(
|
|
||||||
baseDir = testDataFile.parentFile,
|
|
||||||
registeredDirectives,
|
|
||||||
location
|
|
||||||
)
|
|
||||||
else null
|
|
||||||
|
|
||||||
val outputMatcher = lldbSpec?.let {
|
val outputMatcher = lldbSpec?.let {
|
||||||
OutputMatcher(Output.STDOUT) { output -> lldbSpec.checkLLDBOutput(output, settings.get()) }
|
OutputMatcher(Output.STDOUT) { output -> lldbSpec.checkLLDBOutput(output, settings.get()) }
|
||||||
|
|||||||
Reference in New Issue
Block a user