diff --git a/.idea/dictionaries/yan.xml b/.idea/dictionaries/yan.xml index b6690edaf4b..6e6a8ec005f 100644 --- a/.idea/dictionaries/yan.xml +++ b/.idea/dictionaries/yan.xml @@ -8,8 +8,10 @@ impls kapt kotlinc + mutators parceler repl + testdata uast unbox unboxed diff --git a/build.gradle.kts b/build.gradle.kts index e9c23532e27..95c9d69a826 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -634,7 +634,8 @@ tasks { ":plugins:uast-kotlin:test", ":kotlin-annotation-processing-gradle:test", ":kotlinx-serialization-compiler-plugin:test", - ":kotlinx-serialization-ide-plugin:test" + ":kotlinx-serialization-ide-plugin:test", + ":idea:jvm-debugger:jvm-debugger-test:test" ) } diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt index 609d145dff5..a4925059470 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.kt @@ -398,7 +398,7 @@ object KotlinToJVMBytecodeCompiler { (File(path).takeIf(File::isAbsolute) ?: buildFile.resolveSibling(path)).absolutePath } - private class MainClassProvider(generationState: GenerationState, environment: KotlinCoreEnvironment) { + class MainClassProvider(generationState: GenerationState, environment: KotlinCoreEnvironment) { val mainClassFqName: FqName? by lazy { findMainClass(generationState, environment.getSourceFiles()) } private fun findMainClass(generationState: GenerationState, files: List): FqName? { diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/findMainClass.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/findMainClass.kt new file mode 100644 index 00000000000..bcd76de599f --- /dev/null +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/findMainClass.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.cli.jvm.compiler + +import org.jetbrains.kotlin.codegen.state.GenerationState +import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil +import org.jetbrains.kotlin.idea.MainFunctionDetector +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.psi.KtFile + +fun findMainClass(generationState: GenerationState, files: List): FqName? { + val mainFunctionDetector = MainFunctionDetector(generationState.bindingContext, generationState.languageVersionSettings) + return files.asSequence() + .map { file -> + if (mainFunctionDetector.hasMain(file.declarations)) + JvmFileClassUtil.getFileClassInfoNoResolve(file).facadeClassFqName + else + null + } + .singleOrNull { it != null } +} \ No newline at end of file diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java index d5c390c9ae9..4e589411c9f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java @@ -34,7 +34,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase { ) throws Exception { boolean isIgnored = InTextDirectivesUtils.isIgnoredTarget(getBackend(), wholeFile); - compile(files, !isIgnored); + compile(files, !isIgnored, false); try { blackBox(!isIgnored, unexpectedBehaviour); diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index c864c57f0a7..6960cbd9952 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -641,10 +641,10 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { } protected void compile(@NotNull List files) { - compile(files, true); + compile(files, true, false); } - protected void compile(@NotNull List files, boolean reportProblems) { + protected void compile(@NotNull List files, boolean reportProblems, boolean dumpKotlinFiles) { File javaSourceDir = writeJavaFiles(files); configurationKind = extractConfigurationKind(files); @@ -676,18 +676,16 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { generateClassesInFile(reportProblems); - if (javaSourceDir != null && javaClassesOutputDirectory == null) { - // If there are Java files, they should be compiled against the class files produced by Kotlin, so we dump them to the disk - File kotlinOut; - try { - kotlinOut = KotlinTestUtils.tmpDir(toString()); - } - catch (IOException e) { - throw ExceptionUtilsKt.rethrow(e); - } + boolean compileJavaFiles = javaSourceDir != null && javaClassesOutputDirectory == null; + File kotlinOut = null; + // If there are Java files, they should be compiled against the class files produced by Kotlin, so we dump them to the disk + if (dumpKotlinFiles || compileJavaFiles) { + kotlinOut = getKotlinClassesOutputDirectory(); OutputUtilsKt.writeAllTo(classFileFactory, kotlinOut); + } + if (compileJavaFiles) { List javaClasspath = new ArrayList<>(); javaClasspath.add(kotlinOut.getPath()); @@ -695,9 +693,8 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { javaClasspath.add(ForTestCompileRuntime.androidAnnotationsForTests().getPath()); } - javaClassesOutputDirectory = CodegenTestUtil.compileJava( - findJavaSourcesInDirectory(javaSourceDir), javaClasspath, javacOptions - ); + javaClassesOutputDirectory = getJavaClassesOutputDirectory(); + compileJava(findJavaSourcesInDirectory(javaSourceDir), javaClasspath, javacOptions, javaClassesOutputDirectory); } } @@ -801,18 +798,35 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { }, coroutinesPackage); } + @NotNull + protected File getJavaSourcesOutputDirectory() { + return createTempDirectory("java-files"); + } + + @NotNull + protected File getJavaClassesOutputDirectory() { + return createTempDirectory("java-classes"); + } + + protected File getKotlinClassesOutputDirectory() { + return createTempDirectory(toString()); + } + + @NotNull + private static File createTempDirectory(String prefix) { + try { + return KotlinTestUtils.tmpDir(prefix); + } catch (IOException e) { + throw ExceptionUtilsKt.rethrow(e); + } + } + @Nullable - protected static File writeJavaFiles(@NotNull List files) { + protected File writeJavaFiles(@NotNull List files) { List javaFiles = CollectionsKt.filter(files, file -> file.name.endsWith(".java")); if (javaFiles.isEmpty()) return null; - File dir; - try { - dir = KotlinTestUtils.tmpDir("java-files"); - } - catch (IOException e) { - throw ExceptionUtilsKt.rethrow(e); - } + File dir = getJavaSourcesOutputDirectory(); for (TestFile testFile : javaFiles) { File file = new File(dir, testFile.name); diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java index 9bfab9b4f12..d045d1e2fb8 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java @@ -100,11 +100,11 @@ public final class InTextDirectivesUtils { @NotNull public static List findLinesWithPrefixesRemoved(String fileText, String... prefixes) { - return findLinesWithPrefixesRemoved(fileText, true, prefixes); + return findLinesWithPrefixesRemoved(fileText, true, true, prefixes); } @NotNull - public static List findLinesWithPrefixesRemoved(String fileText, boolean trim, String... prefixes) { + public static List findLinesWithPrefixesRemoved(String fileText, boolean trim, boolean strict, String... prefixes) { if (prefixes.length == 0) { throw new IllegalArgumentException("Please specify the prefixes to check"); } @@ -121,7 +121,7 @@ public final class InTextDirectivesUtils { Character.isWhitespace(prefix.charAt(prefix.length() - 1))) { result.add(trim ? noPrefixLine.trim() : StringUtil.trimTrailing(StringsKt.drop(noPrefixLine, 1))); break; - } else { + } else if (strict) { throw new AssertionError( "Line starts with prefix \"" + prefix + "\", but doesn't have space symbol after it: " + line); } diff --git a/generators/build.gradle.kts b/generators/build.gradle.kts index b5da3a2ef0b..5bc8c1255e7 100644 --- a/generators/build.gradle.kts +++ b/generators/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { compile(projectTests(":kotlin-noarg-compiler-plugin")) compile(projectTests(":kotlin-sam-with-receiver-compiler-plugin")) compile(projectTests(":kotlinx-serialization-compiler-plugin")) + compile(projectTests(":idea:jvm-debugger:jvm-debugger-test")) compile(projectTests(":generators:test-generator")) compile(projectTests(":idea")) builtinsCompile("org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion") diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 6fef4c2ff9a..7edbf9697ec 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -53,9 +53,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.* import org.jetbrains.kotlin.idea.debugger.evaluate.* -import org.jetbrains.kotlin.idea.debugger.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.* +import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS @@ -161,6 +162,70 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnostic fun main(args: Array) { System.setProperty("java.awt.headless", "true") + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + testGroup("idea/tests", "idea/testData") { testClass { model("resolve/additionalLazyResolve") @@ -636,63 +701,10 @@ fun main(args: Array) { model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) } - testClass { - model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("debugger/breakpointApplicability") - } - testClass { model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) } - testClass { - model("debugger/smartStepInto") - } - - testClass { - model( - "debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "debugger/tinyApp/src/stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") - model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("debugger/fileRanking") - } - - testClass { - // We need to implement mapping logic for terminal operations - model("debugger/tinyApp/src/streams/sequence", excludeDirs = listOf("terminal")) - } - testClass { model("stubs", extension = "kt") } @@ -754,11 +766,6 @@ fun main(args: Array) { model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") } - testClass { - model("debugger/selectExpression", recursive = false) - model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - testClass { model("coverage/outputFiles") } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.183 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.183 index 7c62ecbaf3f..1fa949c939a 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.183 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.183 @@ -65,9 +65,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.* import org.jetbrains.kotlin.idea.debugger.evaluate.* -import org.jetbrains.kotlin.idea.debugger.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.* +import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS @@ -171,6 +172,70 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin fun main(args: Array) { System.setProperty("java.awt.headless", "true") + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + testGroup("idea/tests", "idea/testData") { testClass { model("resolve/additionalLazyResolve") @@ -628,48 +693,10 @@ fun main(args: Array) { model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) } - testClass { - model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - testClass { model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) } - testClass { - model("debugger/smartStepInto") - } - - testClass { - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") - model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") - model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") - model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("debugger/tinyApp/src/asyncStackTrace") - } - - testClass { - model("debugger/fileRanking") - } - - testClass { - // We need to implement mapping logic for terminal operations - model("debugger/tinyApp/src/streams/sequence", excludeDirs = listOf("terminal")) - } - testClass { model("stubs", extension = "kt") } @@ -727,11 +754,6 @@ fun main(args: Array) { model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") } - testClass { - model("debugger/selectExpression", recursive = false) - model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - testClass { model("coverage/outputFiles") } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 index 41e6d583905..c85a6d51493 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 @@ -65,8 +65,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.* import org.jetbrains.kotlin.idea.debugger.evaluate.* +import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.* +import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS @@ -163,6 +165,70 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin fun main(args: Array) { System.setProperty("java.awt.headless", "true") + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + testGroup("idea/tests", "idea/testData") { testClass { model("resolve/additionalLazyResolve") @@ -615,39 +681,10 @@ fun main(args: Array) { model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) } - testClass { - model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - testClass { model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) } - testClass { - model("debugger/smartStepInto") - } - - testClass { - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") - model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") - model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") - model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("debugger/tinyApp/src/asyncStackTrace") - } - testClass { model("stubs", extension = "kt") } @@ -705,11 +742,6 @@ fun main(args: Array) { model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") } - testClass { - model("debugger/selectExpression", recursive = false) - model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - testClass { model("coverage/outputFiles") } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as35 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as35 index 81297f2f5e2..c85a6d51493 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as35 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as35 @@ -65,8 +65,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.* import org.jetbrains.kotlin.idea.debugger.evaluate.* +import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.* +import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS @@ -163,6 +165,70 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin fun main(args: Array) { System.setProperty("java.awt.headless", "true") + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + testGroup("idea/tests", "idea/testData") { testClass { model("resolve/additionalLazyResolve") @@ -615,35 +681,10 @@ fun main(args: Array) { model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) } - testClass { - model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - testClass { model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) } - testClass { - model("debugger/smartStepInto") - } - - testClass { - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") - model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") - model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") - model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - testClass { model("stubs", extension = "kt") } @@ -701,11 +742,6 @@ fun main(args: Array) { model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") } - testClass { - model("debugger/selectExpression", recursive = false) - model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - testClass { model("coverage/outputFiles") } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 index 81297f2f5e2..c85a6d51493 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 @@ -65,8 +65,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest -import org.jetbrains.kotlin.idea.debugger.* import org.jetbrains.kotlin.idea.debugger.evaluate.* +import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase +import org.jetbrains.kotlin.idea.debugger.test.* +import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS @@ -163,6 +165,70 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin fun main(args: Array) { System.setProperty("java.awt.headless", "true") + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + testGroup("idea/tests", "idea/testData") { testClass { model("resolve/additionalLazyResolve") @@ -615,35 +681,10 @@ fun main(args: Array) { model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) } - testClass { - model("debugger/positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("debugger/positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - testClass { model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) } - testClass { - model("debugger/smartStepInto") - } - - testClass { - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") - model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") - model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") - model("debugger/tinyApp/src/stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("debugger/tinyApp/src/stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("debugger/tinyApp/src/evaluate/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - testClass { model("stubs", extension = "kt") } @@ -701,11 +742,6 @@ fun main(args: Array) { model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") } - testClass { - model("debugger/selectExpression", recursive = false) - model("debugger/selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - testClass { model("coverage/outputFiles") } diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index debc12d7d11..2191620e862 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -157,7 +157,6 @@ dependencies { testCompile(intellijPluginDep("copyright")) testCompile(intellijPluginDep("properties")) testCompile(intellijPluginDep("java-i18n")) - testCompile(intellijPluginDep("stream-debugger")) testCompileOnly(intellijDep()) testCompileOnly(commonDep("com.google.code.findbugs", "jsr305")) testCompileOnly(intellijPluginDep("gradle")) diff --git a/idea/jvm-debugger/jvm-debugger-test/build.gradle.kts b/idea/jvm-debugger/jvm-debugger-test/build.gradle.kts new file mode 100644 index 00000000000..d996042a04c --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/build.gradle.kts @@ -0,0 +1,58 @@ +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + testCompileOnly(intellijDep()) + + testCompile(project(":idea:jvm-debugger:jvm-debugger-core")) + testCompile(project(":idea:jvm-debugger:jvm-debugger-evaluation")) + testCompile(project(":idea:jvm-debugger:jvm-debugger-sequence")) + testCompile(project(":compiler:backend")) + testCompile(files("${System.getProperty("java.home")}/../lib/tools.jar")) + testCompile(project(":kotlin-test:kotlin-test-junit")) + testCompile(projectTests(":compiler:tests-common")) + testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false } + testCompile(commonDep("junit:junit")) + + testCompile(intellijPluginDep("stream-debugger")) + + Platform[191].orLower { + testCompileOnly(intellijDep()) { includeJars("java-api", "java-impl") } + } + + Platform[192].orHigher { + testCompileOnly(intellijPluginDep("java")) { includeJars("java-api", "java-impl") } + testRuntime(intellijPluginDep("java")) + } + + testRuntime(project(":nj2k:nj2k-services")) { isTransitive = false } + testRuntime(project(":idea:idea-jvm")) + testRuntime(project(":idea:idea-native")) { isTransitive = false } + testRuntime(project(":idea:idea-gradle-native")) { isTransitive = false } + testRuntime(project(":kotlin-native:kotlin-native-library-reader")) { isTransitive = false } + testRuntime(project(":kotlin-native:kotlin-native-utils")) { isTransitive = false } + + testRuntime(project(":kotlin-reflect")) + testRuntime(project(":sam-with-receiver-ide-plugin")) + testRuntime(project(":allopen-ide-plugin")) + testRuntime(project(":noarg-ide-plugin")) + testRuntime(project(":kotlin-scripting-idea")) + testRuntime(project(":kotlinx-serialization-ide-plugin")) + + testRuntime(intellijDep()) + testRuntime(intellijRuntimeAnnotations()) +} + +sourceSets { + "main" { none() } + "test" { projectDefault() } +} + +projectTest(parallel = true) { + dependsOn(":dist") + workingDir = rootDir +} + +testsJar() \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractAsyncStackTraceTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt similarity index 64% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractAsyncStackTraceTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt index c90bde6c367..b4d891793a7 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractAsyncStackTraceTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt @@ -1,62 +1,36 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test import com.intellij.debugger.engine.AsyncStackTraceProvider import com.intellij.debugger.engine.JavaValue import com.intellij.debugger.memory.utils.StackFrameItem import com.intellij.execution.process.ProcessOutputTypes import com.intellij.openapi.extensions.Extensions -import com.intellij.openapi.util.io.FileUtil +import org.jetbrains.kotlin.idea.debugger.KotlinCoroutinesAsyncStackTraceProvider +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull import org.jetbrains.kotlin.utils.getSafe -import java.io.File import java.io.PrintWriter import java.io.StringWriter import java.lang.reflect.Modifier -abstract class AbstractAsyncStackTraceTest : KotlinDebuggerTestBase() { +abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithStepping() { private companion object { const val MARGIN = " " val ASYNC_STACKTRACE_EP_NAME = AsyncStackTraceProvider.EP.name } - protected fun doTest(path: String) { - val fileText = FileUtil.loadFile(File(path)) - - configureSettings(fileText) - createAdditionalBreakpoints(fileText) - createDebugProcess(path) - - val area = Extensions.getArea(null) - if (!area.hasExtensionPoint(ASYNC_STACKTRACE_EP_NAME)) { - System.err.println("$ASYNC_STACKTRACE_EP_NAME extension point is not found (probably old IDE version)") + override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) { + val asyncStackTraceProvider = getAsyncStackTraceProvider() + if (asyncStackTraceProvider == null) { finish() return } - val extensionPoint = area.getExtensionPoint(ASYNC_STACKTRACE_EP_NAME) - val asyncStackTraceProvider = extensionPoint.extensions.firstIsInstanceOrNull() - ?: run { - System.err.println("Kotlin coroutine async stack trace provider is not found") - finish() - return - } - doOnBreakpoint { val frameProxy = this.frameProxy if (frameProxy != null) { @@ -80,6 +54,23 @@ abstract class AbstractAsyncStackTraceTest : KotlinDebuggerTestBase() { } } + private fun getAsyncStackTraceProvider(): KotlinCoroutinesAsyncStackTraceProvider? { + val area = Extensions.getArea(null) + if (!area.hasExtensionPoint(ASYNC_STACKTRACE_EP_NAME)) { + System.err.println("$ASYNC_STACKTRACE_EP_NAME extension point is not found (probably old IDE version)") + return null + } + + val extensionPoint = area.getExtensionPoint(ASYNC_STACKTRACE_EP_NAME) + val provider = extensionPoint.extensions.firstIsInstanceOrNull() + + if (provider == null) { + System.err.println("Kotlin coroutine async stack trace provider is not found") + } + + return provider + } + private fun Throwable.stackTraceAsString(): String { val writer = StringWriter() printStackTrace(PrintWriter(writer)) @@ -92,8 +83,12 @@ abstract class AbstractAsyncStackTraceTest : KotlinDebuggerTestBase() { append(MARGIN).appendln(item.toString()) @Suppress("UNCHECKED_CAST") - val variablesField = item.javaClass.declaredFields.first { !Modifier.isStatic(it.modifiers) && it.type == List::class.java } - @Suppress("UNCHECKED_CAST") val variables = variablesField.getSafe(item) as? List + val variablesField = item.javaClass.declaredFields + .first { !Modifier.isStatic(it.modifiers) && it.type == List::class.java } + + @Suppress("UNCHECKED_CAST") + val variables = variablesField.getSafe(item) as? List + if (variables != null) { for (variable in variables) { val descriptor = variable.descriptor @@ -105,4 +100,4 @@ abstract class AbstractAsyncStackTraceTest : KotlinDebuggerTestBase() { } } } -} +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractBreakpointApplicabilityTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractBreakpointApplicabilityTest.kt similarity index 98% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractBreakpointApplicabilityTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractBreakpointApplicabilityTest.kt index 9d47189c537..334cec8983f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractBreakpointApplicabilityTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractBreakpointApplicabilityTest.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test import com.intellij.psi.PsiFile import com.intellij.testFramework.LightProjectDescriptor diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractFileRankingTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt similarity index 98% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractFileRankingTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt index 085dfe5f1b2..675dd1a695f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractFileRankingTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt @@ -3,13 +3,14 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test import com.sun.jdi.ThreadReference import org.jetbrains.kotlin.codegen.ClassFileFactory import org.jetbrains.kotlin.codegen.OriginCollectingClassBuilderFactory import org.jetbrains.kotlin.codegen.getClassFiles import org.jetbrains.kotlin.codegen.state.GenerationState +import org.jetbrains.kotlin.idea.debugger.FileRankingCalculator import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.org.objectweb.asm.tree.ClassNode diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinEvaluateExpressionTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinEvaluateExpressionTest.kt new file mode 100644 index 00000000000..6394760f521 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinEvaluateExpressionTest.kt @@ -0,0 +1,308 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import com.intellij.debugger.engine.ContextUtil +import com.intellij.debugger.engine.SuspendContextImpl +import com.intellij.debugger.engine.evaluation.CodeFragmentKind +import com.intellij.debugger.engine.evaluation.EvaluateException +import com.intellij.debugger.engine.evaluation.TextWithImportsImpl +import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilderImpl +import com.intellij.debugger.engine.events.SuspendContextCommandImpl +import com.intellij.debugger.impl.DebuggerContextImpl +import com.intellij.debugger.impl.DebuggerContextImpl.createDebuggerContext +import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl +import com.intellij.openapi.util.io.FileUtil +import com.intellij.ui.treeStructure.Tree +import com.intellij.xdebugger.impl.ui.tree.ValueMarkup +import com.sun.jdi.ObjectReference +import org.jetbrains.eval4j.ObjectValue +import org.jetbrains.eval4j.Value +import org.jetbrains.eval4j.jdi.asValue +import org.jetbrains.kotlin.codegen.CodegenTestCase.TestFile +import org.jetbrains.kotlin.idea.KotlinFileType +import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinCodeFragmentFactory +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences +import org.jetbrains.kotlin.idea.debugger.test.util.FramePrinter +import org.jetbrains.kotlin.idea.debugger.test.util.FramePrinterDelegate +import org.jetbrains.kotlin.idea.debugger.test.util.SteppingInstruction +import org.jetbrains.kotlin.idea.util.application.runReadAction +import org.jetbrains.kotlin.test.InTextDirectivesUtils.findLinesWithPrefixesRemoved +import org.jetbrains.kotlin.test.InTextDirectivesUtils.findStringWithPrefixes +import java.io.File +import javax.swing.tree.TreeNode + +private data class CodeFragment(val text: String, val result: String, val kind: CodeFragmentKind) + +private data class DebugLabel(val name: String, val localName: String) + +private class EvaluationTestData( + val instructions: List, + val fragments: List, + val debugLabels: List +) + +abstract class AbstractKotlinEvaluateExpressionTest : KotlinDescriptorTestCaseWithStepping(), FramePrinterDelegate { + private companion object { + private val ID_PART_REGEX = "id=[0-9]*".toRegex() + } + + override val debuggerContext: DebuggerContextImpl + get() = super.debuggerContext + + private var isMultipleBreakpointsTest = false + + private var framePrinter: FramePrinter? = null + + fun doSingleBreakpointTest(path: String) { + isMultipleBreakpointsTest = false + doTest(path) + } + + fun doMultipleBreakpointsTest(path: String) { + isMultipleBreakpointsTest = true + doTest(path) + } + + override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) { + val wholeFile = files.wholeFile + + val instructions = SteppingInstruction.parse(wholeFile) + val expressions = loadExpressions(wholeFile) + val blocks = loadCodeBlocks(files.originalFile) + val debugLabels = loadDebugLabels(wholeFile) + + val data = EvaluationTestData(instructions, expressions + blocks, debugLabels) + + framePrinter = FramePrinter(myDebuggerSession, this, preferences, testRootDisposable) + + if (isMultipleBreakpointsTest) { + performMultipleBreakpointTest(data) + } else { + performSingleBreakpointTest(data) + } + } + + override fun tearDown() { + framePrinter?.close() + framePrinter = null + + super.tearDown() + } + + private fun performSingleBreakpointTest(data: EvaluationTestData) { + process(data.instructions) + + doOnBreakpoint { + createDebugLabels(data.debugLabels) + + val exceptions = linkedMapOf() + + for ((expression, expected, kind) in data.fragments) { + mayThrow(exceptions, expression) { + evaluate(this, expression, kind, expected) + } + } + + val completion = { resume(this) } + framePrinter?.printFrame(completion) ?: completion() + + checkExceptions(exceptions) + } + + finish() + } + + private fun performMultipleBreakpointTest(data: EvaluationTestData) { + val exceptions = linkedMapOf() + + for ((expression, expected) in data.fragments) { + mayThrow(exceptions, expression) { + doOnBreakpoint { + try { + evaluate(this, expression, CodeFragmentKind.EXPRESSION, expected) + } finally { + val completion = { resume(this) } + framePrinter?.printFrame(completion) ?: completion() + } + } + } + } + + checkExceptions(exceptions) + finish() + } + + override fun evaluate(suspendContext: SuspendContextImpl, textWithImports: TextWithImportsImpl) { + evaluate(suspendContext, textWithImports, null) + } + + private fun evaluate(suspendContext: SuspendContextImpl, text: String, codeFragmentKind: CodeFragmentKind, expectedResult: String?) { + val textWithImports = TextWithImportsImpl(codeFragmentKind, text, "", KotlinFileType.INSTANCE) + return evaluate(suspendContext, textWithImports, expectedResult) + } + + private fun evaluate(suspendContext: SuspendContextImpl, item: TextWithImportsImpl, expectedResult: String?) { + val evaluationContext = this.evaluationContext + val sourcePosition = ContextUtil.getSourcePosition(suspendContext) + + // Default test debuggerContext doesn't provide a valid stackFrame so we have to create one more for evaluation purposes. + val frameProxy = suspendContext.frameProxy + val threadProxy = frameProxy?.threadProxy() + val debuggerContext = createDebuggerContext(myDebuggerSession, suspendContext, threadProxy, frameProxy) + debuggerContext.initCaches() + + val contextElement = ContextUtil.getContextElement(debuggerContext)!! + + assert(KotlinCodeFragmentFactory().isContextAccepted(contextElement)) { + val text = runReadAction { contextElement.text } + "KotlinCodeFragmentFactory should be accepted for context element otherwise default evaluator will be called. " + + "ContextElement = $text" + } + + contextElement.putCopyableUserData(KotlinCodeFragmentFactory.DEBUG_CONTEXT_FOR_TESTS, debuggerContext) + + suspendContext.runActionInSuspendCommand { + try { + val evaluator = runReadAction { + EvaluatorBuilderImpl.build( + item, + contextElement, + sourcePosition, + this@AbstractKotlinEvaluateExpressionTest.project + ) + } + ?: throw AssertionError("Cannot create an Evaluator for Evaluate Expression") + + val value = evaluator.evaluate(evaluationContext) + val actualResult = value.asValue().asString() + if (expectedResult != null) { + assertEquals( + "Evaluate expression returns wrong result for ${item.text}:\n" + + "expected = $expectedResult\n" + + "actual = $actualResult\n", + expectedResult, actualResult + ) + } + } catch (e: EvaluateException) { + val expectedMessage = e.message?.replaceFirst( + ID_PART_REGEX, + "id=ID" + ) + assertEquals( + "Evaluate expression throws wrong exception for ${item.text}:\n" + + "expected = $expectedResult\n" + + "actual = $expectedMessage\n", + expectedResult, + expectedMessage + ) + } + } + } + + override fun logDescriptor(descriptor: NodeDescriptorImpl, text: String) { + super.logDescriptor(descriptor, text) + } + + override fun expandAll(tree: Tree, runnable: () -> Unit, filter: (TreeNode) -> Boolean, suspendContext: SuspendContextImpl) { + super.expandAll(tree, runnable, HashSet(), filter, suspendContext) + } + + private fun SuspendContextImpl.runActionInSuspendCommand(action: SuspendContextImpl.() -> Unit) { + if (myInProgress) { + action() + } else { + val command = object : SuspendContextCommandImpl(this) { + override fun contextAction(suspendContext: SuspendContextImpl) { + action(suspendContext) + } + } + + // Try to execute the action inside a command if we aren't already inside it. + debuggerSession.process.managerThread?.invoke(command) ?: command.contextAction(this) + } + } + + private fun mayThrow(collector: MutableMap, expression: String, f: () -> Unit) { + try { + f() + } catch (e: Throwable) { + collector[expression] = e + } + } + + private fun checkExceptions(exceptions: MutableMap) { + if (exceptions.isNotEmpty()) { + for (exc in exceptions.values) { + exc.printStackTrace() + } + + val expressionsText = exceptions.entries.joinToString("\n") { (k, v) -> "expression: $k, exception: ${v.message}" } + + @Suppress("ConvertToStringTemplate") + throw AssertionError("Test failed:\n" + expressionsText) + } + } + + private fun Value.asString(): String { + if (this is ObjectValue && this.value is ObjectReference) { + return this.toString().replaceFirst(ID_PART_REGEX, "id=ID") + } + return this.toString() + } + + private fun loadExpressions(testFile: TestFile): List { + val directives = findLinesWithPrefixesRemoved(testFile.content, "// EXPRESSION: ") + val expected = findLinesWithPrefixesRemoved(testFile.content, "// RESULT: ") + assert(directives.size == expected.size) { "Sizes of test directives are different" } + return directives.zip(expected).map { (text, result) -> CodeFragment(text, result, CodeFragmentKind.EXPRESSION) } + } + + private fun loadCodeBlocks(wholeFile: File): List { + val regexp = (Regex.escape(wholeFile.name) + ".fragment\\d*").toRegex() + val fragmentFiles = wholeFile.parentFile.listFiles { _, name -> regexp.matches(name) } ?: emptyArray() + + val codeFragments = mutableListOf() + + for (fragmentFile in fragmentFiles) { + val contents = FileUtil.loadFile(fragmentFile, true) + val value = findStringWithPrefixes(contents, "// RESULT: ") ?: error("'RESULT' directive is missing in $fragmentFile") + codeFragments += CodeFragment(contents, value, CodeFragmentKind.CODE_BLOCK) + } + + return codeFragments + } + + private fun loadDebugLabels(testFile: TestFile): List { + return findLinesWithPrefixesRemoved(testFile.content, "// DEBUG_LABEL: ") + .map { text -> + val labelParts = text.split("=") + assert(labelParts.size == 2) { "Wrong format for DEBUG_LABEL directive: // DEBUG_LABEL: {localVariableName} = {labelText}" } + + val localName = labelParts[0].trim() + val name = labelParts[1].trim() + DebugLabel(name, localName) + } + } + + private fun createDebugLabels(labels: List) { + if (labels.isEmpty()) { + return + } + + val markupMap = NodeDescriptorImpl.getMarkupMap(debugProcess) ?: return + + for ((name, localName) in labels) { + val localVariable = evaluationContext.frameProxy!!.visibleVariableByName(localName) + assert(localVariable != null) { "Cannot find localVariable for label: name = $localName" } + + val localVariableValue = evaluationContext.frameProxy!!.getValue(localVariable) as? ObjectReference + assert(localVariableValue != null) { "Local variable $localName should be an ObjectReference" } + + markupMap[localVariableValue] = ValueMarkup(name, null, name) + } + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinSteppingTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinSteppingTest.kt new file mode 100644 index 00000000000..93e704ba8ef --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractKotlinSteppingTest.kt @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences +import org.jetbrains.kotlin.idea.debugger.test.util.SteppingInstruction +import org.jetbrains.kotlin.idea.debugger.test.util.SteppingInstructionKind + +abstract class AbstractKotlinSteppingTest : KotlinDescriptorTestCaseWithStepping() { + private enum class Category(val instruction: SteppingInstructionKind?) { + StepInto(SteppingInstructionKind.StepInto), + StepOut(SteppingInstructionKind.StepOut), + StepOver(SteppingInstructionKind.StepOver), + ForceStepOver(SteppingInstructionKind.ForceStepOver), + SmartStepInto(SteppingInstructionKind.SmartStepInto), + Custom(null) + } + + private var category: Category? = null + + protected fun doStepIntoTest(path: String) = doTest(path, Category.StepInto) + protected fun doStepOutTest(path: String) = doTest(path, Category.StepOut) + protected fun doStepOverTest(path: String) = doTest(path, Category.StepOver) + protected fun doStepOverForceTest(path: String) = doTest(path, Category.ForceStepOver) + protected fun doSmartStepIntoTest(path: String) = doTest(path, Category.SmartStepInto) + protected fun doCustomTest(path: String) = doTest(path, Category.Custom) + + override fun tearDown() { + category = null + super.tearDown() + } + + private fun doTest(path: String, category: Category) { + this.category = category + super.doTest(path) + } + + override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) { + val category = this.category ?: error("Category is not specified") + val specificKind = category.instruction + + if (specificKind != null) { + val instruction = SteppingInstruction.parseSingle(files.wholeFile, specificKind) + ?: SteppingInstruction(specificKind, 1) + + process(listOf(instruction)) + } else { + val instructions = SteppingInstruction.parse(files.wholeFile) + process(instructions) + } + + finish() + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractPositionManagerTest.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractPositionManagerTest.java similarity index 89% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractPositionManagerTest.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractPositionManagerTest.java index 9a9a77adf12..800089f3fbc 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractPositionManagerTest.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractPositionManagerTest.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.google.common.collect.Lists; import com.intellij.debugger.NoDataException; @@ -20,10 +20,8 @@ import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.LightProjectDescriptor; import com.sun.jdi.Location; import com.sun.jdi.ReferenceType; -import kotlin.Unit; import kotlin.collections.CollectionsKt; import kotlin.io.FilesKt; -import kotlin.jvm.functions.Function1; import kotlin.sequences.SequencesKt; import kotlin.text.StringsKt; import org.jetbrains.annotations.NotNull; @@ -33,7 +31,12 @@ import org.jetbrains.kotlin.codegen.ClassBuilderFactories; import org.jetbrains.kotlin.codegen.GenerationUtils; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.config.*; +import org.jetbrains.kotlin.idea.debugger.KotlinPositionManager; +import org.jetbrains.kotlin.idea.debugger.KotlinPositionManagerFactory; import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches; +import org.jetbrains.kotlin.idea.debugger.test.mock.MockLocation; +import org.jetbrains.kotlin.idea.debugger.test.mock.MockVirtualMachine; +import org.jetbrains.kotlin.idea.debugger.test.mock.SmartMockReferenceTypeContext; import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase; import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseKt; import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor; @@ -51,6 +54,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static org.jetbrains.kotlin.idea.debugger.test.DebuggerTestUtils.DEBUGGER_TESTDATA_PATH_BASE; +import static org.jetbrains.kotlin.idea.debugger.test.DebuggerTestUtils.DEBUGGER_TESTDATA_PATH_RELATIVE; + public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsightFixtureTestCase { // Breakpoint is given as a line comment on a specific line, containing the regexp to match the name of the class where that line // can be found. This pattern matches against these line comments and saves the class name in the first group @@ -59,13 +65,13 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight @NotNull @Override protected String getTestDataPath() { - return PluginTestCaseBase.getTestDataPathBase() + "/debugger/positionManager/"; + return DEBUGGER_TESTDATA_PATH_BASE + "/positionManager"; } @Override public void setUp() { super.setUp(); - myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase()); + myFixture.setTestDataPath(DEBUGGER_TESTDATA_PATH_BASE); } private DebugProcessImpl debugProcess; @@ -92,21 +98,17 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight return positionManager; } - protected void doTest(@NotNull String fileName) throws Exception { + protected void doTest(@NotNull String fileName) { + String path = getPath(fileName); + if (fileName.endsWith(".kt")) { - String path = getPath(fileName); myFixture.configureByFile(path); - } - else { - String path = getPath(fileName); - SequencesKt.forEach(FilesKt.walkTopDown(new File(path)), new Function1() { - @Override - public Unit invoke(File file) { - String fileName = file.getName(); - String path = getPath(fileName); - myFixture.configureByFile(path); - return null; - } + } else { + SequencesKt.forEach(FilesKt.walkTopDown(new File(path)), file -> { + String fileName1 = file.getName(); + String path1 = getPath(fileName1); + myFixture.configureByFile(path1); + return null; }); } @@ -115,7 +117,7 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight @NotNull private static String getPath(@NotNull String fileName) { - return StringsKt.substringAfter(fileName, PluginTestCaseBase.TEST_DATA_PROJECT_RELATIVE.substring(1), fileName); + return StringsKt.substringAfter(fileName, DEBUGGER_TESTDATA_PATH_RELATIVE, fileName); } private void performTest() { @@ -256,7 +258,7 @@ public abstract class AbstractPositionManagerTest extends KotlinLightCodeInsight } @Override - public List classesByName(String name) { + public List classesByName(@NotNull String name) { return CollectionsKt.listOfNotNull(referencesByName.get(name)); } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSelectExpressionForDebuggerTest.kt similarity index 87% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSelectExpressionForDebuggerTest.kt index d9744bacd54..720bbaef8a9 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractSelectExpressionForDebuggerTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSelectExpressionForDebuggerTest.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.evaluate +package org.jetbrains.kotlin.idea.debugger.test import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.debugger.KotlinEditorTextProvider @@ -14,7 +14,6 @@ import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.junit.Assert abstract class AbstractSelectExpressionForDebuggerTest : LightCodeInsightFixtureTestCase() { - override fun setUp() { super.setUp() invalidateLibraryCache(project) @@ -35,15 +34,17 @@ abstract class AbstractSelectExpressionForDebuggerTest : LightCodeInsightFixture val selectedExpression = KotlinEditorTextProvider.findExpressionInner(elementAt, allowMethodCalls) val expected = InTextDirectivesUtils.findStringWithPrefixes(myFixture.file?.text!!, "// EXPECTED: ") - val actualResult = if (selectedExpression != null) + + val actualResult = if (selectedExpression != null) { KotlinEditorTextProvider.getElementInfo(selectedExpression) { it.text } - else + } else { "null" + } Assert.assertEquals("Another expression should be selected", expected, actualResult) } - override fun getProjectDescriptor() = KotlinLightProjectDescriptor.INSTANCE + override fun getProjectDescriptor(): KotlinLightProjectDescriptor = KotlinLightProjectDescriptor.INSTANCE override fun getTestDataPath() = PluginTestCaseBase.getTestDataPathBase() + "/debugger/selectExpression" } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractSmartStepIntoTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSmartStepIntoTest.kt similarity index 80% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractSmartStepIntoTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSmartStepIntoTest.kt index 0734d4b4a98..faf8068ec29 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractSmartStepIntoTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractSmartStepIntoTest.kt @@ -3,11 +3,12 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture import org.jetbrains.kotlin.idea.core.util.CodeInsightUtils import org.jetbrains.kotlin.idea.debugger.stepping.KotlinSmartStepIntoHandler +import org.jetbrains.kotlin.idea.debugger.test.mock.MockSourcePosition import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor import org.jetbrains.kotlin.idea.test.PluginTestCaseBase @@ -26,27 +27,30 @@ abstract class AbstractSmartStepIntoTest : KotlinLightCodeInsightFixtureTestCase val lineStart = CodeInsightUtils.getStartLineOffset(file, line)!! val elementAtOffset = file.findElementAt(lineStart) - val position = MockSourcePosition(_file = fixture.file, - _line = line, - _offset = offset, - _editor = fixture.editor, - _elementAt = elementAtOffset) + val position = MockSourcePosition( + myFile = fixture.file, + myLine = line, + myOffset = offset, + myEditor = fixture.editor, + myElementAt = elementAtOffset + ) val actual = KotlinSmartStepIntoHandler().findSmartStepTargets(position).map { it.presentation } - val expected = InTextDirectivesUtils.findListWithPrefixes(fixture.file?.text!!.replace("\\,", "+++"), "// EXISTS: ").map { it.replace("+++", ",") } + val expected = InTextDirectivesUtils.findListWithPrefixes(fixture.file?.text!!.replace("\\,", "+++"), "// EXISTS: ") + .map { it.replace("+++", ",") } for (actualTargetName in actual) { assert(actualTargetName in expected) { "Unexpected step into target was found: $actualTargetName\n${renderTableWithResults(expected, actual)}" + - "\n // EXISTS: ${actual.joinToString()}" + "\n // EXISTS: ${actual.joinToString()}" } } for (expectedTargetName in expected) { assert(expectedTargetName in actual) { "Missed step into target: $expectedTargetName\n${renderTableWithResults(expected, actual)}" + - "\n // EXISTS: ${actual.joinToString()}" + "\n // EXISTS: ${actual.joinToString()}" } } } @@ -68,7 +72,7 @@ abstract class AbstractSmartStepIntoTest : KotlinLightCodeInsightFixtureTestCase } override fun getTestDataPath(): String { - return PluginTestCaseBase.getTestDataPathBase() + "/debugger/smartStepInto" + return "$DEBUGGER_TESTDATA_PATH_BASE/smartStepInto" } override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AsyncStackTraceTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AsyncStackTraceTestGenerated.java similarity index 72% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/AsyncStackTraceTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AsyncStackTraceTestGenerated.java index 1e0e00f1fc3..ed55c131bbe 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AsyncStackTraceTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AsyncStackTraceTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/debugger/tinyApp/src/asyncStackTrace") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/asyncStackTrace") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class AsyncStackTraceTestGenerated extends AbstractAsyncStackTraceTest { @@ -26,21 +26,21 @@ public class AsyncStackTraceTestGenerated extends AbstractAsyncStackTraceTest { } public void testAllFilesPresentInAsyncStackTrace() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/asyncStackTrace"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/asyncStackTrace"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("asyncFunctions.kt") public void testAsyncFunctions() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/asyncStackTrace/asyncFunctions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/asyncStackTrace/asyncFunctions.kt"); } @TestMetadata("asyncLambdas.kt") public void testAsyncLambdas() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/asyncStackTrace/asyncLambdas.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/asyncStackTrace/asyncLambdas.kt"); } @TestMetadata("asyncSimple.kt") public void testAsyncSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/asyncStackTrace/asyncSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/asyncStackTrace/asyncSimple.kt"); } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/BreakpointApplicabilityTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/BreakpointApplicabilityTestGenerated.java similarity index 65% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/BreakpointApplicabilityTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/BreakpointApplicabilityTestGenerated.java index acdebad5022..d434c3eb3af 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/BreakpointApplicabilityTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/BreakpointApplicabilityTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/debugger/breakpointApplicability") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class BreakpointApplicabilityTestGenerated extends AbstractBreakpointApplicabilityTest { @@ -26,36 +26,36 @@ public class BreakpointApplicabilityTestGenerated extends AbstractBreakpointAppl } public void testAllFilesPresentInBreakpointApplicability() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/breakpointApplicability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("constructors.kt") public void testConstructors() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/constructors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/constructors.kt"); } @TestMetadata("functions.kt") public void testFunctions() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/functions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/functions.kt"); } @TestMetadata("inlineOnly.kt") public void testInlineOnly() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/inlineOnly.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/inlineOnly.kt"); } @TestMetadata("locals.kt") public void testLocals() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/locals.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/locals.kt"); } @TestMetadata("properties.kt") public void testProperties() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/properties.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/properties.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("idea/testData/debugger/breakpointApplicability/simple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/breakpointApplicability/simple.kt"); } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt new file mode 100644 index 00000000000..c02fb17c9f9 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt @@ -0,0 +1,241 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.doWriteAction +import com.intellij.openapi.module.Module +import com.intellij.openapi.roots.LibraryOrderEntry +import com.intellij.openapi.roots.ModuleRootManager +import com.intellij.openapi.roots.OrderRootType +import com.intellij.openapi.util.io.FileUtil +import com.intellij.openapi.vfs.LocalFileSystem +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.openapi.vfs.newvfs.ArchiveFileSystem +import com.intellij.psi.PsiManager +import org.jetbrains.kotlin.caches.resolve.KotlinCacheService +import org.jetbrains.kotlin.cli.common.output.writeAllTo +import org.jetbrains.kotlin.cli.jvm.compiler.findMainClass +import org.jetbrains.kotlin.codegen.* +import org.jetbrains.kotlin.codegen.CodegenTestCase.TestFile +import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime +import org.jetbrains.kotlin.codegen.state.GenerationState +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.JVMConfigurationKeys +import org.jetbrains.kotlin.config.JvmTarget +import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages +import org.jetbrains.kotlin.idea.debugger.test.util.patchDexTests +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.test.MockLibraryUtil +import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase +import java.io.File + +class DebuggerTestCompilerFacility(files: List, private val jvmTarget: JvmTarget, private val applyDexPatch: Boolean) { + private val kotlinStdlibPath = ForTestCompileRuntime.runtimeJarForTests().absolutePath + + private val mainFiles: TestFilesByLanguage + private val libraryFiles: TestFilesByLanguage + + init { + val splitFiles = splitByTarget(files) + mainFiles = splitByLanguage(splitFiles.main) + libraryFiles = splitByLanguage(splitFiles.library) + } + + fun compileExternalLibrary(name: String, srcDir: File, classesDir: File) { + val libSrcPath = File(DEBUGGER_TESTDATA_PATH_BASE, "lib/$name") + if (!libSrcPath.exists()) { + error("Library $name does not exist") + } + + val testFiles = libSrcPath.walk().filter { it.isFile }.toList().map { + val path = it.toRelativeString(libSrcPath) + TestFile(path, FileUtil.loadFile(it, true)) + } + + val libraryFiles = splitByLanguage(testFiles) + compileLibrary(libraryFiles, srcDir, classesDir) + } + + fun compileLibrary(srcDir: File, classesDir: File) { + compileLibrary(this.libraryFiles, srcDir, classesDir) + + srcDir.refreshAndToVirtualFile()?.let { KtUsefulTestCase.refreshRecursively(it) } + classesDir.refreshAndToVirtualFile()?.let { KtUsefulTestCase.refreshRecursively(it) } + } + + private fun compileLibrary(libraryFiles: TestFilesByLanguage, srcDir: File, classesDir: File) = with(libraryFiles) { + resources.copy(classesDir) + (kotlin + java).copy(srcDir) + + if (kotlin.isNotEmpty()) { + MockLibraryUtil.compileKotlin( + srcDir.absolutePath, + classesDir, + listOf("-jvm-target", jvmTarget.description), + kotlinStdlibPath + ) + } + + if (java.isNotEmpty()) { + CodegenTestUtil.compileJava( + java.map { File(srcDir, it.name).absolutePath }, + listOf(kotlinStdlibPath, classesDir.absolutePath), + listOf("-g"), + classesDir + ) + } + + if (applyDexPatch) { + patchDexTests(classesDir) + } + } + + // Returns the qualified name of the main test class. + fun compileTestSources(module: Module, srcDir: File, classesDir: File, libClassesDir: File): String = with(mainFiles) { + resources.copy(srcDir) + resources.copy(classesDir) // sic! + (kotlin + java).copy(srcDir) + + val ktFiles = mutableListOf() + + doWriteAction { + for (file in kotlin + java) { + val ioFile = File(srcDir, file.name) + val virtualFile = ioFile.refreshAndToVirtualFile() ?: error("Cannot find a VirtualFile instance for file $file") + val psiFile = PsiManager.getInstance(module.project).findFile(virtualFile) ?: continue + + if (psiFile is KtFile) { + ktFiles += psiFile + } + } + } + + if (ktFiles.isEmpty()) { + error("No Kotlin files found") + } + + LocalFileSystem.getInstance().refreshAndFindFileByIoFile(classesDir) + LocalFileSystem.getInstance().refreshAndFindFileByIoFile(libClassesDir) + + lateinit var mainClassName: String + + doWriteAction { + mainClassName = compileKotlinFilesInIde(module, ktFiles, classesDir) + } + + if (java.isNotEmpty()) { + CodegenTestUtil.compileJava( + java.map { File(srcDir, it.name).absolutePath }, + getClasspath(module) + listOf(classesDir.absolutePath), + listOf("-g"), + classesDir + ) + } + + if (applyDexPatch) { + patchDexTests(classesDir) + } + + return mainClassName + } + + private fun compileKotlinFilesInIde(module: Module, files: List, classesDir: File): String { + val project = module.project + val resolutionFacade = KotlinCacheService.getInstance(project).getResolutionFacade(files) + + val analysisResult = resolutionFacade.analyzeWithAllCompilerChecks(files) + analysisResult.throwIfError() + + val moduleDescriptor = resolutionFacade.moduleDescriptor + val bindingContext = analysisResult.bindingContext + + val configuration = CompilerConfiguration() + configuration.put(JVMConfigurationKeys.JVM_TARGET, jvmTarget) + + val state = GenerationState.Builder(project, ClassBuilderFactories.BINARIES, moduleDescriptor, bindingContext, files, configuration) + .generateDeclaredClassFilter(GenerationState.GenerateClassFilter.GENERATE_ALL) + .codegenFactory(DefaultCodegenFactory) + .build() + + KotlinCodegenFacade.compileCorrectFiles(state, CompilationErrorHandler.THROW_EXCEPTION) + + val extraDiagnostics = state.collectedExtraJvmDiagnostics + if (!extraDiagnostics.isEmpty()) { + val compoundMessage = extraDiagnostics.joinToString("\n") { DefaultErrorMessages.render(it) } + error("One or more errors occurred during code generation: \n$compoundMessage") + } + + state.factory.writeAllTo(classesDir) + + return findMainClass(state, files)?.asString() ?: error("Cannot find main class name") + } + + private fun getClasspath(module: Module): List { + val moduleRootManager = ModuleRootManager.getInstance(module) + val classpath = moduleRootManager.orderEntries.filterIsInstance() + .flatMap { it.library?.rootProvider?.getFiles(OrderRootType.CLASSES)?.asList().orEmpty() } + + val paths = mutableListOf() + for (entry in classpath) { + val fileSystem = entry.fileSystem + if (fileSystem is ArchiveFileSystem) { + val localFile = fileSystem.getLocalByEntry(entry) ?: continue + paths += localFile.path + } else if (fileSystem is LocalFileSystem) { + paths += entry.path + } + } + + return paths + } +} + +private fun File.refreshAndToVirtualFile(): VirtualFile? = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(this) + +private fun List.copy(destination: File) { + for (file in this) { + val target = File(destination, file.name) + target.parentFile.mkdirs() + target.writeText(file.content) + } +} + +class TestFilesByTarget(val main: List, val library: List) + +class TestFilesByLanguage(val kotlin: List, val java: List, val resources: List) + +private fun splitByTarget(files: List): TestFilesByTarget { + val main = mutableListOf() + val lib = mutableListOf() + + for (file in files) { + val container = if (file.name.startsWith("lib/") || file.name.startsWith("customLib/")) lib else main + container += file + } + + return TestFilesByTarget(main = main, library = lib) +} + +private fun splitByLanguage(files: List): TestFilesByLanguage { + val kotlin = mutableListOf() + val java = mutableListOf() + val resources = mutableListOf() + + for (file in files) { + @Suppress("MoveVariableDeclarationIntoWhen") + val extension = file.name.substringAfterLast(".", missingDelimiterValue = "") + + val container = when (extension) { + "kt", "kts" -> kotlin + "java" -> java + else -> resources + } + + container += file + } + + return TestFilesByLanguage(kotlin = kotlin, java = java, resources = resources) +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestUtils.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestUtils.kt new file mode 100644 index 00000000000..815508a31a7 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestUtils.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:JvmName("DebuggerTestUtils") +package org.jetbrains.kotlin.idea.debugger.test + +import org.jetbrains.kotlin.test.KotlinTestUtils + +const val DEBUGGER_TESTDATA_PATH_RELATIVE = "idea/jvm-debugger/jvm-debugger-test/testData" + +@JvmField +val DEBUGGER_TESTDATA_PATH_BASE = KotlinTestUtils.getHomeDirectory() + "/" + DEBUGGER_TESTDATA_PATH_RELATIVE \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/FileRankingTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/FileRankingTestGenerated.java similarity index 62% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/FileRankingTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/FileRankingTestGenerated.java index 868ac7f91ad..002fd84ff1f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/FileRankingTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/FileRankingTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/debugger/fileRanking") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class FileRankingTestGenerated extends AbstractFileRankingTest { @@ -26,66 +26,66 @@ public class FileRankingTestGenerated extends AbstractFileRankingTest { } public void testAllFilesPresentInFileRanking() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/fileRanking"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("anonymousClasses.kt") public void testAnonymousClasses() throws Exception { - runTest("idea/testData/debugger/fileRanking/anonymousClasses.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/anonymousClasses.kt"); } @TestMetadata("differentFlags.kt") public void testDifferentFlags() throws Exception { - runTest("idea/testData/debugger/fileRanking/differentFlags.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/differentFlags.kt"); } @TestMetadata("init.kt") public void testInit() throws Exception { - runTest("idea/testData/debugger/fileRanking/init.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/init.kt"); } @TestMetadata("lambdas.kt") public void testLambdas() throws Exception { - runTest("idea/testData/debugger/fileRanking/lambdas.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/lambdas.kt"); } @TestMetadata("multilinePrimaryConstructor.kt") public void testMultilinePrimaryConstructor() throws Exception { - runTest("idea/testData/debugger/fileRanking/multilinePrimaryConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/multilinePrimaryConstructor.kt"); } @TestMetadata("multilinePrimaryConstructorWithBody.kt") public void testMultilinePrimaryConstructorWithBody() throws Exception { - runTest("idea/testData/debugger/fileRanking/multilinePrimaryConstructorWithBody.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/multilinePrimaryConstructorWithBody.kt"); } @TestMetadata("parametersWithUnloadedClass.kt") public void testParametersWithUnloadedClass() throws Exception { - runTest("idea/testData/debugger/fileRanking/parametersWithUnloadedClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/parametersWithUnloadedClass.kt"); } @TestMetadata("propertyDelegates.kt") public void testPropertyDelegates() throws Exception { - runTest("idea/testData/debugger/fileRanking/propertyDelegates.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/propertyDelegates.kt"); } @TestMetadata("sameClassName.kt") public void testSameClassName() throws Exception { - runTest("idea/testData/debugger/fileRanking/sameClassName.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/sameClassName.kt"); } @TestMetadata("sameClassNameDifferentMethodNames.kt") public void testSameClassNameDifferentMethodNames() throws Exception { - runTest("idea/testData/debugger/fileRanking/sameClassNameDifferentMethodNames.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/sameClassNameDifferentMethodNames.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("idea/testData/debugger/fileRanking/simple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/simple.kt"); } @TestMetadata("topLevel.kt") public void testTopLevel() throws Exception { - runTest("idea/testData/debugger/fileRanking/topLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/topLevel.kt"); } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt new file mode 100644 index 00000000000..595ccea8aa1 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt @@ -0,0 +1,224 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import com.intellij.debugger.impl.DescriptorTestCase +import com.intellij.debugger.impl.OutputChecker +import com.intellij.execution.configurations.JavaParameters +import com.intellij.execution.process.ProcessOutputTypes +import com.intellij.openapi.roots.LibraryOrderEntry +import com.intellij.openapi.roots.ModifiableRootModel +import com.intellij.openapi.roots.ModuleRootManager +import com.intellij.openapi.roots.OrderRootType +import com.intellij.openapi.roots.ui.configuration.libraryEditor.NewLibraryEditor +import com.intellij.openapi.util.ThrowableComputable +import com.intellij.openapi.util.io.FileUtil +import com.intellij.openapi.vfs.VfsUtil +import com.intellij.psi.PsiFile +import com.intellij.testFramework.EdtTestUtil +import com.intellij.xdebugger.XDebugSession +import org.jetbrains.kotlin.codegen.CodegenTestCase.TestFile +import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime +import org.jetbrains.kotlin.config.JvmTarget +import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches +import org.jetbrains.kotlin.idea.debugger.test.preference.* +import org.jetbrains.kotlin.idea.debugger.test.util.BreakpointCreator +import org.jetbrains.kotlin.idea.debugger.test.util.KotlinOutputChecker +import org.jetbrains.kotlin.idea.debugger.test.util.LogPropagator +import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil +import org.jetbrains.kotlin.idea.test.PluginTestCaseBase +import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.TestMetadata +import org.jetbrains.kotlin.test.testFramework.runWriteAction +import org.junit.ComparisonFailure +import java.io.File + +internal const val KOTLIN_LIBRARY_NAME = "KotlinLibrary" +internal const val TEST_LIBRARY_NAME = "TestLibrary" + +class TestFiles(val originalFile: File, val wholeFile: TestFile, files: List) : List by files + +abstract class KotlinDescriptorTestCase : DescriptorTestCase() { + private lateinit var testAppDirectory: File + private lateinit var sourcesOutputDirectory: File + + private lateinit var librarySrcDirectory: File + private lateinit var libraryOutputDirectory: File + + private lateinit var mainClassName: String + + override fun getTestAppPath(): String = testAppDirectory.absolutePath + override fun getTestProjectJdk() = PluginTestCaseBase.fullJdk() + + private fun systemLogger(message: String) = println(message, ProcessOutputTypes.SYSTEM) + + private var breakpointCreator: BreakpointCreator? = null + private var logPropagator: LogPropagator? = null + + private var oldValues: OldValuesStorage? = null + + override fun runBare() { + testAppDirectory = KotlinTestUtils.tmpDir("debuggerTestSources") + sourcesOutputDirectory = File(testAppDirectory, "src").apply { mkdirs() } + + librarySrcDirectory = File(testAppDirectory, "libSrc").apply { mkdirs() } + libraryOutputDirectory = File(testAppDirectory, "lib").apply { mkdirs() } + + super.runBare() + } + + override fun setUp() { + super.setUp() + + KotlinDebuggerCaches.LOG_COMPILATIONS = true + logPropagator = LogPropagator(::systemLogger).apply { attach() } + } + + override fun tearDown() { + KotlinDebuggerCaches.LOG_COMPILATIONS = false + + oldValues?.revertValues() + oldValues = null + + detachLibraries() + + logPropagator?.detach() + logPropagator = null + + super.tearDown() + } + + fun doTest(path: String) { + val wholeFile = File(path) + val wholeFileContents = FileUtil.loadFile(wholeFile, true) + + val testFiles = createTestFiles(wholeFile, wholeFileContents) + val preferences = DebuggerPreferences(myProject, wholeFileContents) + + oldValues = SettingsMutators.mutate(preferences) + + val rawJvmTarget = preferences[DebuggerPreferenceKeys.JVM_TARGET] + val jvmTarget = JvmTarget.fromString(rawJvmTarget) ?: error("Invalid JVM target value: $rawJvmTarget") + val applyDexPatch = preferences[DebuggerPreferenceKeys.EMULATE_DEX] + + val compilerFacility = DebuggerTestCompilerFacility(testFiles, jvmTarget, applyDexPatch) + + for (library in preferences[DebuggerPreferenceKeys.ATTACH_LIBRARY]) { + compilerFacility.compileExternalLibrary(library, librarySrcDirectory, libraryOutputDirectory) + } + + compilerFacility.compileLibrary(librarySrcDirectory, libraryOutputDirectory) + mainClassName = compilerFacility.compileTestSources(myModule, sourcesOutputDirectory, File(appOutputPath), libraryOutputDirectory) + + breakpointCreator = BreakpointCreator( + project, + ::systemLogger, + preferences + ).apply { createAdditionalBreakpoints(wholeFileContents) } + + createLocalProcess(mainClassName) + doMultiFileTest(testFiles, preferences) + } + + private fun createTestFiles(wholeFile: File, wholeFileContents: String): TestFiles { + val testFiles = KotlinTestUtils.createTestFiles( + wholeFile.name, + wholeFileContents, + object : KotlinTestUtils.TestFileFactoryNoModules() { + override fun create(fileName: String, text: String, directives: Map): TestFile { + return TestFile(fileName, text) + } + } + ) + + val wholeTestFile = TestFile(wholeFile.name, wholeFileContents) + return TestFiles(wholeFile, wholeTestFile, testFiles) + } + + abstract fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) + + override fun initOutputChecker(): OutputChecker { + return KotlinOutputChecker(getTestDirectoryPath(), testAppPath, appOutputPath) + } + + override fun setUpModule() { + super.setUpModule() + attachLibraries() + } + + override fun setUpProject() { + super.setUpProject() + File(appOutputPath).mkdirs() + } + + override fun createBreakpoints(file: PsiFile?) { + if (file != null) { + val breakpointCreator = this.breakpointCreator ?: error(BreakpointCreator::class.java.simpleName + " should be set") + breakpointCreator.createBreakpoints(file) + } + } + + override fun createJavaParameters(mainClass: String?): JavaParameters { + return super.createJavaParameters(mainClass).apply { + ModuleRootManager.getInstance(myModule).orderEntries.asSequence().filterIsInstance() + classPath.add(ForTestCompileRuntime.runtimeJarForTests()) + classPath.add(libraryOutputDirectory) + } + } + + private fun attachLibraries() { + runWriteAction { + val kotlinStdlibJar = ForTestCompileRuntime.runtimeJarForTests() + val kotlinStdlibSourcesJar = ForTestCompileRuntime.runtimeSourcesJarForTests() + + val model = ModuleRootManager.getInstance(myModule).modifiableModel + attachLibrary(model, KOTLIN_LIBRARY_NAME, kotlinStdlibJar, kotlinStdlibSourcesJar) + attachLibrary(model, TEST_LIBRARY_NAME, libraryOutputDirectory, librarySrcDirectory) + model.commit() + } + } + + private fun detachLibraries() { + EdtTestUtil.runInEdtAndGet(ThrowableComputable { + ConfigLibraryUtil.removeLibrary(module, KOTLIN_LIBRARY_NAME) + ConfigLibraryUtil.removeLibrary(module, TEST_LIBRARY_NAME) + }) + } + + private fun attachLibrary(model: ModifiableRootModel, libraryName: String, classes: File, sources: File) { + val customLibEditor = NewLibraryEditor().apply { + name = libraryName + + addRoot(VfsUtil.getUrlForLibraryRoot(classes), OrderRootType.CLASSES) + addRoot(VfsUtil.getUrlForLibraryRoot(sources), OrderRootType.SOURCES) + } + + ConfigLibraryUtil.addLibrary(customLibEditor, model, null) + } + + override fun checkTestOutput() { + if (KotlinTestUtils.isAllFilesPresentTest(getTestName(false))) { + return + } + + try { + super.checkTestOutput() + } catch (e: ComparisonFailure) { + KotlinTestUtils.assertEqualsToFile(File(getTestDirectoryPath(), getTestName(true) + ".out"), e.actual) + } + + } + + override fun getData(dataId: String): Any? { + if (XDebugSession.DATA_KEY.`is`(dataId)) { + return myDebuggerSession?.xDebugSession + } + + return super.getData(dataId) + } + + private fun getTestDirectoryPath(): String = javaClass.getAnnotation(TestMetadata::class.java).value +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCaseWithStepping.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCaseWithStepping.kt new file mode 100644 index 00000000000..eb8e8abfa72 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCaseWithStepping.kt @@ -0,0 +1,165 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test + +import com.intellij.debugger.actions.MethodSmartStepTarget +import com.intellij.debugger.engine.* +import com.intellij.debugger.engine.evaluation.EvaluationContextImpl +import com.intellij.debugger.impl.DebuggerContextImpl +import com.intellij.debugger.impl.JvmSteppingCommandProvider +import com.intellij.debugger.impl.PositionUtil +import com.intellij.execution.process.ProcessOutputTypes +import com.sun.jdi.request.StepRequest +import org.jetbrains.kotlin.idea.debugger.stepping.* +import org.jetbrains.kotlin.idea.debugger.test.util.SteppingInstruction +import org.jetbrains.kotlin.idea.debugger.test.util.SteppingInstructionKind +import org.jetbrains.kotlin.idea.debugger.test.util.renderSourcePosition +import org.jetbrains.kotlin.idea.util.application.runReadAction +import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer +import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext +import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance + +abstract class KotlinDescriptorTestCaseWithStepping : KotlinDescriptorTestCase() { + private val dp: DebugProcessImpl + get() = debugProcess ?: throw AssertionError("createLocalProcess() should be called before getDebugProcess()") + + @Volatile + private var myEvaluationContext: EvaluationContextImpl? = null + val evaluationContext get() = myEvaluationContext!! + + @Volatile + private var myDebuggerContext: DebuggerContextImpl? = null + protected open val debuggerContext get() = myDebuggerContext!! + + @Volatile + private var myCommandProvider: KotlinSteppingCommandProvider? = null + private val commandProvider get() = myCommandProvider!! + + private fun initContexts(suspendContext: SuspendContextImpl) { + myEvaluationContext = createEvaluationContext(suspendContext) + myDebuggerContext = createDebuggerContext(suspendContext) + myCommandProvider = JvmSteppingCommandProvider.EP_NAME.extensions.firstIsInstance() + } + + internal fun process(instructions: List) { + instructions.forEach(this::process) + } + + internal fun doOnBreakpoint(action: SuspendContextImpl.() -> Unit) { + super.onBreakpoint { + try { + initContexts(it) + it.printContext() + it.action() + } catch (e: AssertionError) { + throw e + } catch (e: Throwable) { + e.printStackTrace() + resume(it) + } + } + } + + internal fun finish() { + doOnBreakpoint { + resume(this) + } + } + + private fun SuspendContextImpl.doStepInto(ignoreFilters: Boolean, smartStepFilter: MethodFilter?) { + val stepIntoCommand = + runReadAction { commandProvider.getStepIntoCommand(this, ignoreFilters, smartStepFilter, StepRequest.STEP_LINE) } + ?: dp.createStepIntoCommand(this, ignoreFilters, smartStepFilter) + + dp.managerThread.schedule(stepIntoCommand) + } + + private fun SuspendContextImpl.doStepOut() { + val stepOutCommand = runReadAction { commandProvider.getStepOutCommand(this, debuggerContext) } + ?: dp.createStepOutCommand(this) + + dp.managerThread.schedule(stepOutCommand) + } + + private fun SuspendContextImpl.doStepOver(ignoreBreakpoints: Boolean = false) { + val stepOverCommand = runReadAction { commandProvider.getStepOverCommand(this, ignoreBreakpoints, debuggerContext) } + ?: dp.createStepOverCommand(this, ignoreBreakpoints) + + dp.managerThread.schedule(stepOverCommand) + } + + private fun process(instruction: SteppingInstruction) { + fun loop(count: Int, block: SuspendContextImpl.() -> Unit) { + repeat(count) { + doOnBreakpoint(block) + } + } + + when (instruction.kind) { + SteppingInstructionKind.StepInto -> loop(instruction.arg) { doStepInto(false, null) } + SteppingInstructionKind.StepOut -> loop(instruction.arg) { doStepOut() } + SteppingInstructionKind.StepOver -> loop(instruction.arg) { doStepOver() } + SteppingInstructionKind.ForceStepOver -> loop(instruction.arg) { doStepOver(ignoreBreakpoints = true) } + SteppingInstructionKind.SmartStepInto -> loop(instruction.arg) { doSmartStepInto() } + SteppingInstructionKind.SmartStepIntoByIndex -> doOnBreakpoint { doSmartStepInto(instruction.arg) } + SteppingInstructionKind.Resume -> loop(instruction.arg) { resume(this) } + } + } + + private fun SuspendContextImpl.doSmartStepInto(chooseFromList: Int = 0) { + this.doSmartStepInto(chooseFromList, false) + } + + private fun SuspendContextImpl.printContext() { + runReadAction { + if (this.frameProxy == null) { + return@runReadAction println("Context thread is null", ProcessOutputTypes.SYSTEM) + } + + val sourcePosition = PositionUtil.getSourcePosition(this) + println(renderSourcePosition(sourcePosition), ProcessOutputTypes.SYSTEM) + } + } + + private fun SuspendContextImpl.doSmartStepInto(chooseFromList: Int, ignoreFilters: Boolean) { + val filters = createSmartStepIntoFilters() + if (chooseFromList == 0) { + filters.forEach { + dp.managerThread!!.schedule(dp.createStepIntoCommand(this, ignoreFilters, it)) + } + } else { + try { + dp.managerThread!!.schedule(dp.createStepIntoCommand(this, ignoreFilters, filters[chooseFromList - 1])) + } catch (e: IndexOutOfBoundsException) { + val elementText = runReadAction { debuggerContext.sourcePosition.elementAt.getElementTextWithContext() } + throw AssertionError("Couldn't find smart step into command at: \n$elementText", e) + } + } + } + + private fun createSmartStepIntoFilters() = runReadAction { + val position = debuggerContext.sourcePosition + + val stepTargets = KotlinSmartStepIntoHandler().findSmartStepTargets(position) + stepTargets.mapNotNull { stepTarget -> + when (stepTarget) { + is KotlinLambdaSmartStepTarget -> + KotlinLambdaMethodFilter( + stepTarget.getLambda(), stepTarget.getCallingExpressionLines()!!, stepTarget.isInline, stepTarget.isSuspend + ) + is KotlinMethodSmartStepTarget -> + KotlinBasicStepMethodFilter( + stepTarget.declaration?.createSmartPointer(), + stepTarget.isInvoke, + stepTarget.targetMethodName, + stepTarget.getCallingExpressionLines()!! + ) + is MethodSmartStepTarget -> BasicStepMethodFilter(stepTarget.method, stepTarget.getCallingExpressionLines()) + else -> null + } + } + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java similarity index 53% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java index 0505316e4a0..e401bbcb940 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinEvaluateExpressionTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinEvaluateExpressionTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.evaluate; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @RunWith(JUnit3RunnerWithInners.class) public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluateExpressionTest { - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SingleBreakpoint extends AbstractKotlinEvaluateExpressionTest { @@ -29,454 +29,454 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat @TestMetadata("abstractFunCall.kt") public void testAbstractFunCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/abstractFunCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/abstractFunCall.kt"); } @TestMetadata("accessToOverridenPropertyWithBackingField.kt") public void testAccessToOverridenPropertyWithBackingField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/accessToOverridenPropertyWithBackingField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/accessToOverridenPropertyWithBackingField.kt"); } public void testAllFilesPresentInSingleBreakpoint() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("annotationValue.kt") public void testAnnotationValue() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/annotationValue.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/annotationValue.kt"); } @TestMetadata("anonymousObjects.kt") public void testAnonymousObjects() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/anonymousObjects.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/anonymousObjects.kt"); } @TestMetadata("arrayMethods.kt") public void testArrayMethods() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/arrayMethods.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/arrayMethods.kt"); } @TestMetadata("arrays.kt") public void testArrays() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/arrays.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/arrays.kt"); } @TestMetadata("boxParam.kt") public void testBoxParam() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/boxParam.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/boxParam.kt"); } @TestMetadata("boxReturnValue.kt") public void testBoxReturnValue() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/boxReturnValue.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/boxReturnValue.kt"); } @TestMetadata("breakpointInInlineFun.kt") public void testBreakpointInInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/breakpointInInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.kt"); } @TestMetadata("callableBug.kt") public void testCallableBug() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/callableBug.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/callableBug.kt"); } @TestMetadata("classFromAnotherPackage.kt") public void testClassFromAnotherPackage() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/classFromAnotherPackage.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.kt"); } @TestMetadata("classObjectVal.kt") public void testClassObjectVal() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/classObjectVal.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classObjectVal.kt"); } @TestMetadata("collections.kt") public void testCollections() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/collections.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/collections.kt"); } @TestMetadata("dataClassCopy.kt") public void testDataClassCopy() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dataClassCopy.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/dataClassCopy.kt"); } @TestMetadata("defaultParameterValues.kt") public void testDefaultParameterValues() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/defaultParameterValues.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/defaultParameterValues.kt"); } @TestMetadata("defaultParameterValues2.kt") public void testDefaultParameterValues2() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/defaultParameterValues2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/defaultParameterValues2.kt"); } @TestMetadata("delegatedPropertyInOtherFile.kt") public void testDelegatedPropertyInOtherFile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/delegatedPropertyInOtherFile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.kt"); } @TestMetadata("delegatedVariables.kt") public void testDelegatedVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/delegatedVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedVariables.kt"); } @TestMetadata("dependentOnFile.kt") public void testDependentOnFile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/dependentOnFile.kt"); } @TestMetadata("doubles.kt") public void testDoubles() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/doubles.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/doubles.kt"); } @TestMetadata("enums.kt") public void testEnums() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/enums.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/enums.kt"); } @TestMetadata("errors.kt") public void testErrors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/errors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/errors.kt"); } @TestMetadata("escapedNames.kt") public void testEscapedNames() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/escapedNames.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/escapedNames.kt"); } @TestMetadata("experimentalApi.kt") public void testExperimentalApi() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/experimentalApi.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/experimentalApi.kt"); } @TestMetadata("extractLocalVariables.kt") public void testExtractLocalVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractLocalVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extractLocalVariables.kt"); } @TestMetadata("extractThis.kt") public void testExtractThis() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractThis.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extractThis.kt"); } @TestMetadata("extractThisInTrait.kt") public void testExtractThisInTrait() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractThisInTrait.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extractThisInTrait.kt"); } @TestMetadata("extractVariablesFromCall.kt") public void testExtractVariablesFromCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extractVariablesFromCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extractVariablesFromCall.kt"); } @TestMetadata("fieldGetters.kt") public void testFieldGetters() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/fieldGetters.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.kt"); } @TestMetadata("fileWithError.kt") public void testFileWithError() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/fileWithError.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.kt"); } @TestMetadata("funFromSuperClass.kt") public void testFunFromSuperClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/funFromSuperClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/funFromSuperClass.kt"); } @TestMetadata("genericCrossinlineArgument.kt") public void testGenericCrossinlineArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/genericCrossinlineArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/genericCrossinlineArgument.kt"); } @TestMetadata("imports.kt") public void testImports() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/imports.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/imports.kt"); } @TestMetadata("importsLambdaContext.kt") public void testImportsLambdaContext() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/importsLambdaContext.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/importsLambdaContext.kt"); } @TestMetadata("inlineFunInMultiFilePackage.kt") public void testInlineFunInMultiFilePackage() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunInMultiFilePackage.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.kt"); } @TestMetadata("inlineFunction.kt") public void testInlineFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.kt"); } @TestMetadata("inlineFunctionBreakpointAnotherFile.kt") public void testInlineFunctionBreakpointAnotherFile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt"); } @TestMetadata("inlineFunctionBreakpointVariants.kt") public void testInlineFunctionBreakpointVariants() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineFunctionBreakpointVariants.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointVariants.kt"); } @TestMetadata("inlineMethodsInSignature.kt") public void testInlineMethodsInSignature() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/inlineMethodsInSignature.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineMethodsInSignature.kt"); } @TestMetadata("innerClass.kt") public void testInnerClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/innerClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/innerClass.kt"); } @TestMetadata("insertInBlock.kt") public void testInsertInBlock() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/insertInBlock.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/insertInBlock.kt"); } @TestMetadata("internalFunctionEvaluate.kt") public void testInternalFunctionEvaluate() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/internalFunctionEvaluate.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/internalFunctionEvaluate.kt"); } @TestMetadata("internalProperty.kt") public void testInternalProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/internalProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/internalProperty.kt"); } @TestMetadata("javaStaticMethods.kt") public void testJavaStaticMethods() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaStaticMethods.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.kt"); } @TestMetadata("kt12206BasePropertyWithoutBackingField.kt") public void testKt12206BasePropertyWithoutBackingField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt12206BasePropertyWithoutBackingField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt12206BasePropertyWithoutBackingField.kt"); } @TestMetadata("kt15259.kt") public void testKt15259() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt15259.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt15259.kt"); } @TestMetadata("kt17514.kt") public void testKt17514() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt17514.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt17514.kt"); } @TestMetadata("kt22366.kt") public void testKt22366() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt22366.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt22366.kt"); } @TestMetadata("kt25220.kt") public void testKt25220() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt25220.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt25220.kt"); } @TestMetadata("kt25222.kt") public void testKt25222() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt25222.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt25222.kt"); } @TestMetadata("kt28087.kt") public void testKt28087() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt28087.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt28087.kt"); } @TestMetadata("kt29179.kt") public void testKt29179() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt29179.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt29179.kt"); } @TestMetadata("kt31709.kt") public void testKt31709() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt31709.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt31709.kt"); } @TestMetadata("kt5554OnlyIntsShouldBeCoerced.kt") public void testKt5554OnlyIntsShouldBeCoerced() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt5554OnlyIntsShouldBeCoerced.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt5554OnlyIntsShouldBeCoerced.kt"); } @TestMetadata("kt7046localVarInInline.kt") public void testKt7046localVarInInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/kt7046localVarInInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/kt7046localVarInInline.kt"); } @TestMetadata("localClass.kt") public void testLocalClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/localClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/localClass.kt"); } @TestMetadata("localFunctionsWithReceivers.kt") public void testLocalFunctionsWithReceivers() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/localFunctionsWithReceivers.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/localFunctionsWithReceivers.kt"); } @TestMetadata("localVariables.kt") public void testLocalVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/localVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/localVariables.kt"); } @TestMetadata("methodWithBreakpoint.kt") public void testMethodWithBreakpoint() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/methodWithBreakpoint.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/methodWithBreakpoint.kt"); } @TestMetadata("multilineExpressionAtBreakpoint.kt") public void testMultilineExpressionAtBreakpoint() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/multilineExpressionAtBreakpoint.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/multilineExpressionAtBreakpoint.kt"); } @TestMetadata("nestedInlineArguments.kt") public void testNestedInlineArguments() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/nestedInlineArguments.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/nestedInlineArguments.kt"); } @TestMetadata("onClassHeader.kt") public void testOnClassHeader() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/onClassHeader.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/onClassHeader.kt"); } @TestMetadata("onGetter.kt") public void testOnGetter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/onGetter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/onGetter.kt"); } @TestMetadata("onObjectHeader.kt") public void testOnObjectHeader() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/onObjectHeader.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/onObjectHeader.kt"); } @TestMetadata("package.kt") public void testPackage() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/package.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/package.kt"); } @TestMetadata("parametersOfInlineFun.kt") public void testParametersOfInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/parametersOfInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/parametersOfInlineFun.kt"); } @TestMetadata("parametersOfInlineFunSeveralOnLine.kt") public void testParametersOfInlineFunSeveralOnLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/parametersOfInlineFunSeveralOnLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/parametersOfInlineFunSeveralOnLine.kt"); } @TestMetadata("privateClass.kt") public void testPrivateClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/privateClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.kt"); } @TestMetadata("privateFieldInCompanion.kt") public void testPrivateFieldInCompanion() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/privateFieldInCompanion.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateFieldInCompanion.kt"); } @TestMetadata("privateMember.kt") public void testPrivateMember() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/privateMember.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateMember.kt"); } @TestMetadata("privatePropertyWithExplicitDefaultGetter.kt") public void testPrivatePropertyWithExplicitDefaultGetter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/privatePropertyWithExplicitDefaultGetter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privatePropertyWithExplicitDefaultGetter.kt"); } @TestMetadata("protectedMember.kt") public void testProtectedMember() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/protectedMember.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/protectedMember.kt"); } @TestMetadata("rawTypeskt11831.kt") public void testRawTypeskt11831() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/rawTypeskt11831.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/simple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/simple.kt"); } @TestMetadata("staticField.kt") public void testStaticField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/staticField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/staticField.kt"); } @TestMetadata("stdlib.kt") public void testStdlib() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/stdlib.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/stdlib.kt"); } @TestMetadata("superCallsCaptured.kt") public void testSuperCallsCaptured() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/superCallsCaptured.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/superCallsCaptured.kt"); } @TestMetadata("superCallsSimple.kt") public void testSuperCallsSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/superCallsSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/superCallsSimple.kt"); } @TestMetadata("suspendCalls.kt") public void testSuspendCalls() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/suspendCalls.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/suspendCalls.kt"); } @TestMetadata("synchronizedBlock.kt") public void testSynchronizedBlock() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/synchronizedBlock.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/synchronizedBlock.kt"); } @TestMetadata("typeParameterRef.kt") public void testTypeParameterRef() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typeParameterRef.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/typeParameterRef.kt"); } @TestMetadata("typedArray.kt") public void testTypedArray() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/typedArray.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/typedArray.kt"); } @TestMetadata("unboxParam.kt") public void testUnboxParam() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/unboxParam.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/unboxParam.kt"); } @TestMetadata("unsafeCall.kt") public void testUnsafeCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/unsafeCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/unsafeCall.kt"); } @TestMetadata("valueParameterName.kt") public void testValueParameterName() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/valueParameterName.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/valueParameterName.kt"); } @TestMetadata("variableAsFunction.kt") public void testVariableAsFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/variableAsFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/variableAsFunction.kt"); } @TestMetadata("vars.kt") public void testVars() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/vars.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/vars.kt"); } @TestMetadata("whenEvaluation.kt") public void testWhenEvaluation() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/whenEvaluation.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/whenEvaluation.kt"); } @TestMetadata(".kt.kt") public void test_kt() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/.kt.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/.kt.kt"); } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class CompilingEvaluator extends AbstractKotlinEvaluateExpressionTest { @@ -485,66 +485,66 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInCompilingEvaluator() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("ceAnonymousObject.kt") public void testCeAnonymousObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceAnonymousObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceAnonymousObject.kt"); } @TestMetadata("ceAnonymousObjectCapturedInClosure.kt") public void testCeAnonymousObjectCapturedInClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceAnonymousObjectCapturedInClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceAnonymousObjectCapturedInClosure.kt"); } @TestMetadata("ceAnonymousObjectThisAsReceiver.kt") public void testCeAnonymousObjectThisAsReceiver() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceAnonymousObjectThisAsReceiver.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceAnonymousObjectThisAsReceiver.kt"); } @TestMetadata("ceLambda.kt") public void testCeLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceLambda.kt"); } @TestMetadata("ceLocalClass.kt") public void testCeLocalClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceLocalClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceLocalClass.kt"); } @TestMetadata("ceLocalClassMembers.kt") public void testCeLocalClassMembers() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceLocalClassMembers.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceLocalClassMembers.kt"); } @TestMetadata("ceLocalClassWithSuperClass.kt") public void testCeLocalClassWithSuperClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceLocalClassWithSuperClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceLocalClassWithSuperClass.kt"); } @TestMetadata("ceMembers.kt") public void testCeMembers() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceMembers.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceMembers.kt"); } @TestMetadata("ceObject.kt") public void testCeObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceObject.kt"); } @TestMetadata("ceSeveralLambdas.kt") public void testCeSeveralLambdas() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceSeveralLambdas.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceSeveralLambdas.kt"); } @TestMetadata("ceSuperAccess.kt") public void testCeSuperAccess() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/compilingEvaluator/ceSuperAccess.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/compilingEvaluator/ceSuperAccess.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Coroutines extends AbstractKotlinEvaluateExpressionTest { @@ -553,46 +553,46 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInCoroutines() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("anyUpdateInvokeStatic.kt") public void testAnyUpdateInvokeStatic() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/anyUpdateInvokeStatic.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/anyUpdateInvokeStatic.kt"); } @TestMetadata("anyUpdateVariable.kt") public void testAnyUpdateVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/anyUpdateVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/anyUpdateVariable.kt"); } @TestMetadata("primitivesCoertion.kt") public void testPrimitivesCoertion() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/primitivesCoertion.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/primitivesCoertion.kt"); } @TestMetadata("stringUpdateInvokeStatic.kt") public void testStringUpdateInvokeStatic() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdateInvokeStatic.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/stringUpdateInvokeStatic.kt"); } @TestMetadata("stringUpdateInvokeVirtual.kt") public void testStringUpdateInvokeVirtual() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdateInvokeVirtual.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/stringUpdateInvokeVirtual.kt"); } @TestMetadata("stringUpdatePutField.kt") public void testStringUpdatePutField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdatePutField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/stringUpdatePutField.kt"); } @TestMetadata("stringUpdateVariable.kt") public void testStringUpdateVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/coroutines/stringUpdateVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/coroutines/stringUpdateVariable.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/createExpression") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class CreateExpression extends AbstractKotlinEvaluateExpressionTest { @@ -601,26 +601,26 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInCreateExpression() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/createExpression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("createExpressionCastToBuiltIn.kt") public void testCreateExpressionCastToBuiltIn() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/createExpression/createExpressionCastToBuiltIn.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionCastToBuiltIn.kt"); } @TestMetadata("createExpressionSimple.kt") public void testCreateExpressionSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/createExpression/createExpressionSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionSimple.kt"); } @TestMetadata("createExpressionWithArray.kt") public void testCreateExpressionWithArray() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/createExpression/createExpressionWithArray.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class ExtraVariables extends AbstractKotlinEvaluateExpressionTest { @@ -629,66 +629,66 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInExtraVariables() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("evBreakpointOnPropertyDeclaration.kt") public void testEvBreakpointOnPropertyDeclaration() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evBreakpointOnPropertyDeclaration.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evBreakpointOnPropertyDeclaration.kt"); } @TestMetadata("evDelegatedProperty.kt") public void testEvDelegatedProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evDelegatedProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDelegatedProperty.kt"); } @TestMetadata("evDuplicateItems.kt") public void testEvDuplicateItems() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evDuplicateItems.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDuplicateItems.kt"); } @TestMetadata("evFinalProperty.kt") public void testEvFinalProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evFinalProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evFinalProperty.kt"); } @TestMetadata("evFunctionDeclaration.kt") public void testEvFunctionDeclaration() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evFunctionDeclaration.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evFunctionDeclaration.kt"); } @TestMetadata("evLineRange.kt") public void testEvLineRange() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evLineRange.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evLineRange.kt"); } @TestMetadata("evProperty.kt") public void testEvProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evProperty.kt"); } @TestMetadata("evPropertyRefExpr.kt") public void testEvPropertyRefExpr() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evPropertyRefExpr.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evPropertyRefExpr.kt"); } @TestMetadata("evSkipAnonymousObject.kt") public void testEvSkipAnonymousObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evSkipAnonymousObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evSkipAnonymousObject.kt"); } @TestMetadata("evSkipLambda.kt") public void testEvSkipLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evSkipLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evSkipLambda.kt"); } @TestMetadata("evSkipLocalClass.kt") public void testEvSkipLocalClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/extraVariables/evSkipLocalClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evSkipLocalClass.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Frame extends AbstractKotlinEvaluateExpressionTest { @@ -697,246 +697,246 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInFrame() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("capturedValues1.kt") public void testCapturedValues1() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/capturedValues1.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/capturedValues1.kt"); } @TestMetadata("capturedValues2.kt") public void testCapturedValues2() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/capturedValues2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/capturedValues2.kt"); } @TestMetadata("catchVariable.kt") public void testCatchVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/catchVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/catchVariable.kt"); } @TestMetadata("coroutineContextFun.kt") public void testCoroutineContextFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/coroutineContextFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/coroutineContextFun.kt"); } @TestMetadata("coroutineContextLambda.kt") public void testCoroutineContextLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/coroutineContextLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/coroutineContextLambda.kt"); } @TestMetadata("coroutineContextWithoutSuspend.kt") public void testCoroutineContextWithoutSuspend() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/coroutineContextWithoutSuspend.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/coroutineContextWithoutSuspend.kt"); } @TestMetadata("defaultImplsMangling.kt") public void testDefaultImplsMangling() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/defaultImplsMangling.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/defaultImplsMangling.kt"); } @TestMetadata("delegatedPropertyInClass.kt") public void testDelegatedPropertyInClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/delegatedPropertyInClass.kt"); } @TestMetadata("delegatedPropertyInClassKotlinVariables.kt") public void testDelegatedPropertyInClassKotlinVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassKotlinVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/delegatedPropertyInClassKotlinVariables.kt"); } @TestMetadata("delegatedPropertyInClassWithToString.kt") public void testDelegatedPropertyInClassWithToString() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWithToString.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/delegatedPropertyInClassWithToString.kt"); } @TestMetadata("delegatedPropertyInClassWoRenderer.kt") public void testDelegatedPropertyInClassWoRenderer() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt"); } @TestMetadata("frameAnonymousObject.kt") public void testFrameAnonymousObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameAnonymousObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameAnonymousObject.kt"); } @TestMetadata("frameClassObject.kt") public void testFrameClassObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameClassObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameClassObject.kt"); } @TestMetadata("frameClosingBracket.kt") public void testFrameClosingBracket() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameClosingBracket.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameClosingBracket.kt"); } @TestMetadata("frameExtFunExtFun.kt") public void testFrameExtFunExtFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameExtFunExtFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameExtFunExtFun.kt"); } @TestMetadata("frameExtensionFun.kt") public void testFrameExtensionFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameExtensionFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameExtensionFun.kt"); } @TestMetadata("frameInlineArgument.kt") public void testFrameInlineArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInlineArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInlineArgument.kt"); } @TestMetadata("frameInlineArgumentInsideInlineFun.kt") public void testFrameInlineArgumentInsideInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInlineArgumentInsideInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInlineArgumentInsideInlineFun.kt"); } @TestMetadata("frameInlineFun.kt") public void testFrameInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInlineFun.kt"); } @TestMetadata("frameInlineFunCallInsideInlineFun.kt") public void testFrameInlineFunCallInsideInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInlineFunCallInsideInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInlineFunCallInsideInlineFun.kt"); } @TestMetadata("frameInlineFunCallInsideInlineFunKotlinVariables.kt") public void testFrameInlineFunCallInsideInlineFunKotlinVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInlineFunCallInsideInlineFunKotlinVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInlineFunCallInsideInlineFunKotlinVariables.kt"); } @TestMetadata("frameInnerClass.kt") public void testFrameInnerClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInnerClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInnerClass.kt"); } @TestMetadata("frameInnerLambda.kt") public void testFrameInnerLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameInnerLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameInnerLambda.kt"); } @TestMetadata("frameLambda.kt") public void testFrameLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambda.kt"); } @TestMetadata("frameLambdaNotUsed.kt") public void testFrameLambdaNotUsed() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameLambdaNotUsed.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLambdaNotUsed.kt"); } @TestMetadata("frameLocalVariable.kt") public void testFrameLocalVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameLocalVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameLocalVariable.kt"); } @TestMetadata("frameObject.kt") public void testFrameObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameObject.kt"); } @TestMetadata("frameSharedVar.kt") public void testFrameSharedVar() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameSharedVar.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameSharedVar.kt"); } @TestMetadata("frameSharedVarLocalVar.kt") public void testFrameSharedVarLocalVar() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameSharedVarLocalVar.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameSharedVarLocalVar.kt"); } @TestMetadata("frameSimple.kt") public void testFrameSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameSimple.kt"); } @TestMetadata("frameThis0.kt") public void testFrameThis0() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameThis0.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameThis0.kt"); } @TestMetadata("frameThis0Ext.kt") public void testFrameThis0Ext() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameThis0Ext.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameThis0Ext.kt"); } @TestMetadata("frameThis0This0.kt") public void testFrameThis0This0() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/frameThis0This0.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/frameThis0This0.kt"); } @TestMetadata("hideContinuationThis.kt") public void testHideContinuationThis() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/hideContinuationThis.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/hideContinuationThis.kt"); } @TestMetadata("hideSyntheticThis.kt") public void testHideSyntheticThis() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/hideSyntheticThis.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/hideSyntheticThis.kt"); } @TestMetadata("inlineFunThisKotlinVariables.kt") public void testInlineFunThisKotlinVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/inlineFunThisKotlinVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/inlineFunThisKotlinVariables.kt"); } @TestMetadata("lambdaFun1.kt") public void testLambdaFun1() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaFun1.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaFun1.kt"); } @TestMetadata("lambdaFun2.kt") public void testLambdaFun2() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaFun2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaFun2.kt"); } @TestMetadata("lambdaFun3.kt") public void testLambdaFun3() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaFun3.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaFun3.kt"); } @TestMetadata("lambdaFun4.kt") public void testLambdaFun4() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaFun4.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaFun4.kt"); } @TestMetadata("lambdaParameterMangling.kt") public void testLambdaParameterMangling() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaParameterMangling.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaParameterMangling.kt"); } @TestMetadata("lambdaThisMangling.kt") public void testLambdaThisMangling() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/lambdaThisMangling.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/lambdaThisMangling.kt"); } @TestMetadata("localFunctionMangling.kt") public void testLocalFunctionMangling() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/localFunctionMangling.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/localFunctionMangling.kt"); } @TestMetadata("nestedInlineFun.kt") public void testNestedInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/nestedInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nestedInlineFun.kt"); } @TestMetadata("nestedInlineFun2.kt") public void testNestedInlineFun2() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/nestedInlineFun2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/nestedInlineFun2.kt"); } @TestMetadata("remapThis.kt") public void testRemapThis() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/remapThis.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/remapThis.kt"); } @TestMetadata("suspendContinuation.kt") public void testSuspendContinuation() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/suspendContinuation.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/frame/suspendContinuation.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class JavaContext extends AbstractKotlinEvaluateExpressionTest { @@ -945,41 +945,41 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInJavaContext() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("jcBlock.kt") public void testJcBlock() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcBlock.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.kt"); } @TestMetadata("jcImports.kt") public void testJcImports() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcImports.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.kt"); } @TestMetadata("jcLocalVariable.kt") public void testJcLocalVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcLocalVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.kt"); } @TestMetadata("jcMarkedObject.kt") public void testJcMarkedObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcMarkedObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.kt"); } @TestMetadata("jcProperty.kt") public void testJcProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.kt"); } @TestMetadata("jcSimple.kt") public void testJcSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/javaContext/jcSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Labels extends AbstractKotlinEvaluateExpressionTest { @@ -988,36 +988,36 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInLabels() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("lCallOnLabeledObj.kt") public void testLCallOnLabeledObj() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels/lCallOnLabeledObj.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels/lCallOnLabeledObj.kt"); } @TestMetadata("lIdentifier.kt") public void testLIdentifier() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels/lIdentifier.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels/lIdentifier.kt"); } @TestMetadata("lSeveralLabels.kt") public void testLSeveralLabels() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels/lSeveralLabels.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels/lSeveralLabels.kt"); } @TestMetadata("lSimple.kt") public void testLSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels/lSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels/lSimple.kt"); } @TestMetadata("ldifferentTypes.kt") public void testLdifferentTypes() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/labels/ldifferentTypes.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/labels/ldifferentTypes.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Lambdas extends AbstractKotlinEvaluateExpressionTest { @@ -1026,61 +1026,61 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInLambdas() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("destructuringParam.kt") public void testDestructuringParam() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/destructuringParam.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/destructuringParam.kt"); } @TestMetadata("inlineFunctionalExpression.kt") public void testInlineFunctionalExpression() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/inlineFunctionalExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/inlineFunctionalExpression.kt"); } @TestMetadata("inlineLambda.kt") public void testInlineLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/inlineLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/inlineLambda.kt"); } @TestMetadata("lambdaOnReturn.kt") public void testLambdaOnReturn() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/lambdaOnReturn.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/lambdaOnReturn.kt"); } @TestMetadata("lambdaOnSecondLine.kt") public void testLambdaOnSecondLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/lambdaOnSecondLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/lambdaOnSecondLine.kt"); } @TestMetadata("oneLineFunctionalExpression.kt") public void testOneLineFunctionalExpression() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/oneLineFunctionalExpression.kt"); } @TestMetadata("oneLineLambda.kt") public void testOneLineLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/oneLineLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/oneLineLambda.kt"); } @TestMetadata("twoLambdasOnOneLineFirst.kt") public void testTwoLambdasOnOneLineFirst() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/twoLambdasOnOneLineFirst.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/twoLambdasOnOneLineFirst.kt"); } @TestMetadata("twoLambdasOnOneLineSecond.kt") public void testTwoLambdasOnOneLineSecond() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/twoLambdasOnOneLineSecond.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/twoLambdasOnOneLineSecond.kt"); } @TestMetadata("underscoreNames.kt") public void testUnderscoreNames() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/lambdas/underscoreNames.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/lambdas/underscoreNames.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/renderer") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/renderer") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Renderer extends AbstractKotlinEvaluateExpressionTest { @@ -1089,17 +1089,17 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInRenderer() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/renderer"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/renderer"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("toStringRenderer.kt") public void testToStringRenderer() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/renderer/toStringRenderer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/renderer/toStringRenderer.kt"); } } } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class MultipleBreakpoints extends AbstractKotlinEvaluateExpressionTest { @@ -1108,135 +1108,135 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInMultipleBreakpoints() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("clearCache.kt") public void testClearCache() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/clearCache.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/clearCache.kt"); } @TestMetadata("constructors.kt") public void testConstructors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/constructors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/constructors.kt"); } @TestMetadata("exceptions.kt") public void testExceptions() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/exceptions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/exceptions.kt"); } @TestMetadata("extensionMemberFunction.kt") public void testExtensionMemberFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/extensionMemberFunction.kt"); } @TestMetadata("extensionMemberFunctionInObject.kt") public void testExtensionMemberFunctionInObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunctionInObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/extensionMemberFunctionInObject.kt"); } @TestMetadata("extensionMemberProperty.kt") public void testExtensionMemberProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/extensionMemberProperty.kt"); } @TestMetadata("fieldVariable.kt") public void testFieldVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/fieldVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/fieldVariable.kt"); } @TestMetadata("funFromOuterClassInLamdba.kt") public void testFunFromOuterClassInLamdba() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/funFromOuterClassInLamdba.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/funFromOuterClassInLamdba.kt"); } @TestMetadata("initializer.kt") public void testInitializer() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/initializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/initializer.kt"); } @TestMetadata("invisibleDeclarations.kt") public void testInvisibleDeclarations() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/invisibleDeclarations.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/invisibleDeclarations.kt"); } @TestMetadata("isInsideInlineLambda.kt") public void testIsInsideInlineLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/isInsideInlineLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.kt"); } @TestMetadata("lambdaParameters.kt") public void testLambdaParameters() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/lambdaParameters.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/lambdaParameters.kt"); } @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/localFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/localFun.kt"); } @TestMetadata("multipleBreakpointsAtLine.kt") public void testMultipleBreakpointsAtLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/multipleBreakpointsAtLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/multipleBreakpointsAtLine.kt"); } @TestMetadata("mutations.kt") public void testMutations() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/mutations.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/mutations.kt"); } @TestMetadata("nonCapturedVariables.kt") public void testNonCapturedVariables() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/nonCapturedVariables.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/nonCapturedVariables.kt"); } @TestMetadata("privateMembersPriority.kt") public void testPrivateMembersPriority() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/privateMembersPriority.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/privateMembersPriority.kt"); } @TestMetadata("remappedParameterInInline.kt") public void testRemappedParameterInInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/remappedParameterInInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/remappedParameterInInline.kt"); } @TestMetadata("smartcasts.kt") public void testSmartcasts() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/smartcasts.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/smartcasts.kt"); } @TestMetadata("thisLabels.kt") public void testThisLabels() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/thisLabels.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/thisLabels.kt"); } @TestMetadata("whenEntry.kt") public void testWhenEntry() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/whenEntry.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/whenEntry.kt"); } @TestMetadata("withoutBodyFunctions.kt") public void testWithoutBodyFunctions() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyFunctions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/withoutBodyFunctions.kt"); } @TestMetadata("withoutBodyProperties.kt") public void testWithoutBodyProperties() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/withoutBodyProperties.kt"); } @TestMetadata("withoutBodyProperties2.kt") public void testWithoutBodyProperties2() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyProperties2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/withoutBodyProperties2.kt"); } @TestMetadata("withoutBodyTypeParameters.kt") public void testWithoutBodyTypeParameters() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/withoutBodyTypeParameters.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/withoutBodyTypeParameters.kt"); } - @TestMetadata("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Library extends AbstractKotlinEvaluateExpressionTest { @@ -1245,17 +1245,17 @@ public class KotlinEvaluateExpressionTestGenerated extends AbstractKotlinEvaluat } public void testAllFilesPresentInLibrary() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("customLibClassName.kt") public void testCustomLibClassName() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library/customLibClassName.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.kt"); } @TestMetadata("localFunInLibrary.kt") public void testLocalFunInLibrary() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/library/localFunInLibrary.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.kt"); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java similarity index 55% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java index 9396d3c1544..9a1771defd5 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinSteppingTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @RunWith(JUnit3RunnerWithInners.class) public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class StepInto extends AbstractKotlinSteppingTest { @@ -28,91 +28,91 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInStepInto() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("classObjectFunFromClass.kt") public void testClassObjectFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/classObjectFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/classObjectFunFromClass.kt"); } @TestMetadata("classObjectFunFromTopLevel.kt") public void testClassObjectFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/classObjectFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/classObjectFunFromTopLevel.kt"); } @TestMetadata("extFun.kt") public void testExtFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/extFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/extFun.kt"); } @TestMetadata("javaFun.kt") public void testJavaFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt"); } @TestMetadata("javaSamConstructor.kt") public void testJavaSamConstructor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt"); } @TestMetadata("javaSamFunction.kt") public void testJavaSamFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt"); } @TestMetadata("kotlinSamFunction.kt") public void testKotlinSamFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt"); } @TestMetadata("memberFunFromClass.kt") public void testMemberFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberFunFromClass.kt"); } @TestMetadata("memberFunFromTopLevel.kt") public void testMemberFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberFunFromTopLevel.kt"); } @TestMetadata("memberGetterFromClass.kt") public void testMemberGetterFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberGetterFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberGetterFromClass.kt"); } @TestMetadata("memberGetterFromTopLevel.kt") public void testMemberGetterFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberGetterFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberGetterFromTopLevel.kt"); } @TestMetadata("objectFun.kt") public void testObjectFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/objectFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/objectFun.kt"); } @TestMetadata("topLevelFunFromClass.kt") public void testTopLevelFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelFunFromClass.kt"); } @TestMetadata("topLevelFunFromTopLevel.kt") public void testTopLevelFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelFunFromTopLevel.kt"); } @TestMetadata("topLevelGetterFromClass.kt") public void testTopLevelGetterFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelGetterFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelGetterFromClass.kt"); } @TestMetadata("topLevelGetterFromTopLevel.kt") public void testTopLevelGetterFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelGetterFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelGetterFromTopLevel.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SmartStepInto extends AbstractKotlinSteppingTest { @@ -121,91 +121,91 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInSmartStepInto() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("classObjectFunFromClass.kt") public void testClassObjectFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/classObjectFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/classObjectFunFromClass.kt"); } @TestMetadata("classObjectFunFromTopLevel.kt") public void testClassObjectFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/classObjectFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/classObjectFunFromTopLevel.kt"); } @TestMetadata("extFun.kt") public void testExtFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/extFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/extFun.kt"); } @TestMetadata("javaFun.kt") public void testJavaFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt"); } @TestMetadata("javaSamConstructor.kt") public void testJavaSamConstructor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt"); } @TestMetadata("javaSamFunction.kt") public void testJavaSamFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt"); } @TestMetadata("kotlinSamFunction.kt") public void testKotlinSamFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt"); } @TestMetadata("memberFunFromClass.kt") public void testMemberFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberFunFromClass.kt"); } @TestMetadata("memberFunFromTopLevel.kt") public void testMemberFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberFunFromTopLevel.kt"); } @TestMetadata("memberGetterFromClass.kt") public void testMemberGetterFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberGetterFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberGetterFromClass.kt"); } @TestMetadata("memberGetterFromTopLevel.kt") public void testMemberGetterFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/memberGetterFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/memberGetterFromTopLevel.kt"); } @TestMetadata("objectFun.kt") public void testObjectFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/objectFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/objectFun.kt"); } @TestMetadata("topLevelFunFromClass.kt") public void testTopLevelFunFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelFunFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelFunFromClass.kt"); } @TestMetadata("topLevelFunFromTopLevel.kt") public void testTopLevelFunFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelFunFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelFunFromTopLevel.kt"); } @TestMetadata("topLevelGetterFromClass.kt") public void testTopLevelGetterFromClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelGetterFromClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelGetterFromClass.kt"); } @TestMetadata("topLevelGetterFromTopLevel.kt") public void testTopLevelGetterFromTopLevel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto/topLevelGetterFromTopLevel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/topLevelGetterFromTopLevel.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepInto") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class StepIntoOnly extends AbstractKotlinSteppingTest { @@ -215,130 +215,130 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { @TestMetadata("accessors.kt") public void testAccessors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/accessors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/accessors.kt"); } public void testAllFilesPresentInStepIntoOnly() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("continueLabel.kt") public void testContinueLabel() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/continueLabel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/continueLabel.kt"); } @TestMetadata("defaultAccessors.kt") public void testDefaultAccessors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/defaultAccessors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.kt"); } @TestMetadata("forLoop.kt") public void testForLoop() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/forLoop.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/forLoop.kt"); } @TestMetadata("functionReference.kt") public void testFunctionReference() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/functionReference.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/functionReference.kt"); } @TestMetadata("inlineClass.kt") public void testInlineClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/inlineClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineClass.kt"); } @TestMetadata("inlineDex.kt") public void testInlineDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/inlineDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.kt"); } @TestMetadata("inlineOnly.kt") public void testInlineOnly() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/inlineOnly.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.kt"); } @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/propertyReference.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/propertyReference.kt"); } @TestMetadata("returnVoid.kt") public void testReturnVoid() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/returnVoid.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/returnVoid.kt"); } @TestMetadata("samAdapter.kt") public void testSamAdapter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/samAdapter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.kt"); } @TestMetadata("sameFileNames.kt") public void testSameFileNames() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/sameFileNames.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.kt"); } @TestMetadata("siSuspendFun.kt") public void testSiSuspendFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/siSuspendFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.kt"); } @TestMetadata("skipSimpleGetter.kt") public void testSkipSimpleGetter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/skipSimpleGetter.kt"); } @TestMetadata("skipSimpleGetterLocalVal.kt") public void testSkipSimpleGetterLocalVal() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterLocalVal.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/skipSimpleGetterLocalVal.kt"); } @TestMetadata("skipSimpleGetterMethodWithProperty.kt") public void testSkipSimpleGetterMethodWithProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/skipSimpleGetterMethodWithProperty.kt"); } @TestMetadata("stepIntoFromInlineFun.kt") public void testStepIntoFromInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/stepIntoFromInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoFromInlineFun.kt"); } @TestMetadata("stepIntoInlineFun.kt") public void testStepIntoInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/stepIntoInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoInlineFun.kt"); } @TestMetadata("stepIntoStdLibInlineFun.kt") public void testStepIntoStdLibInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/stepIntoStdLibInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoStdLibInlineFun.kt"); } @TestMetadata("stepIntoSuspendFunctionSimple.kt") public void testStepIntoSuspendFunctionSimple() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/stepIntoSuspendFunctionSimple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.kt"); } @TestMetadata("syntheticMethods.kt") public void testSyntheticMethods() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethods.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/syntheticMethods.kt"); } @TestMetadata("syntheticMethodsSkip.kt") public void testSyntheticMethodsSkip() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/syntheticMethodsSkip.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/syntheticMethodsSkip.kt"); } @TestMetadata("traits.kt") public void testTraits() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/traits.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/traits.kt"); } @TestMetadata("whenExpr.kt") public void testWhenExpr() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepInto/whenExpr.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/whenExpr.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOut") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class StepOut extends AbstractKotlinSteppingTest { @@ -347,56 +347,56 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInStepOut() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepOut"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("fwBackingField.kt") public void testFwBackingField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/fwBackingField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/fwBackingField.kt"); } @TestMetadata("inapplicableFieldWatchpoints.kt") public void testInapplicableFieldWatchpoints() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/inapplicableFieldWatchpoints.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/inapplicableFieldWatchpoints.kt"); } @TestMetadata("souSuspendFun.kt") public void testSouSuspendFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/souSuspendFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.kt"); } @TestMetadata("stepOutInlineFunction.kt") public void testStepOutInlineFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutInlineFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutInlineFunction.kt"); } @TestMetadata("stepOutInlinedLambdaArgument.kt") public void testStepOutInlinedLambdaArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutInlinedLambdaArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutInlinedLambdaArgument.kt"); } @TestMetadata("stepOutInlinedLambdaArgumentOneLine.kt") public void testStepOutInlinedLambdaArgumentOneLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutInlinedLambdaArgumentOneLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutInlinedLambdaArgumentOneLine.kt"); } @TestMetadata("stepOutSeveralInlineArgumentDeepest.kt") public void testStepOutSeveralInlineArgumentDeepest() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutSeveralInlineArgumentDeepest.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutSeveralInlineArgumentDeepest.kt"); } @TestMetadata("stepOutSeveralInlineFunctions.kt") public void testStepOutSeveralInlineFunctions() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutSeveralInlineFunctions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutSeveralInlineFunctions.kt"); } @TestMetadata("stepOutSeveralInlineFunctionsDeepest.kt") public void testStepOutSeveralInlineFunctionsDeepest() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOut/stepOutSeveralInlineFunctionsDeepest.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/stepOutSeveralInlineFunctionsDeepest.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOver") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class StepOver extends AbstractKotlinSteppingTest { @@ -405,536 +405,536 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInStepOver() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepOver"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("asIterableInFor.kt") public void testAsIterableInFor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/asIterableInFor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/asIterableInFor.kt"); } @TestMetadata("ifCapturedVariableKt9118.kt") public void testIfCapturedVariableKt9118() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/ifCapturedVariableKt9118.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/ifCapturedVariableKt9118.kt"); } @TestMetadata("inlineCallInForRangeExpression.kt") public void testInlineCallInForRangeExpression() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineCallInForRangeExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineCallInForRangeExpression.kt"); } @TestMetadata("inlineFunctionSameLines.kt") public void testInlineFunctionSameLines() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineFunctionSameLines.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.kt"); } @TestMetadata("inlineInClassDex.kt") public void testInlineInClassDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInClassDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.kt"); } @TestMetadata("inlineInIfFalse.kt") public void testInlineInIfFalse() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInIfFalse.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalse.kt"); } @TestMetadata("inlineInIfFalseDex.kt") public void testInlineInIfFalseDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInIfFalseDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.kt"); } @TestMetadata("inlineInIfTrue.kt") public void testInlineInIfTrue() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInIfTrue.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrue.kt"); } @TestMetadata("inlineInIfTrueDex.kt") public void testInlineInIfTrueDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInIfTrueDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.kt"); } @TestMetadata("inlineInObjectDex.kt") public void testInlineInObjectDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/inlineInObjectDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.kt"); } @TestMetadata("kt24343.kt") public void testKt24343() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/kt24343.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt24343.kt"); } @TestMetadata("noParameterLambdaArgumentCallInInline.kt") public void testNoParameterLambdaArgumentCallInInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/noParameterLambdaArgumentCallInInline.kt"); } @TestMetadata("noParameterLambdaArgumentCallInLambda.kt") public void testNoParameterLambdaArgumentCallInLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/noParameterLambdaArgumentCallInLambda.kt"); } @TestMetadata("soBreakpointWithInline.kt") public void testSoBreakpointWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soBreakpointWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soBreakpointWithInline.kt"); } @TestMetadata("soBreakpointWithOrdinalOnInlineCallsInOneLine.kt") public void testSoBreakpointWithOrdinalOnInlineCallsInOneLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soBreakpointWithOrdinalOnInlineCallsInOneLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soBreakpointWithOrdinalOnInlineCallsInOneLine.kt"); } @TestMetadata("soInlineAnonymousFunctionArgument.kt") public void testSoInlineAnonymousFunctionArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineAnonymousFunctionArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgument.kt"); } @TestMetadata("soInlineAnonymousFunctionArgumentDex.kt") public void testSoInlineAnonymousFunctionArgumentDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt"); } @TestMetadata("soInlineCallInLastStatementInInline.kt") public void testSoInlineCallInLastStatementInInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallInLastStatementInInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInline.kt"); } @TestMetadata("soInlineCallInLastStatementInInlineDex.kt") public void testSoInlineCallInLastStatementInInlineDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt"); } @TestMetadata("soInlineCallInLastStatementInInlineFunctionArgument.kt") public void testSoInlineCallInLastStatementInInlineFunctionArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgument.kt"); } @TestMetadata("soInlineCallInLastStatementInInlineFunctionArgumentDex.kt") public void testSoInlineCallInLastStatementInInlineFunctionArgumentDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt"); } @TestMetadata("soInlineCallInLastStatementInInlineInInline.kt") public void testSoInlineCallInLastStatementInInlineInInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallInLastStatementInInlineInInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineInInline.kt"); } @TestMetadata("soInlineCallsInOneLine.kt") public void testSoInlineCallsInOneLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineCallsInOneLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallsInOneLine.kt"); } @TestMetadata("soInlineFunCallInLastStatementOfInlineWithArgumentFromCalleeAndOwn.kt") public void testSoInlineFunCallInLastStatementOfInlineWithArgumentFromCalleeAndOwn() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunCallInLastStatementOfInlineWithArgumentFromCalleeAndOwn.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunCallInLastStatementOfInlineWithArgumentFromCalleeAndOwn.kt"); } @TestMetadata("soInlineFunDex.kt") public void testSoInlineFunDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.kt"); } @TestMetadata("soInlineFunOnOneLineFor.kt") public void testSoInlineFunOnOneLineFor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunOnOneLineFor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineFor.kt"); } @TestMetadata("soInlineFunOnOneLineForDex.kt") public void testSoInlineFunOnOneLineForDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunOnOneLineForDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.kt"); } @TestMetadata("soInlineFunWithFor.kt") public void testSoInlineFunWithFor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunWithFor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunWithFor.kt"); } @TestMetadata("soInlineFunWithLastStatementMultilineArgumentCall.kt") public void testSoInlineFunWithLastStatementMultilineArgumentCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunWithLastStatementMultilineArgumentCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunWithLastStatementMultilineArgumentCall.kt"); } @TestMetadata("soInlineFunWithLastStatementOneLineArgumentCall.kt") public void testSoInlineFunWithLastStatementOneLineArgumentCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineFunWithLastStatementOneLineArgumentCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunWithLastStatementOneLineArgumentCall.kt"); } @TestMetadata("soInlineIfConditionLambdaFalse.kt") public void testSoInlineIfConditionLambdaFalse() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineIfConditionLambdaFalse.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIfConditionLambdaFalse.kt"); } @TestMetadata("soInlineIfConditionLambdaTrue.kt") public void testSoInlineIfConditionLambdaTrue() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineIfConditionLambdaTrue.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIfConditionLambdaTrue.kt"); } @TestMetadata("soInlineIterableFunDex.kt") public void testSoInlineIterableFunDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineIterableFunDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.kt"); } @TestMetadata("soInlineLibFunDex.kt") public void testSoInlineLibFunDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineLibFunDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.kt"); } @TestMetadata("soInlineOperatorIterator.kt") public void testSoInlineOperatorIterator() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineOperatorIterator.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineOperatorIterator.kt"); } @TestMetadata("soInlineUnitFunDex.kt") public void testSoInlineUnitFunDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineUnitFunDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.kt"); } @TestMetadata("soInlineWhileCondition.kt") public void testSoInlineWhileCondition() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineWhileCondition.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileCondition.kt"); } @TestMetadata("soInlineWhileConditionDex.kt") public void testSoInlineWhileConditionDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soInlineWhileConditionDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumenBeforeOtherArgument.kt") public void testSoLastStatementInInlineFunctionArgumenBeforeOtherArgument() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumenBeforeOtherArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumenBeforeOtherArgument.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumentAsAnonymous.kt") public void testSoLastStatementInInlineFunctionArgumentAsAnonymous() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumentAsAnonymous.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumentAsAnonymous.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumentAsAnonymousParNextLine.kt") public void testSoLastStatementInInlineFunctionArgumentAsAnonymousParNextLine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumentAsAnonymousParNextLine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumentAsAnonymousParNextLine.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumentInGetOperator.kt") public void testSoLastStatementInInlineFunctionArgumentInGetOperator() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumentInGetOperator.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumentInGetOperator.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumentInNonInlineCall.kt") public void testSoLastStatementInInlineFunctionArgumentInNonInlineCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumentInNonInlineCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumentInNonInlineCall.kt"); } @TestMetadata("soLastStatementInInlineFunctionArgumentInPars.kt") public void testSoLastStatementInInlineFunctionArgumentInPars() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soLastStatementInInlineFunctionArgumentInPars.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soLastStatementInInlineFunctionArgumentInPars.kt"); } @TestMetadata("soNonSuspendableSuspendCall.kt") public void testSoNonSuspendableSuspendCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soNonSuspendableSuspendCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.kt"); } @TestMetadata("soReifiedInlineIfConditionFalse.kt") public void testSoReifiedInlineIfConditionFalse() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soReifiedInlineIfConditionFalse.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soReifiedInlineIfConditionFalse.kt"); } @TestMetadata("soSimpleInlineIfCondition.kt") public void testSoSimpleInlineIfCondition() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSimpleInlineIfCondition.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSimpleInlineIfCondition.kt"); } @TestMetadata("soSuspendableCallInEndOfFun.kt") public void testSoSuspendableCallInEndOfFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt"); } @TestMetadata("soSuspendableCallInEndOfLambda.kt") public void testSoSuspendableCallInEndOfLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInEndOfLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.kt"); } @TestMetadata("soSuspendableCallInFun.kt") public void testSoSuspendableCallInFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.kt"); } @TestMetadata("soSuspendableCallInFunFromOtherStepping.kt") public void testSoSuspendableCallInFunFromOtherStepping() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt"); } @TestMetadata("soSuspendableCallInLambda.kt") public void testSoSuspendableCallInLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/soSuspendableCallInLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.kt"); } @TestMetadata("stepOverCatchClause.kt") public void testStepOverCatchClause() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverCatchClause.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverCatchClause.kt"); } @TestMetadata("stepOverDeclarationInInlineFun.kt") public void testStepOverDeclarationInInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverDeclarationInInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverDeclarationInInlineFun.kt"); } @TestMetadata("stepOverFalseConditionInLastIfInWhile.kt") public void testStepOverFalseConditionInLastIfInWhile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverFalseConditionInLastIfInWhile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverFalseConditionInLastIfInWhile.kt"); } @TestMetadata("stepOverForWithInline.kt") public void testStepOverForWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverForWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverForWithInline.kt"); } @TestMetadata("stepOverIfWithInline.kt") public void testStepOverIfWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverIfWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverIfWithInline.kt"); } @TestMetadata("stepOverInlineFunWithRecursionCall.kt") public void testStepOverInlineFunWithRecursionCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlineFunWithRecursionCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverInlineFunWithRecursionCall.kt"); } @TestMetadata("stepOverInlineFunctionInReturn.kt") public void testStepOverInlineFunctionInReturn() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlineFunctionInReturn.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverInlineFunctionInReturn.kt"); } @TestMetadata("stepOverInlinedLambda.kt") public void testStepOverInlinedLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlinedLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverInlinedLambda.kt"); } @TestMetadata("stepOverInlinedLambdaStdlib.kt") public void testStepOverInlinedLambdaStdlib() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInlinedLambdaStdlib.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverInlinedLambdaStdlib.kt"); } @TestMetadata("stepOverInsideInlineFun.kt") public void testStepOverInsideInlineFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverInsideInlineFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverInsideInlineFun.kt"); } @TestMetadata("stepOverReifiedParam.kt") public void testStepOverReifiedParam() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverReifiedParam.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverReifiedParam.kt"); } @TestMetadata("stepOverSimpleFun.kt") public void testStepOverSimpleFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverSimpleFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverSimpleFun.kt"); } @TestMetadata("stepOverTryCatchWithInline.kt") public void testStepOverTryCatchWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverTryCatchWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverTryCatchWithInline.kt"); } @TestMetadata("stepOverWhenInReturn.kt") public void testStepOverWhenInReturn() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverWhenInReturn.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverWhenInReturn.kt"); } @TestMetadata("stepOverWhenWithInline.kt") public void testStepOverWhenWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverWhenWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverWhenWithInline.kt"); } @TestMetadata("stepOverWhileWithInline.kt") public void testStepOverWhileWithInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stepOverWhileWithInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stepOverWhileWithInline.kt"); } @TestMetadata("stopInAnonymousFunctionInInlinedCallWithCrossInline.kt") public void testStopInAnonymousFunctionInInlinedCallWithCrossInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInline.kt"); } @TestMetadata("stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt") public void testStopInAnonymousFunctionInInlinedCallWithCrossInlineDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt"); } @TestMetadata("stopInCrossinlineInSuspend.kt") public void testStopInCrossinlineInSuspend() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInCrossinlineInSuspend.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.kt"); } @TestMetadata("stopInExtensionInlineCall.kt") public void testStopInExtensionInlineCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInExtensionInlineCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInExtensionInlineCall.kt"); } @TestMetadata("stopInInlineCallInField.kt") public void testStopInInlineCallInField() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInField.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineCallInField.kt"); } @TestMetadata("stopInInlineCallInFieldInClassWithNonDefaultPrimary.kt") public void testStopInInlineCallInFieldInClassWithNonDefaultPrimary() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInFieldInClassWithNonDefaultPrimary.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineCallInFieldInClassWithNonDefaultPrimary.kt"); } @TestMetadata("stopInInlineCallInFieldInDelegate.kt") public void testStopInInlineCallInFieldInDelegate() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInFieldInDelegate.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineCallInFieldInDelegate.kt"); } @TestMetadata("stopInInlineCallInFieldInLocalClass.kt") public void testStopInInlineCallInFieldInLocalClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallInFieldInLocalClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineCallInFieldInLocalClass.kt"); } @TestMetadata("stopInInlineCallLocalFunLambda.kt") public void testStopInInlineCallLocalFunLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineCallLocalFunLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineCallLocalFunLambda.kt"); } @TestMetadata("stopInInlineFunDex.kt") public void testStopInInlineFunDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineFunDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.kt"); } @TestMetadata("stopInInlineInOtherFileDex.kt") public void testStopInInlineInOtherFileDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineInOtherFileDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.kt"); } @TestMetadata("stopInInlineInOtherFileWithLambdaArgumentDex.kt") public void testStopInInlineInOtherFileWithLambdaArgumentDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt"); } @TestMetadata("stopInInlineUnderOtherCall.kt") public void testStopInInlineUnderOtherCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineUnderOtherCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderOtherCall.kt"); } @TestMetadata("stopInInlineUnderSamConversion.kt") public void testStopInInlineUnderSamConversion() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlineUnderSamConversion.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.kt"); } @TestMetadata("stopInInlinedInSpecialNamedFun.kt") public void testStopInInlinedInSpecialNamedFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlinedInSpecialNamedFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedInSpecialNamedFun.kt"); } @TestMetadata("stopInInlinedInSpecialNamedFunWithGet.kt") public void testStopInInlinedInSpecialNamedFunWithGet() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlinedInSpecialNamedFunWithGet.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedInSpecialNamedFunWithGet.kt"); } @TestMetadata("stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt") public void testStopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt"); } @TestMetadata("stopInLabdaOfCrossinlineCalledInAnonymous.kt") public void testStopInLabdaOfCrossinlineCalledInAnonymous() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLabdaOfCrossinlineCalledInAnonymous.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLabdaOfCrossinlineCalledInAnonymous.kt"); } @TestMetadata("stopInLambdaInInlinedCallWithCrossInline.kt") public void testStopInLambdaInInlinedCallWithCrossInline() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInline.kt"); } @TestMetadata("stopInLambdaInInlinedCallWithCrossInlineDex.kt") public void testStopInLambdaInInlinedCallWithCrossInlineDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt"); } @TestMetadata("stopInLambdaInlineCallLambda.kt") public void testStopInLambdaInlineCallLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLambdaInlineCallLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInlineCallLambda.kt"); } @TestMetadata("stopInLocalFunInSecondaryConstructor.kt") public void testStopInLocalFunInSecondaryConstructor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLocalFunInSecondaryConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLocalFunInSecondaryConstructor.kt"); } @TestMetadata("stopInLocalFunInlineCallLambda.kt") public void testStopInLocalFunInlineCallLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInLocalFunInlineCallLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLocalFunInlineCallLambda.kt"); } @TestMetadata("stopInNamelessFunInInlineCall.kt") public void testStopInNamelessFunInInlineCall() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInNamelessFunInInlineCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInNamelessFunInInlineCall.kt"); } @TestMetadata("stopInNonInlinedLambdaInInlineCallWithClosure.kt") public void testStopInNonInlinedLambdaInInlineCallWithClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInNonInlinedLambdaInInlineCallWithClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInNonInlinedLambdaInInlineCallWithClosure.kt"); } @TestMetadata("stopInNonInlinedLambdaInInlineCallWithoutClosure.kt") public void testStopInNonInlinedLambdaInInlineCallWithoutClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInNonInlinedLambdaInInlineCallWithoutClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInNonInlinedLambdaInInlineCallWithoutClosure.kt"); } @TestMetadata("stopInObjectLiteralInInlineCallNoClosure.kt") public void testStopInObjectLiteralInInlineCallNoClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInObjectLiteralInInlineCallNoClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInObjectLiteralInInlineCallNoClosure.kt"); } @TestMetadata("stopInObjectLiteralInInlineCallWithClosure.kt") public void testStopInObjectLiteralInInlineCallWithClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInObjectLiteralInInlineCallWithClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInObjectLiteralInInlineCallWithClosure.kt"); } @TestMetadata("stopInObjectLiteralInInlineCallWithClosureInAnonymous.kt") public void testStopInObjectLiteralInInlineCallWithClosureInAnonymous() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInObjectLiteralInInlineCallWithClosureInAnonymous.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInObjectLiteralInInlineCallWithClosureInAnonymous.kt"); } @TestMetadata("stopInSuspendFunctionWithSuspendPoints.kt") public void testStopInSuspendFunctionWithSuspendPoints() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt"); } @TestMetadata("stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt") public void testStopInSuspendFunctionWithSuspendPointsInAnonymousObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt"); } @TestMetadata("stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt") public void testStopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt"); } @TestMetadata("stopInSuspendFunctionWithoutSuspendPoints.kt") public void testStopInSuspendFunctionWithoutSuspendPoints() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt"); } @TestMetadata("stopInWrongClass.kt") public void testStopInWrongClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInWrongClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.kt"); } @TestMetadata("stopInlineCallInLocalFunInSecondaryConstructor.kt") public void testStopInlineCallInLocalFunInSecondaryConstructor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInlineCallInLocalFunInSecondaryConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInlineCallInLocalFunInSecondaryConstructor.kt"); } @TestMetadata("suspendImpl.kt") public void testSuspendImpl() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/suspendImpl.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/suspendImpl.kt"); } @TestMetadata("whenWithoutExpression.kt") public void testWhenWithoutExpression() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/whenWithoutExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/whenWithoutExpression.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOverForce") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class StepOverForce extends AbstractKotlinSteppingTest { @@ -943,16 +943,16 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInStepOverForce() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/stepOverForce"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("sofSuspendableCallInFun.kt") public void testSofSuspendableCallInFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/stepOverForce/sofSuspendableCallInFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/filters") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Filters extends AbstractKotlinSteppingTest { @@ -961,71 +961,71 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInFilters() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/filters"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("checkNotNull.kt") public void testCheckNotNull() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/checkNotNull.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.kt"); } @TestMetadata("doNotSkipClassloader.kt") public void testDoNotSkipClassloader() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/doNotSkipClassloader.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipClassloader.kt"); } @TestMetadata("doNotSkipConstructors.kt") public void testDoNotSkipConstructors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/doNotSkipConstructors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipConstructors.kt"); } @TestMetadata("npe.kt") public void testNpe() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/npe.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/npe.kt"); } @TestMetadata("reflectKClass.kt") public void testReflectKClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/reflectKClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/reflectKClass.kt"); } @TestMetadata("skipClassloader.kt") public void testSkipClassloader() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/skipClassloader.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/skipClassloader.kt"); } @TestMetadata("skipConstructors.kt") public void testSkipConstructors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/skipConstructors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/skipConstructors.kt"); } @TestMetadata("stdlibStep.kt") public void testStdlibStep() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/stdlibStep.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stdlibStep.kt"); } @TestMetadata("stepIntoMultiFileFacade.kt") public void testStepIntoMultiFileFacade() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoMultiFileFacade.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.kt"); } @TestMetadata("stepIntoSpecificKotlinClasses.kt") public void testStepIntoSpecificKotlinClasses() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoSpecificKotlinClasses.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.kt"); } @TestMetadata("stepIntoStdlib.kt") public void testStepIntoStdlib() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoStdlib.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlib.kt"); } @TestMetadata("stepIntoStdlibFacadeClass.kt") public void testStepIntoStdlibFacadeClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/filters/stepIntoStdlibFacadeClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlibFacadeClass.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/stepping/custom") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Custom extends AbstractKotlinSteppingTest { @@ -1034,227 +1034,227 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { } public void testAllFilesPresentInCustom() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/stepping/custom"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("anonymousFunAsParamDefaultValue.kt") public void testAnonymousFunAsParamDefaultValue() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/anonymousFunAsParamDefaultValue.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/anonymousFunAsParamDefaultValue.kt"); } @TestMetadata("constantConditions.kt") public void testConstantConditions() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/constantConditions.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/constantConditions.kt"); } @TestMetadata("coroutine.kt") public void testCoroutine() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/coroutine.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.kt"); } @TestMetadata("coroutineUnitElimination.kt") public void testCoroutineUnitElimination() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/coroutineUnitElimination.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutineUnitElimination.kt"); } @TestMetadata("crossinlineLiteral.kt") public void testCrossinlineLiteral() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/crossinlineLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/crossinlineLiteral.kt"); } @TestMetadata("finallyBlock.kt") public void testFinallyBlock() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/finallyBlock.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/finallyBlock.kt"); } @TestMetadata("funLiteral.kt") public void testFunLiteral() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/funLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/funLiteral.kt"); } @TestMetadata("functionBreakpoints.kt") public void testFunctionBreakpoints() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/functionBreakpoints.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/functionBreakpoints.kt"); } @TestMetadata("functionCallStoredToVariable.kt") public void testFunctionCallStoredToVariable() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/functionCallStoredToVariable.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/functionCallStoredToVariable.kt"); } @TestMetadata("fwAbstractProperty.kt") public void testFwAbstractProperty() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/fwAbstractProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/fwAbstractProperty.kt"); } @TestMetadata("fwInitializer.kt") public void testFwInitializer() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/fwInitializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/fwInitializer.kt"); } @TestMetadata("fwPropertyInInterface.kt") public void testFwPropertyInInterface() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/fwPropertyInInterface.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/fwPropertyInInterface.kt"); } @TestMetadata("initBlocks.kt") public void testInitBlocks() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/initBlocks.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/initBlocks.kt"); } @TestMetadata("inlineInObject.kt") public void testInlineInObject() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/inlineInObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObject.kt"); } @TestMetadata("inlineInObjectSameFileDex.kt") public void testInlineInObjectSameFileDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/inlineInObjectSameFileDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.kt"); } @TestMetadata("inlineProperties.kt") public void testInlineProperties() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/inlineProperties.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineProperties.kt"); } @TestMetadata("inlinePropertyAccessors.kt") public void testInlinePropertyAccessors() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/inlinePropertyAccessors.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlinePropertyAccessors.kt"); } @TestMetadata("kt15823.kt") public void testKt15823() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/kt15823.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/kt15823.kt"); } @TestMetadata("kt17144.kt") public void testKt17144() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/kt17144.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/kt17144.kt"); } @TestMetadata("kt17295.kt") public void testKt17295() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/kt17295.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/kt17295.kt"); } @TestMetadata("manyFilesWithInlineCalls1Dex.kt") public void testManyFilesWithInlineCalls1Dex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/manyFilesWithInlineCalls1Dex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.kt"); } @TestMetadata("manyFilesWithInlineCalls2Dex.kt") public void testManyFilesWithInlineCalls2Dex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/manyFilesWithInlineCalls2Dex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.kt"); } @TestMetadata("severalFunLiterals.kt") public void testSeveralFunLiterals() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/severalFunLiterals.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalFunLiterals.kt"); } @TestMetadata("severalFunLiteralsInClass.kt") public void testSeveralFunLiteralsInClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/severalFunLiteralsInClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalFunLiteralsInClass.kt"); } @TestMetadata("severalInlineCallsFromOtherFileDex.kt") public void testSeveralInlineCallsFromOtherFileDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/severalInlineCallsFromOtherFileDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.kt"); } @TestMetadata("severalInlineFunctionsInOneFileDex.kt") public void testSeveralInlineFunctionsInOneFileDex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/severalInlineFunctionsInOneFileDex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.kt"); } @TestMetadata("simpleConditionalBreakpoint.kt") public void testSimpleConditionalBreakpoint() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/simpleConditionalBreakpoint.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/simpleConditionalBreakpoint.kt"); } @TestMetadata("smartStepIntoComponentFunction.kt") public void testSmartStepIntoComponentFunction() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoComponentFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoComponentFunction.kt"); } @TestMetadata("smartStepIntoConstructor.kt") public void testSmartStepIntoConstructor() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoConstructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoConstructor.kt"); } @TestMetadata("smartStepIntoFunWithDefaultArgs.kt") public void testSmartStepIntoFunWithDefaultArgs() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoFunWithDefaultArgs.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoFunWithDefaultArgs.kt"); } @TestMetadata("smartStepIntoInlinedFunLiteral.kt") public void testSmartStepIntoInlinedFunLiteral() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInlinedFunLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInlinedFunLiteral.kt"); } @TestMetadata("smartStepIntoInlinedFunctionalExpression.kt") public void testSmartStepIntoInlinedFunctionalExpression() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInlinedFunctionalExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInlinedFunctionalExpression.kt"); } @TestMetadata("smartStepIntoInsideLambda.kt") public void testSmartStepIntoInsideLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInsideLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInsideLambda.kt"); } @TestMetadata("smartStepIntoInterfaceFun.kt") public void testSmartStepIntoInterfaceFun() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInterfaceFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceFun.kt"); } @TestMetadata("smartStepIntoInterfaceImpl.kt") public void testSmartStepIntoInterfaceImpl() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoInterfaceImpl.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.kt"); } @TestMetadata("smartStepIntoStoredLambda.kt") public void testSmartStepIntoStoredLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoStoredLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoStoredLambda.kt"); } @TestMetadata("smartStepIntoSubClass.kt") public void testSmartStepIntoSubClass() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoSubClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoSubClass.kt"); } @TestMetadata("smartStepIntoToLambdaParameter.kt") public void testSmartStepIntoToLambdaParameter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoToLambdaParameter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoToLambdaParameter.kt"); } @TestMetadata("smartStepIntoWithDelegates.kt") public void testSmartStepIntoWithDelegates() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoWithDelegates.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoWithDelegates.kt"); } @TestMetadata("smartStepIntoWithOverrides.kt") public void testSmartStepIntoWithOverrides() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/smartStepIntoWithOverrides.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoWithOverrides.kt"); } @TestMetadata("stepIntoStdlibInlineFun2step.kt") public void testStepIntoStdlibInlineFun2step() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/stepIntoStdlibInlineFun2step.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt"); } @TestMetadata("stepOutInlineFunctionStdlib.kt") public void testStepOutInlineFunctionStdlib() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/stepOutInlineFunctionStdlib.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOutInlineFunctionStdlib.kt"); } @TestMetadata("stepOverNonLocalReturnInLambda.kt") public void testStepOverNonLocalReturnInLambda() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/stepOverNonLocalReturnInLambda.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOverNonLocalReturnInLambda.kt"); } @TestMetadata("syntheticProvider.kt") public void testSyntheticProvider() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/stepping/custom/syntheticProvider.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/syntheticProvider.kt"); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/LowLevelDebuggerTestBase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/LowLevelDebuggerTestBase.kt similarity index 96% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/LowLevelDebuggerTestBase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/LowLevelDebuggerTestBase.kt index 05f37164ba8..d9eb91e4ece 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/LowLevelDebuggerTestBase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/LowLevelDebuggerTestBase.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test import com.intellij.util.PathUtil import com.intellij.util.SystemProperties @@ -148,7 +148,10 @@ abstract class LowLevelDebuggerTestBase : CodegenTestCase() { private fun writeMainClass(classesDir: File) { val mainClassResourceName = DebuggerMain::class.java.name.replace('.', '/') + ".class" - val mainClassBytes = javaClass.classLoader.getResource(mainClassResourceName).readBytes() + val resource = javaClass.classLoader.getResource(mainClassResourceName) + ?: error("Resource not found: $mainClassResourceName") + + val mainClassBytes = resource.readBytes() File(classesDir, mainClassResourceName).mkdirAndWriteBytes(mainClassBytes) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/PositionManagerTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/PositionManagerTestGenerated.java similarity index 60% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/PositionManagerTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/PositionManagerTestGenerated.java index e512b00e7ef..0f689122d00 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/PositionManagerTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/PositionManagerTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @RunWith(JUnit3RunnerWithInners.class) public class PositionManagerTestGenerated extends AbstractPositionManagerTest { - @TestMetadata("idea/testData/debugger/positionManager") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/positionManager") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SingleFile extends AbstractPositionManagerTest { @@ -28,111 +28,111 @@ public class PositionManagerTestGenerated extends AbstractPositionManagerTest { } public void testAllFilesPresentInSingleFile() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/positionManager"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, false); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/positionManager"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, false); } @TestMetadata("anonymousFunction.kt") public void testAnonymousFunction() throws Exception { - runTest("idea/testData/debugger/positionManager/anonymousFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/anonymousFunction.kt"); } @TestMetadata("anonymousNamedFunction.kt") public void testAnonymousNamedFunction() throws Exception { - runTest("idea/testData/debugger/positionManager/anonymousNamedFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/anonymousNamedFunction.kt"); } @TestMetadata("class.kt") public void testClass() throws Exception { - runTest("idea/testData/debugger/positionManager/class.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/class.kt"); } @TestMetadata("classObject.kt") public void testClassObject() throws Exception { - runTest("idea/testData/debugger/positionManager/classObject.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/classObject.kt"); } @TestMetadata("enum.kt") public void testEnum() throws Exception { - runTest("idea/testData/debugger/positionManager/enum.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/enum.kt"); } @TestMetadata("extensionFunction.kt") public void testExtensionFunction() throws Exception { - runTest("idea/testData/debugger/positionManager/extensionFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/extensionFunction.kt"); } @TestMetadata("functionLiteral.kt") public void testFunctionLiteral() throws Exception { - runTest("idea/testData/debugger/positionManager/functionLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/functionLiteral.kt"); } @TestMetadata("functionLiteralInVal.kt") public void testFunctionLiteralInVal() throws Exception { - runTest("idea/testData/debugger/positionManager/functionLiteralInVal.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/functionLiteralInVal.kt"); } @TestMetadata("innerClass.kt") public void testInnerClass() throws Exception { - runTest("idea/testData/debugger/positionManager/innerClass.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/innerClass.kt"); } @TestMetadata("JvmNameAnnotation.kt") public void testJvmNameAnnotation() throws Exception { - runTest("idea/testData/debugger/positionManager/JvmNameAnnotation.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/JvmNameAnnotation.kt"); } @TestMetadata("localFunction.kt") public void testLocalFunction() throws Exception { - runTest("idea/testData/debugger/positionManager/localFunction.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/localFunction.kt"); } @TestMetadata("objectDeclaration.kt") public void testObjectDeclaration() throws Exception { - runTest("idea/testData/debugger/positionManager/objectDeclaration.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/objectDeclaration.kt"); } @TestMetadata("objectExpression.kt") public void testObjectExpression() throws Exception { - runTest("idea/testData/debugger/positionManager/objectExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/objectExpression.kt"); } @TestMetadata("package.kt") public void testPackage() throws Exception { - runTest("idea/testData/debugger/positionManager/package.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/package.kt"); } @TestMetadata("propertyAccessor.kt") public void testPropertyAccessor() throws Exception { - runTest("idea/testData/debugger/positionManager/propertyAccessor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/propertyAccessor.kt"); } @TestMetadata("propertyInitializer.kt") public void testPropertyInitializer() throws Exception { - runTest("idea/testData/debugger/positionManager/propertyInitializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/propertyInitializer.kt"); } @TestMetadata("topLevelPropertyInitializer.kt") public void testTopLevelPropertyInitializer() throws Exception { - runTest("idea/testData/debugger/positionManager/topLevelPropertyInitializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/topLevelPropertyInitializer.kt"); } @TestMetadata("trait.kt") public void testTrait() throws Exception { - runTest("idea/testData/debugger/positionManager/trait.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/trait.kt"); } @TestMetadata("twoClasses.kt") public void testTwoClasses() throws Exception { - runTest("idea/testData/debugger/positionManager/twoClasses.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/twoClasses.kt"); } @TestMetadata("_DefaultPackage.kt") public void test_DefaultPackage() throws Exception { - runTest("idea/testData/debugger/positionManager/_DefaultPackage.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/_DefaultPackage.kt"); } } - @TestMetadata("idea/testData/debugger/positionManager") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/positionManager") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class MultiFile extends AbstractPositionManagerTest { @@ -141,17 +141,17 @@ public class PositionManagerTestGenerated extends AbstractPositionManagerTest { } public void testAllFilesPresentInMultiFile() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/positionManager"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/positionManager"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, false); } @TestMetadata("multiFilePackage") public void testMultiFilePackage() throws Exception { - runTest("idea/testData/debugger/positionManager/multiFilePackage/"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/multiFilePackage/"); } @TestMetadata("multiFileSameName") public void testMultiFileSameName() throws Exception { - runTest("idea/testData/debugger/positionManager/multiFileSameName/"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/positionManager/multiFileSameName/"); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SelectExpressionForDebuggerTestGenerated.java similarity index 54% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SelectExpressionForDebuggerTestGenerated.java index cef85c52c7c..21c2bec615a 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/SelectExpressionForDebuggerTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SelectExpressionForDebuggerTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.evaluate; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @RunWith(JUnit3RunnerWithInners.class) public class SelectExpressionForDebuggerTestGenerated extends AbstractSelectExpressionForDebuggerTest { - @TestMetadata("idea/testData/debugger/selectExpression") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class SelectExpression extends AbstractSelectExpressionForDebuggerTest { @@ -28,201 +28,201 @@ public class SelectExpressionForDebuggerTestGenerated extends AbstractSelectExpr } public void testAllFilesPresentInSelectExpression() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/selectExpression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, false); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, false); } @TestMetadata("annotation.kt") public void testAnnotation() throws Exception { - runTest("idea/testData/debugger/selectExpression/annotation.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/annotation.kt"); } @TestMetadata("arrayExpression.kt") public void testArrayExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/arrayExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/arrayExpression.kt"); } @TestMetadata("binaryExpression.kt") public void testBinaryExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/binaryExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/binaryExpression.kt"); } @TestMetadata("call.kt") public void testCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/call.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/call.kt"); } @TestMetadata("companionObjectCall.kt") public void testCompanionObjectCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/companionObjectCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/companionObjectCall.kt"); } @TestMetadata("companionObjectCall2.kt") public void testCompanionObjectCall2() throws Exception { - runTest("idea/testData/debugger/selectExpression/companionObjectCall2.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/companionObjectCall2.kt"); } @TestMetadata("expressionInPropertyInitializer.kt") public void testExpressionInPropertyInitializer() throws Exception { - runTest("idea/testData/debugger/selectExpression/expressionInPropertyInitializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/expressionInPropertyInitializer.kt"); } @TestMetadata("extensionFun.kt") public void testExtensionFun() throws Exception { - runTest("idea/testData/debugger/selectExpression/extensionFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/extensionFun.kt"); } @TestMetadata("firstCallInChain.kt") public void testFirstCallInChain() throws Exception { - runTest("idea/testData/debugger/selectExpression/firstCallInChain.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/firstCallInChain.kt"); } @TestMetadata("fullyQualified.kt") public void testFullyQualified() throws Exception { - runTest("idea/testData/debugger/selectExpression/fullyQualified.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/fullyQualified.kt"); } @TestMetadata("funArgument.kt") public void testFunArgument() throws Exception { - runTest("idea/testData/debugger/selectExpression/funArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/funArgument.kt"); } @TestMetadata("functionLiteral.kt") public void testFunctionLiteral() throws Exception { - runTest("idea/testData/debugger/selectExpression/functionLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/functionLiteral.kt"); } @TestMetadata("getConvention.kt") public void testGetConvention() throws Exception { - runTest("idea/testData/debugger/selectExpression/getConvention.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/getConvention.kt"); } @TestMetadata("imports.kt") public void testImports() throws Exception { - runTest("idea/testData/debugger/selectExpression/imports.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/imports.kt"); } @TestMetadata("infixCall.kt") public void testInfixCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/infixCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/infixCall.kt"); } @TestMetadata("infixCallArgument.kt") public void testInfixCallArgument() throws Exception { - runTest("idea/testData/debugger/selectExpression/infixCallArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/infixCallArgument.kt"); } @TestMetadata("isExpression.kt") public void testIsExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/isExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/isExpression.kt"); } @TestMetadata("javaStaticMehtodCall.kt") public void testJavaStaticMehtodCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/javaStaticMehtodCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/javaStaticMehtodCall.kt"); } @TestMetadata("keyword.kt") public void testKeyword() throws Exception { - runTest("idea/testData/debugger/selectExpression/keyword.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/keyword.kt"); } @TestMetadata("modifier.kt") public void testModifier() throws Exception { - runTest("idea/testData/debugger/selectExpression/modifier.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/modifier.kt"); } @TestMetadata("nameArgument.kt") public void testNameArgument() throws Exception { - runTest("idea/testData/debugger/selectExpression/nameArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/nameArgument.kt"); } @TestMetadata("objectMethodCall.kt") public void testObjectMethodCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/objectMethodCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/objectMethodCall.kt"); } @TestMetadata("package.kt") public void testPackage() throws Exception { - runTest("idea/testData/debugger/selectExpression/package.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/package.kt"); } @TestMetadata("param.kt") public void testParam() throws Exception { - runTest("idea/testData/debugger/selectExpression/param.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/param.kt"); } @TestMetadata("propertyCall.kt") public void testPropertyCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/propertyCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/propertyCall.kt"); } @TestMetadata("propertyDeclaration.kt") public void testPropertyDeclaration() throws Exception { - runTest("idea/testData/debugger/selectExpression/propertyDeclaration.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/propertyDeclaration.kt"); } @TestMetadata("qualifiedExpressionProperty.kt") public void testQualifiedExpressionProperty() throws Exception { - runTest("idea/testData/debugger/selectExpression/qualifiedExpressionProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/qualifiedExpressionProperty.kt"); } @TestMetadata("qualifiedExpressionReceiver.kt") public void testQualifiedExpressionReceiver() throws Exception { - runTest("idea/testData/debugger/selectExpression/qualifiedExpressionReceiver.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/qualifiedExpressionReceiver.kt"); } @TestMetadata("qualifiedExpressionSelector.kt") public void testQualifiedExpressionSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/qualifiedExpressionSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/qualifiedExpressionSelector.kt"); } @TestMetadata("super.kt") public void testSuper() throws Exception { - runTest("idea/testData/debugger/selectExpression/super.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/super.kt"); } @TestMetadata("superSelector.kt") public void testSuperSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/superSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/superSelector.kt"); } @TestMetadata("this.kt") public void testThis() throws Exception { - runTest("idea/testData/debugger/selectExpression/this.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/this.kt"); } @TestMetadata("thisSelector.kt") public void testThisSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/thisSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/thisSelector.kt"); } @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() throws Exception { - runTest("idea/testData/debugger/selectExpression/thisWithLabel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/thisWithLabel.kt"); } @TestMetadata("unaryExpression.kt") public void testUnaryExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/unaryExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/unaryExpression.kt"); } @TestMetadata("userType.kt") public void testUserType() throws Exception { - runTest("idea/testData/debugger/selectExpression/userType.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/userType.kt"); } @TestMetadata("userTypeGeneric.kt") public void testUserTypeGeneric() throws Exception { - runTest("idea/testData/debugger/selectExpression/userTypeGeneric.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/userTypeGeneric.kt"); } @TestMetadata("userTypeQualified.kt") public void testUserTypeQualified() throws Exception { - runTest("idea/testData/debugger/selectExpression/userTypeQualified.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/userTypeQualified.kt"); } } - @TestMetadata("idea/testData/debugger/selectExpression/disallowMethodCalls") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class DisallowMethodCalls extends AbstractSelectExpressionForDebuggerTest { @@ -231,107 +231,107 @@ public class SelectExpressionForDebuggerTestGenerated extends AbstractSelectExpr } public void testAllFilesPresentInDisallowMethodCalls() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/selectExpression/disallowMethodCalls"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("binaryExpression.kt") public void testBinaryExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/binaryExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/binaryExpression.kt"); } @TestMetadata("call.kt") public void testCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/call.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/call.kt"); } @TestMetadata("expressionInPropertyInitializer.kt") public void testExpressionInPropertyInitializer() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/expressionInPropertyInitializer.kt"); } @TestMetadata("extensionFun.kt") public void testExtensionFun() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/extensionFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/extensionFun.kt"); } @TestMetadata("funArgument.kt") public void testFunArgument() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/funArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/funArgument.kt"); } @TestMetadata("functionLiteral.kt") public void testFunctionLiteral() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/functionLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/functionLiteral.kt"); } @TestMetadata("getConvention.kt") public void testGetConvention() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/getConvention.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/getConvention.kt"); } @TestMetadata("infixCall.kt") public void testInfixCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/infixCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/infixCall.kt"); } @TestMetadata("infixCallArgument.kt") public void testInfixCallArgument() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/infixCallArgument.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/infixCallArgument.kt"); } @TestMetadata("isExpression.kt") public void testIsExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/isExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/isExpression.kt"); } @TestMetadata("propertyCall.kt") public void testPropertyCall() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/propertyCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/propertyCall.kt"); } @TestMetadata("qualifiedExpressionProperty.kt") public void testQualifiedExpressionProperty() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/qualifiedExpressionProperty.kt"); } @TestMetadata("qualifiedExpressionReceiver.kt") public void testQualifiedExpressionReceiver() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/qualifiedExpressionReceiver.kt"); } @TestMetadata("qualifiedExpressionSelector.kt") public void testQualifiedExpressionSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/qualifiedExpressionSelector.kt"); } @TestMetadata("super.kt") public void testSuper() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/super.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/super.kt"); } @TestMetadata("superSelector.kt") public void testSuperSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/superSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/superSelector.kt"); } @TestMetadata("this.kt") public void testThis() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/this.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/this.kt"); } @TestMetadata("thisSelector.kt") public void testThisSelector() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/thisSelector.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/thisSelector.kt"); } @TestMetadata("thisWithLabel.kt") public void testThisWithLabel() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/thisWithLabel.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/thisWithLabel.kt"); } @TestMetadata("unaryExpression.kt") public void testUnaryExpression() throws Exception { - runTest("idea/testData/debugger/selectExpression/disallowMethodCalls/unaryExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/selectExpression/disallowMethodCalls/unaryExpression.kt"); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java similarity index 56% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java index eae2a1f3f3d..d0efcdc8890 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartStepIntoTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/SmartStepIntoTestGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/debugger/smartStepInto") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class SmartStepIntoTestGenerated extends AbstractSmartStepIntoTest { @@ -26,161 +26,161 @@ public class SmartStepIntoTestGenerated extends AbstractSmartStepIntoTest { } public void testAllFilesPresentInSmartStepInto() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/smartStepInto"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("annotation.kt") public void testAnnotation() throws Exception { - runTest("idea/testData/debugger/smartStepInto/annotation.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/annotation.kt"); } @TestMetadata("arrayAccess.kt") public void testArrayAccess() throws Exception { - runTest("idea/testData/debugger/smartStepInto/arrayAccess.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/arrayAccess.kt"); } @TestMetadata("callChain.kt") public void testCallChain() throws Exception { - runTest("idea/testData/debugger/smartStepInto/callChain.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/callChain.kt"); } @TestMetadata("constructor.kt") public void testConstructor() throws Exception { - runTest("idea/testData/debugger/smartStepInto/constructor.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/constructor.kt"); } @TestMetadata("conventionMethod.kt") public void testConventionMethod() throws Exception { - runTest("idea/testData/debugger/smartStepInto/conventionMethod.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/conventionMethod.kt"); } @TestMetadata("delegatedPropertyGetter.kt") public void testDelegatedPropertyGetter() throws Exception { - runTest("idea/testData/debugger/smartStepInto/delegatedPropertyGetter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/delegatedPropertyGetter.kt"); } @TestMetadata("doWhile.kt") public void testDoWhile() throws Exception { - runTest("idea/testData/debugger/smartStepInto/doWhile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/doWhile.kt"); } @TestMetadata("dotQualified.kt") public void testDotQualified() throws Exception { - runTest("idea/testData/debugger/smartStepInto/dotQualified.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/dotQualified.kt"); } @TestMetadata("dotQualifiedInParam.kt") public void testDotQualifiedInParam() throws Exception { - runTest("idea/testData/debugger/smartStepInto/dotQualifiedInParam.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/dotQualifiedInParam.kt"); } @TestMetadata("empty.kt") public void testEmpty() throws Exception { - runTest("idea/testData/debugger/smartStepInto/empty.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/empty.kt"); } @TestMetadata("for.kt") public void testFor() throws Exception { - runTest("idea/testData/debugger/smartStepInto/for.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/for.kt"); } @TestMetadata("funLiteral.kt") public void testFunLiteral() throws Exception { - runTest("idea/testData/debugger/smartStepInto/funLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/funLiteral.kt"); } @TestMetadata("funWithExpressionBody.kt") public void testFunWithExpressionBody() throws Exception { - runTest("idea/testData/debugger/smartStepInto/funWithExpressionBody.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/funWithExpressionBody.kt"); } @TestMetadata("if.kt") public void testIf() throws Exception { - runTest("idea/testData/debugger/smartStepInto/if.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/if.kt"); } @TestMetadata("infixCall.kt") public void testInfixCall() throws Exception { - runTest("idea/testData/debugger/smartStepInto/infixCall.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/infixCall.kt"); } @TestMetadata("inlinedFunLiteral.kt") public void testInlinedFunLiteral() throws Exception { - runTest("idea/testData/debugger/smartStepInto/inlinedFunLiteral.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlinedFunLiteral.kt"); } @TestMetadata("inlinedFunctionalExpression.kt") public void testInlinedFunctionalExpression() throws Exception { - runTest("idea/testData/debugger/smartStepInto/inlinedFunctionalExpression.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/inlinedFunctionalExpression.kt"); } @TestMetadata("invoke.kt") public void testInvoke() throws Exception { - runTest("idea/testData/debugger/smartStepInto/invoke.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/invoke.kt"); } @TestMetadata("libraryFun.kt") public void testLibraryFun() throws Exception { - runTest("idea/testData/debugger/smartStepInto/libraryFun.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/libraryFun.kt"); } @TestMetadata("multiline.kt") public void testMultiline() throws Exception { - runTest("idea/testData/debugger/smartStepInto/multiline.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/multiline.kt"); } @TestMetadata("multilineCallChain.kt") public void testMultilineCallChain() throws Exception { - runTest("idea/testData/debugger/smartStepInto/multilineCallChain.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/multilineCallChain.kt"); } @TestMetadata("object.kt") public void testObject() throws Exception { - runTest("idea/testData/debugger/smartStepInto/object.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/object.kt"); } @TestMetadata("param.kt") public void testParam() throws Exception { - runTest("idea/testData/debugger/smartStepInto/param.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/param.kt"); } @TestMetadata("parantesized.kt") public void testParantesized() throws Exception { - runTest("idea/testData/debugger/smartStepInto/parantesized.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/parantesized.kt"); } @TestMetadata("propertyGetter.kt") public void testPropertyGetter() throws Exception { - runTest("idea/testData/debugger/smartStepInto/propertyGetter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/propertyGetter.kt"); } @TestMetadata("renderer.kt") public void testRenderer() throws Exception { - runTest("idea/testData/debugger/smartStepInto/renderer.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/renderer.kt"); } @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("idea/testData/debugger/smartStepInto/simple.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/simple.kt"); } @TestMetadata("stringTemplate.kt") public void testStringTemplate() throws Exception { - runTest("idea/testData/debugger/smartStepInto/stringTemplate.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/stringTemplate.kt"); } @TestMetadata("unary.kt") public void testUnary() throws Exception { - runTest("idea/testData/debugger/smartStepInto/unary.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/unary.kt"); } @TestMetadata("when.kt") public void testWhen() throws Exception { - runTest("idea/testData/debugger/smartStepInto/when.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/when.kt"); } @TestMetadata("while.kt") public void testWhile() throws Exception { - runTest("idea/testData/debugger/smartStepInto/while.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/smartStepInto/while.kt"); } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockLocation.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockLocation.kt new file mode 100644 index 00000000000..6f10a9aa3a7 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockLocation.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.mock + +import com.sun.jdi.* + +class MockLocation(private val declaringType: ReferenceType, private val sourceName: String, private val lineNumber: Int) : Location { + override fun declaringType() = declaringType + override fun sourceName() = sourceName + override fun lineNumber() = lineNumber + override fun method() = MockMethod() + override fun codeIndex() = throw UnsupportedOperationException() + override fun sourceName(s: String) = throw UnsupportedOperationException() + override fun sourcePath() = throw AbsentInformationException() + override fun sourcePath(s: String) = throw AbsentInformationException() + override fun lineNumber(s: String) = throw UnsupportedOperationException() + override fun compareTo(other: Location) = throw UnsupportedOperationException() + override fun virtualMachine() = throw UnsupportedOperationException() +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockMethod.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockMethod.kt similarity index 98% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/MockMethod.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockMethod.kt index 70f26bf157f..d67a8368a36 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockMethod.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockMethod.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test.mock import com.sun.jdi.Location import com.sun.jdi.Method diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockSourcePosition.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockSourcePosition.kt new file mode 100644 index 00000000000..8a2e94dd804 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockSourcePosition.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.mock + +import com.intellij.debugger.SourcePosition +import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiFile + +class MockSourcePosition( + private val myFile: PsiFile? = null, + private val myElementAt: PsiElement? = null, + private val myLine: Int? = null, + private val myOffset: Int? = null, + private val myEditor: Editor? = null +) : SourcePosition() { + override fun getFile(): PsiFile { + return myFile ?: throw UnsupportedOperationException("Parameter file isn't set for MockSourcePosition") + } + + override fun getElementAt(): PsiElement { + return myElementAt ?: throw UnsupportedOperationException("Parameter elementAt isn't set for MockSourcePosition") + } + + override fun getLine(): Int { + return myLine ?: throw UnsupportedOperationException("Parameter line isn't set for MockSourcePosition") + } + + override fun getOffset(): Int { + return myOffset ?: throw UnsupportedOperationException("Parameter offset isn't set for MockSourcePosition") + } + + override fun openEditor(requestFocus: Boolean): Editor { + return myEditor ?: throw UnsupportedOperationException("Parameter editor isn't set for MockSourcePosition") + } + + override fun navigate(requestFocus: Boolean) { + throw UnsupportedOperationException("navigate() isn't supported for MockSourcePosition") + } + + override fun canNavigate(): Boolean { + throw UnsupportedOperationException("canNavigate() isn't supported for MockSourcePosition") + } + + override fun canNavigateToSource(): Boolean { + throw UnsupportedOperationException("canNavigateToSource() isn't supported for MockSourcePosition") + } +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockVirtualMachine.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockVirtualMachine.java similarity index 99% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/MockVirtualMachine.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockVirtualMachine.java index 0347db85f3d..571c8e3e767 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockVirtualMachine.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/MockVirtualMachine.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger; +package org.jetbrains.kotlin.idea.debugger.test.mock; import com.sun.jdi.*; import com.sun.jdi.event.EventQueue; diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartMockReferenceType.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/SmartMockReferenceType.kt similarity index 85% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/SmartMockReferenceType.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/SmartMockReferenceType.kt index 11052666956..aa768cdfc8d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/SmartMockReferenceType.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/mock/SmartMockReferenceType.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test.mock import com.sun.jdi.* import org.jetbrains.kotlin.backend.common.output.OutputFile @@ -19,118 +19,89 @@ class SmartMockReferenceTypeContext(outputFiles: List) { val virtualMachine = MockVirtualMachine() - val classes = outputFiles.filter { it.relativePath.endsWith(".class") }.map { file -> - ClassNode().also { ClassReader(file.asByteArray()).accept(it, ClassReader.EXPAND_FRAMES) } + val classes = outputFiles + .filter { it.relativePath.endsWith(".class") } + .map { it.readClass() } + + private val referenceTypes: List by lazy { + classes.map { SmartMockReferenceType(it, this) } } - val referenceTypes: List by lazy { classes.map { SmartMockReferenceType(it, this) } } + val referenceTypesByName by lazy { + referenceTypes.map { Pair(it.name(), it) }.toMap() + } +} - val referenceTypesByName by lazy { referenceTypes.map { Pair(it.name(), it) }.toMap() } +private fun OutputFile.readClass(): ClassNode { + val classNode = ClassNode() + ClassReader(asByteArray()).accept(classNode, ClassReader.EXPAND_FRAMES) + return classNode } class SmartMockReferenceType(val classNode: ClassNode, private val context: SmartMockReferenceTypeContext) : ReferenceType { override fun instances(maxInstances: Long) = emptyList() - override fun isPublic() = (classNode.access and Opcodes.ACC_PUBLIC) != 0 - override fun classLoader() = null - override fun sourceName(): String? = classNode.sourceFile - - override fun fields() = TODO() - override fun defaultStratum() = "Java" - - override fun isVerified() = true - - override fun allFields() = TODO() - - override fun isPackagePrivate() = (classNode.access and Opcodes.ACC_PUBLIC) == 0 - && (classNode.access and Opcodes.ACC_PROTECTED) == 0 - && (classNode.access and Opcodes.ACC_PRIVATE) == 0 - override fun isStatic() = (classNode.access and Opcodes.ACC_STATIC) != 0 - - override fun fieldByName(fieldName: String) = TODO() - - override fun getValue(p0: Field?) = TODO() + override fun modifiers() = classNode.access + override fun isProtected() = (classNode.access and Opcodes.ACC_PROTECTED) != 0 + override fun isFinal() = (classNode.access and Opcodes.ACC_FINAL) != 0 + override fun allLineLocations() = methodsCached.flatMap { it.allLineLocations() } + override fun genericSignature(): String? = classNode.signature + override fun isAbstract() = (classNode.access and Opcodes.ACC_ABSTRACT) != 0 + override fun isPrepared() = true + override fun name() = classNode.name.replace('/', '.') + override fun isInitialized() = true + override fun sourcePaths(stratum: String) = listOf(classNode.sourceFile) + override fun failedToInitialize() = false + override fun virtualMachine() = context.virtualMachine + override fun isPrivate() = (classNode.access and Opcodes.ACC_PRIVATE) != 0 + override fun signature(): String? = classNode.signature + override fun sourceNames(stratum: String) = listOf(classNode.sourceFile) + override fun availableStrata() = emptyList() private val methodsCached by lazy { classNode.methods.map { MockMethod(it, this) } } - override fun methods() = methodsCached - override fun visibleFields() = TODO() - - override fun modifiers() = classNode.access - - override fun isProtected() = (classNode.access and Opcodes.ACC_PROTECTED) != 0 - - override fun isFinal() = (classNode.access and Opcodes.ACC_FINAL) != 0 - - override fun allLineLocations() = methodsCached.flatMap { it.allLineLocations() } - - override fun allLineLocations(stratum: String, sourceName: String) = TODO() - - override fun genericSignature(): String? = classNode.signature - - override fun majorVersion() = TODO() - - override fun constantPoolCount() = TODO() - - override fun constantPool() = TODO() - - override fun isAbstract() = (classNode.access and Opcodes.ACC_ABSTRACT) != 0 - - override fun compareTo(other: ReferenceType?) = TODO() - - override fun sourceDebugExtension() = TODO() - - override fun visibleMethods() = TODO() - - override fun isPrepared() = true - - override fun name() = classNode.name.replace('/', '.') - - override fun isInitialized() = true - - override fun locationsOfLine(lineNumber: Int) = TODO() - - override fun locationsOfLine(stratum: String, sourceName: String, lineNumber: Int) = TODO() - - override fun getValues(p0: MutableList?) = TODO() - override fun nestedTypes(): List { val fromInnerClasses = classNode.innerClasses - .filter { it.outerName == classNode.name } - .mapNotNull { context.classes.find { c -> it.name == c.name } } + .filter { it.outerName == classNode.name } + .mapNotNull { context.classes.find { c -> it.name == c.name } } val fromOuterClasses = context.classes.filter { it.outerClass == classNode.name } return (fromInnerClasses + fromOuterClasses).distinctBy { it.name }.map { SmartMockReferenceType(it, context) } } - override fun sourcePaths(stratum: String) = listOf(classNode.sourceFile) + override fun isPackagePrivate(): Boolean { + return ((classNode.access and Opcodes.ACC_PUBLIC) == 0 + && (classNode.access and Opcodes.ACC_PROTECTED) == 0 + && (classNode.access and Opcodes.ACC_PRIVATE) == 0) + } - override fun failedToInitialize() = false - - override fun virtualMachine() = context.virtualMachine + override fun isVerified() = true + override fun fields() = TODO() + override fun allFields() = TODO() + override fun fieldByName(fieldName: String) = TODO() + override fun getValue(p0: Field?) = TODO() + override fun visibleFields() = TODO() + override fun allLineLocations(stratum: String, sourceName: String) = TODO() + override fun majorVersion() = TODO() + override fun constantPoolCount() = TODO() + override fun constantPool() = TODO() + override fun compareTo(other: ReferenceType?) = TODO() + override fun sourceDebugExtension() = TODO() + override fun visibleMethods() = TODO() + override fun locationsOfLine(lineNumber: Int) = TODO() + override fun locationsOfLine(stratum: String, sourceName: String, lineNumber: Int) = TODO() + override fun getValues(p0: MutableList?) = TODO() override fun minorVersion() = TODO() - override fun classObject() = TODO() - - override fun isPrivate() = (classNode.access and Opcodes.ACC_PRIVATE) != 0 - - override fun signature(): String? = classNode.signature - - override fun sourceNames(stratum: String) = listOf(classNode.sourceFile) - override fun methodsByName(p0: String?) = TODO() - override fun methodsByName(p0: String?, p1: String?) = TODO() - - override fun availableStrata() = emptyList() - override fun allMethods() = TODO() override fun equals(other: Any?): Boolean { @@ -140,23 +111,37 @@ class SmartMockReferenceType(val classNode: ClassNode, private val context: Smar other as SmartMockReferenceType return classNode.name == other.classNode.name - } override fun hashCode(): Int { return classNode.name.hashCode() } - class MockMethod(val methodNode: MethodNode, val containingClass: SmartMockReferenceType) : Method { + class MockMethod(private val methodNode: MethodNode, val containingClass: SmartMockReferenceType) : Method { + override fun virtualMachine() = containingClass.context.virtualMachine + + override fun modifiers() = methodNode.access override fun isStaticInitializer() = methodNode.name == "" - override fun isPublic() = (methodNode.access and Opcodes.ACC_PUBLIC) != 0 - - override fun argumentTypeNames() = TODO() - override fun isNative() = (methodNode.access and Opcodes.ACC_NATIVE) != 0 + override fun isStatic() = (methodNode.access and Opcodes.ACC_STATIC) != 0 + override fun isBridge() = (methodNode.access and Opcodes.ACC_BRIDGE) != 0 + override fun isProtected() = (methodNode.access and Opcodes.ACC_PROTECTED) != 0 + override fun isFinal() = (methodNode.access and Opcodes.ACC_FINAL) != 0 + override fun isAbstract() = (methodNode.access and Opcodes.ACC_ABSTRACT) != 0 + override fun isSynthetic() = (methodNode.access and Opcodes.ACC_SYNTHETIC) != 0 + override fun isConstructor() = methodNode.name == "" + override fun isPrivate() = (methodNode.access and Opcodes.ACC_PRIVATE) != 0 - override fun arguments() = TODO() + override fun isPackagePrivate(): Boolean { + return ((methodNode.access and Opcodes.ACC_PUBLIC) == 0 + && (methodNode.access and Opcodes.ACC_PROTECTED) == 0 + && (methodNode.access and Opcodes.ACC_PRIVATE) == 0) + } + + override fun declaringType() = containingClass + override fun name(): String? = methodNode.name + override fun signature(): String? = methodNode.signature override fun location(): Location? { val instructionList = methodNode.instructions ?: return null @@ -170,20 +155,6 @@ class SmartMockReferenceType(val classNode: ClassNode, private val context: Smar return null } - override fun isPackagePrivate() = (methodNode.access and Opcodes.ACC_PUBLIC) == 0 - && (methodNode.access and Opcodes.ACC_PROTECTED) == 0 - && (methodNode.access and Opcodes.ACC_PRIVATE) == 0 - - override fun isStatic() = (methodNode.access and Opcodes.ACC_STATIC) != 0 - - override fun modifiers() = methodNode.access - - override fun isBridge() = (methodNode.access and Opcodes.ACC_BRIDGE) != 0 - - override fun isProtected() = (methodNode.access and Opcodes.ACC_PROTECTED) != 0 - - override fun isFinal() = (methodNode.access and Opcodes.ACC_FINAL) != 0 - override fun allLineLocations(): List { val instructionList = methodNode.instructions ?: return emptyList() var current = instructionList.first @@ -197,75 +168,39 @@ class SmartMockReferenceType(val classNode: ClassNode, private val context: Smar return locations } + override fun argumentTypeNames() = TODO() + override fun arguments() = TODO() override fun allLineLocations(p0: String?, p1: String?) = TODO() - override fun genericSignature() = TODO() - - override fun isAbstract() = (methodNode.access and Opcodes.ACC_ABSTRACT) != 0 - override fun returnType() = TODO() - override fun compareTo(other: Method?) = TODO() - override fun isObsolete() = false - override fun variablesByName(p0: String?) = TODO() - - override fun declaringType() = containingClass - override fun argumentTypes() = TODO() - override fun locationOfCodeIndex(p0: Long) = TODO() - override fun bytecodes() = TODO() - - override fun name(): String? = methodNode.name - override fun returnTypeName() = TODO() - override fun locationsOfLine(p0: Int) = TODO() - override fun locationsOfLine(p0: String?, p1: String?, p2: Int) = TODO() - override fun variables() = TODO() - override fun isVarArgs() = TODO() - - override fun isSynthetic() = (methodNode.access and Opcodes.ACC_SYNTHETIC) != 0 - - override fun isConstructor() = methodNode.name == "" - - override fun virtualMachine() = containingClass.context.virtualMachine - override fun isSynchronized() = TODO() - - override fun isPrivate() = (methodNode.access and Opcodes.ACC_PRIVATE) != 0 - - override fun signature(): String? = methodNode.signature } private class MockLocation(val method: MockMethod, val line: Int) : Location { + override fun virtualMachine() = method.containingClass.context.virtualMachine override fun sourceName() = method.containingClass.sourceName() + override fun lineNumber() = line + override fun sourcePath() = sourceName() + override fun declaringType() = method.containingClass + override fun method() = method override fun sourceName(stratum: String) = TODO() - override fun codeIndex() = TODO() - - override fun lineNumber() = line - override fun lineNumber(stratum: String) = TODO() - - override fun virtualMachine() = method.containingClass.context.virtualMachine - - override fun compareTo(other: Location?) = TODO() - - override fun sourcePath() = sourceName() - override fun sourcePath(stratum: String) = TODO() - override fun declaringType() = method.containingClass - - override fun method() = method + override fun compareTo(other: Location?) = TODO() } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferenceKey.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferenceKey.kt new file mode 100644 index 00000000000..13f332e7ed7 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferenceKey.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("ClassName") + +package org.jetbrains.kotlin.idea.debugger.test.preference + +import java.lang.reflect.ParameterizedType +import kotlin.properties.ReadOnlyProperty +import kotlin.reflect.KProperty +import kotlin.reflect.full.declaredMemberProperties +import kotlin.reflect.jvm.javaType + +class DebuggerPreferenceKey(val name: String, val type: Class<*>, val defaultValue: T) + +private inline fun debuggerPreferenceKey(defaultValue: T): ReadOnlyProperty> { + val clazz = T::class.java + + return object : ReadOnlyProperty> { + override fun getValue(thisRef: Any, property: KProperty<*>) = DebuggerPreferenceKey(property.name, clazz, defaultValue) + } +} + +internal object DebuggerPreferenceKeys { + val SKIP_SYNTHETIC_METHODS by debuggerPreferenceKey(true) + val SKIP_CONSTRUCTORS: DebuggerPreferenceKey by debuggerPreferenceKey(false) + val SKIP_CLASSLOADERS by debuggerPreferenceKey(true) + val TRACING_FILTERS_ENABLED by debuggerPreferenceKey(true) + val SKIP_GETTERS by debuggerPreferenceKey(false) + + val DISABLE_KOTLIN_INTERNAL_CLASSES by debuggerPreferenceKey(false) + val RENDER_DELEGATED_PROPERTIES by debuggerPreferenceKey(false) + val IS_FILTER_FOR_STDLIB_ALREADY_ADDED by debuggerPreferenceKey(false) + + val FORCE_RANKING by debuggerPreferenceKey(false) + val EMULATE_DEX by debuggerPreferenceKey(false) + + val PRINT_FRAME by debuggerPreferenceKey(false) + val SHOW_KOTLIN_VARIABLES by debuggerPreferenceKey(false) + val DESCRIPTOR_VIEW_OPTIONS by debuggerPreferenceKey("FULL") + + val ATTACH_LIBRARY by debuggerPreferenceKey(emptyList()) + + val SKIP by debuggerPreferenceKey(emptyList()) + val WATCH_FIELD_ACCESS by debuggerPreferenceKey(true) + val WATCH_FIELD_MODIFICATION by debuggerPreferenceKey(true) + val WATCH_FIELD_INITIALISATION by debuggerPreferenceKey(false) + + val JVM_TARGET by debuggerPreferenceKey("1.8") + + val values: List> by lazy { + DebuggerPreferenceKeys::class.declaredMemberProperties + .filter { (it.returnType.javaType as? ParameterizedType)?.rawType == DebuggerPreferenceKey::class.java } + .map { it.get(DebuggerPreferenceKeys) as DebuggerPreferenceKey<*> } + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferences.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferences.kt new file mode 100644 index 00000000000..c91990f4061 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/DebuggerPreferences.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.preference + +import com.intellij.openapi.project.Project +import org.jetbrains.kotlin.test.InTextDirectivesUtils + +class DebuggerPreferences(val project: Project, fileContents: String) { + private val values: Map + + init { + val values = HashMap() + for (key in DebuggerPreferenceKeys.values) { + val list = findValues(fileContents, key.name).takeIf { it.isNotEmpty() } ?: continue + + fun errorValue(): Nothing = error("Error value for key ${key.name}") + + val convertedValue: Any = when (key.type) { + java.lang.Boolean::class.java -> list.singleOrNull()?.toBoolean() ?: errorValue() + String::class.java -> list.singleOrNull() ?: errorValue() + java.lang.Integer::class.java -> list.singleOrNull()?.toIntOrNull() ?: errorValue() + List::class.java -> list + else -> error("Cannot find a converter for type ${key.type}") + } + values[key.name] = convertedValue + } + this.values = values + } + + private fun findValues(fileContents: String, key: String): List { + val list: List = InTextDirectivesUtils.findLinesWithPrefixesRemoved(fileContents, "// $key: ") + if (list.isNotEmpty()) { + return list + } + + if (InTextDirectivesUtils.findLinesWithPrefixesRemoved(fileContents, true, false, "// $key").isNotEmpty()) { + return listOf("true") + } + + return emptyList() + } + + operator fun get(key: DebuggerPreferenceKey): T { + @Suppress("UNCHECKED_CAST") + return values[key.name] as T? ?: key.defaultValue + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutator.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutator.kt new file mode 100644 index 00000000000..9aea6b59599 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutator.kt @@ -0,0 +1,37 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.preference + +import com.intellij.openapi.project.Project + +internal abstract class SettingsMutator(val key: DebuggerPreferenceKey) { + abstract fun setValue(value: T, project: Project): T + + open fun revertValue(value: T, project: Project) { + setValue(value, project) + } +} + +internal fun SettingsMutator.setValue(preferences: DebuggerPreferences): OldValueStorage { + val project = preferences.project + return OldValueStorage(this, project, setValue(preferences[key], project)) +} + +internal class OldValueStorage( + private val mutator: SettingsMutator, + private val project: Project, + private val oldValue: T +) { + fun revertValue() = mutator.revertValue(oldValue, project) +} + +internal class OldValuesStorage(private val oldValues: List>) { + fun revertValues() = oldValues.forEach { it.revertValue() } +} + +internal fun List>.mutate(preferences: DebuggerPreferences): OldValuesStorage { + return OldValuesStorage(map { it.setValue(preferences) }) +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutators.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutators.kt new file mode 100644 index 00000000000..c4a7eda1751 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/preference/SettingsMutators.kt @@ -0,0 +1,99 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.preference + +import com.intellij.debugger.settings.DebuggerSettings +import com.intellij.openapi.project.Project +import org.jetbrains.kotlin.idea.compiler.configuration.Kotlin2JvmCompilerArgumentsHolder +import org.jetbrains.kotlin.idea.debugger.DebuggerUtils +import org.jetbrains.kotlin.idea.debugger.KotlinDebuggerSettings +import org.jetbrains.kotlin.idea.debugger.ToggleKotlinVariablesState +import org.jetbrains.kotlin.idea.debugger.emulateDexDebugInTests +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.DISABLE_KOTLIN_INTERNAL_CLASSES +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.IS_FILTER_FOR_STDLIB_ALREADY_ADDED +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.RENDER_DELEGATED_PROPERTIES +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_CONSTRUCTORS +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_CLASSLOADERS +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_GETTERS +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_SYNTHETIC_METHODS +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.TRACING_FILTERS_ENABLED +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.EMULATE_DEX +import kotlin.reflect.KMutableProperty1 + +internal val SettingsMutators: List> = listOf( + DebuggerSettingsMutator(SKIP_SYNTHETIC_METHODS, DebuggerSettings::SKIP_SYNTHETIC_METHODS), + DebuggerSettingsMutator(SKIP_CONSTRUCTORS, DebuggerSettings::SKIP_CONSTRUCTORS), + DebuggerSettingsMutator(SKIP_CLASSLOADERS, DebuggerSettings::SKIP_CLASSLOADERS), + DebuggerSettingsMutator(TRACING_FILTERS_ENABLED, DebuggerSettings::TRACING_FILTERS_ENABLED), + DebuggerSettingsMutator(SKIP_GETTERS, DebuggerSettings::SKIP_GETTERS), + KotlinSettingsMutator(DISABLE_KOTLIN_INTERNAL_CLASSES, KotlinDebuggerSettings::DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES), + KotlinSettingsMutator(RENDER_DELEGATED_PROPERTIES, KotlinDebuggerSettings::DEBUG_RENDER_DELEGATED_PROPERTIES), + KotlinSettingsMutator(IS_FILTER_FOR_STDLIB_ALREADY_ADDED, KotlinDebuggerSettings::DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED), + DexSettingsMutator(EMULATE_DEX), + KotlinVariablesModeSettingsMutator, + JvmTargetSettingsMutator, + ForceRankingSettingsMutator +) + +private class DexSettingsMutator(key: DebuggerPreferenceKey): SettingsMutator(key) { + override fun setValue(value: Boolean, project: Project): Boolean { + val oldValue = emulateDexDebugInTests + emulateDexDebugInTests = value + return oldValue + } +} + +private class DebuggerSettingsMutator( + key: DebuggerPreferenceKey, + private val prop: KMutableProperty1 +) : SettingsMutator(key) { + override fun setValue(value: T, project: Project): T { + val debuggerSettings = DebuggerSettings.getInstance() + val oldValue = prop.get(debuggerSettings) + prop.set(debuggerSettings, value) + return oldValue + } +} + +private class KotlinSettingsMutator( + key: DebuggerPreferenceKey, + private val prop: KMutableProperty1 +) : SettingsMutator(key) { + override fun setValue(value: T, project: Project): T { + val debuggerSettings = KotlinDebuggerSettings.getInstance() + val oldValue = prop.get(debuggerSettings) + prop.set(debuggerSettings, value) + return oldValue + } +} + +private object KotlinVariablesModeSettingsMutator : SettingsMutator(DebuggerPreferenceKeys.SHOW_KOTLIN_VARIABLES) { + override fun setValue(value: Boolean, project: Project): Boolean { + val service = ToggleKotlinVariablesState.getService() + val oldValue = service.kotlinVariableView + service.kotlinVariableView = value + return oldValue + } +} + +private object JvmTargetSettingsMutator : SettingsMutator(DebuggerPreferenceKeys.JVM_TARGET) { + override fun setValue(value: String, project: Project): String { + var oldValue: String? = null + Kotlin2JvmCompilerArgumentsHolder.getInstance(project).update { + oldValue = jvmTarget + jvmTarget = value.takeIf { it.isNotEmpty() } + } + return oldValue ?: "" + } +} + +private object ForceRankingSettingsMutator : SettingsMutator(DebuggerPreferenceKeys.FORCE_RANKING) { + override fun setValue(value: Boolean, project: Project): Boolean { + val oldValue = DebuggerUtils.forceRanking + DebuggerUtils.forceRanking = value + return oldValue + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/KotlinPsiChainBuilderTestCase.kt similarity index 91% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/KotlinPsiChainBuilderTestCase.kt index b03fbc8cbbd..251877e099f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/KotlinPsiChainBuilderTestCase.kt @@ -2,7 +2,7 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence +package org.jetbrains.kotlin.idea.debugger.test.sequence import com.intellij.debugger.streams.test.StreamChainBuilderTestCase import com.intellij.debugger.streams.wrapper.StreamChain @@ -15,13 +15,11 @@ import com.intellij.testFramework.PsiTestUtil import junit.framework.TestCase import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime import org.jetbrains.kotlin.idea.caches.project.LibraryModificationTracker +import org.jetbrains.kotlin.idea.debugger.test.DEBUGGER_TESTDATA_PATH_BASE import org.jetbrains.kotlin.idea.test.PluginTestCaseBase -import java.io.File -import java.nio.file.Paths abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : StreamChainBuilderTestCase() { - override fun getTestDataPath(): String = - Paths.get(File("").absolutePath, "idea/testData/debugger/sequence/psi/$relativeTestPath/").toString() + override fun getTestDataPath(): String = "$DEBUGGER_TESTDATA_PATH_BASE/sequence/psi/$relativeTestPath" override fun getFileExtension(): String = ".kt" abstract val kotlinChainBuilder: StreamChainBuilder @@ -35,6 +33,7 @@ abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : override fun setUp() { super.setUp() ApplicationManager.getApplication().runWriteAction { + @Suppress("UnstableApiUsage") if (ProjectLibraryTable.getInstance(LightPlatformTestCase.getProject()).getLibraryByName(stdLibName) == null) { val stdLibPath = ForTestCompileRuntime.runtimeJarForTests() PsiTestUtil.addLibrary( diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/dsl/KotlinDslTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/dsl/KotlinDslTest.kt similarity index 79% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/dsl/KotlinDslTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/dsl/KotlinDslTest.kt index 7c58573f461..9b4c4ee984b 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/dsl/KotlinDslTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/dsl/KotlinDslTest.kt @@ -2,18 +2,19 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.dsl +package org.jetbrains.kotlin.idea.debugger.test.sequence.dsl import com.intellij.debugger.streams.test.DslTestCase import com.intellij.debugger.streams.trace.dsl.impl.DslImpl import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinCollectionsPeekCallFactory import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinStatementFactory +import org.jetbrains.kotlin.idea.debugger.test.DEBUGGER_TESTDATA_PATH_RELATIVE import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith @RunWith(JUnit3WithIdeaConfigurationRunner::class) class KotlinDslTest : DslTestCase(DslImpl(KotlinStatementFactory(KotlinCollectionsPeekCallFactory()))) { override fun getTestDataPath(): String { - return "idea/testData/debugger/sequence/dsl" + return "$DEBUGGER_TESTDATA_PATH_RELATIVE/sequence/dsl" } } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractCollectionTraceTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractCollectionTraceTestCase.kt similarity index 90% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractCollectionTraceTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractCollectionTraceTestCase.kt index 6631c75e2b7..3f81f51bdaa 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractCollectionTraceTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractCollectionTraceTestCase.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec import com.intellij.debugger.streams.lib.LibrarySupportProvider import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractJavaStreamTraceTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractJavaStreamTraceTestCase.kt similarity index 90% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractJavaStreamTraceTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractJavaStreamTraceTestCase.kt index 655b98e175c..d28c2500caa 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractJavaStreamTraceTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractJavaStreamTraceTestCase.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec import com.intellij.debugger.streams.lib.LibrarySupportProvider import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractSequenceTraceTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractSequenceTraceTestCase.kt similarity index 89% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractSequenceTraceTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractSequenceTraceTestCase.kt index 35320362675..89359827628 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/AbstractSequenceTraceTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/AbstractSequenceTraceTestCase.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec import com.intellij.debugger.streams.lib.LibrarySupportProvider import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSupportProvider diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/KotlinTraceTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/KotlinTraceTestCase.kt similarity index 70% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/KotlinTraceTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/KotlinTraceTestCase.kt index b948fc45a66..fe135b62327 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/KotlinTraceTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/KotlinTraceTestCase.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec import com.intellij.debugger.engine.evaluation.EvaluationContextImpl import com.intellij.debugger.impl.OutputChecker @@ -14,22 +14,17 @@ import com.intellij.debugger.streams.trace.* import com.intellij.debugger.streams.trace.impl.TraceResultInterpreterImpl import com.intellij.debugger.streams.wrapper.StreamChain import com.intellij.debugger.streams.wrapper.StreamChainBuilder -import com.intellij.execution.ExecutionException import com.intellij.execution.process.ProcessOutputTypes import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.util.Computable -import com.intellij.openapi.util.text.StringUtil -import com.intellij.openapi.vfs.VfsUtil -import com.intellij.util.indexing.FileBasedIndex import com.intellij.xdebugger.XDebugSessionListener -import com.sun.jdi.Value -import junit.framework.TestCase -import org.jetbrains.kotlin.idea.debugger.KotlinDebuggerTestBase -import java.io.File -import java.nio.file.Paths +import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches +import org.jetbrains.kotlin.idea.debugger.test.KotlinDescriptorTestCaseWithStepping +import org.jetbrains.kotlin.idea.debugger.test.TestFiles +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences import java.util.concurrent.atomic.AtomicBoolean -abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { +abstract class KotlinTraceTestCase : KotlinDescriptorTestCaseWithStepping() { private companion object { val DEFAULT_CHAIN_SELECTOR = ChainSelector.byIndex(0) } @@ -43,24 +38,12 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { abstract val librarySupportProvider: LibrarySupportProvider - fun doTest(filePath: String) = doTestImpl(filePath) + override fun doMultiFileTest(files: TestFiles, preferences: DebuggerPreferences) { + // Sequence expressions are verbose. Disable expression logging for sequence debugger + KotlinDebuggerCaches.LOG_COMPILATIONS = false - override fun createDebugProcess(path: String) { - val filePath = Paths.get(path) - FileBasedIndex.getInstance().requestReindex(VfsUtil.findFileByIoFile(filePath.toFile(), true)!!) - val packagePath = StringUtil.substringAfterLast(filePath.parent.toAbsolutePath().toString(), "src${File.separatorChar}") - ?: throw AssertionError("test data must be placed into test app project in 'src' directory") - - val fileName = filePath.getName(filePath.nameCount - 1).toString() - val packageName = packagePath.replace(File.separatorChar, '.') - createLocalProcess("$packageName.${fileName.replace(".kt", "Kt")}") - } - - @Throws(ExecutionException::class) - private fun doTestImpl(path: String, chainSelector: ChainSelector = DEFAULT_CHAIN_SELECTOR) { - createDebugProcess(path) val session = debuggerSession.xDebugSession ?: kotlin.test.fail("XDebugSession is null") - TestCase.assertNotNull(session) + assertNotNull(session) val completed = AtomicBoolean(false) val positionResolver = getPositionResolver() @@ -68,6 +51,8 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { val resultInterpreter = getResultInterpreter() val expressionBuilder = getExpressionBuilder() + val chainSelector = DEFAULT_CHAIN_SELECTOR + session.addSessionListener(object : XDebugSessionListener { override fun sessionPaused() { if (completed.getAndSet(true)) { @@ -77,7 +62,7 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { try { sessionPausedImpl() } catch (t: Throwable) { - println("Exception caught: " + t + ", " + t.message, ProcessOutputTypes.SYSTEM) + println("Exception caught: $t, ${t.message}", ProcessOutputTypes.SYSTEM) t.printStackTrace() resume() @@ -114,19 +99,14 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { }) } - private fun complete( - chain: StreamChain?, - result: TracingResult?, - error: String?, - errorReason: FailureReason? - ) { + private fun complete(chain: StreamChain?, result: TracingResult?, error: String?, errorReason: FailureReason?) { try { if (error != null) { - TestCase.assertNotNull(errorReason) - TestCase.assertNotNull(chain) - handleError(chain!!, error, errorReason!!) + assertNotNull(errorReason) + assertNotNull(chain) + throw AssertionError(error) } else { - TestCase.assertNull(errorReason) + assertNull(errorReason) handleSuccess(chain, result) } } catch (t: Throwable) { @@ -146,18 +126,11 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { return DebuggerPositionResolverImpl() } - protected fun handleError(chain: StreamChain, error: String, reason: FailureReason) { - TestCase.fail(error) - } - protected fun handleSuccess(chain: StreamChain?, result: TracingResult?) { - TestCase.assertNotNull(chain) - TestCase.assertNotNull(result) + kotlin.test.assertNotNull(chain) + kotlin.test.assertNotNull(result) - println(chain!!.text, ProcessOutputTypes.SYSTEM) - - val resultValue = result!!.result - handleResultValue(resultValue.value) + println(chain.text, ProcessOutputTypes.SYSTEM) val trace = result.trace traceChecker.checkChain(trace) @@ -166,9 +139,6 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { traceChecker.checkResolvedChain(resolvedTrace) } - private fun handleResultValue(result: Value?) { - } - private fun getResultInterpreter(): TraceResultInterpreter { return TraceResultInterpreterImpl(librarySupportProvider.librarySupport.interpreterFactory) } @@ -190,7 +160,6 @@ abstract class KotlinTraceTestCase : KotlinDebuggerTestBase() { fun select(chains: List): StreamChain companion object { - fun byIndex(index: Int): ChainSelector { return object : ChainSelector { override fun select(chains: List): StreamChain = chains[index] diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/SequenceTraceTestCaseGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/SequenceTraceTestCaseGenerated.java similarity index 55% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/SequenceTraceTestCaseGenerated.java rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/SequenceTraceTestCaseGenerated.java index fcf28fa5fb2..4763434177f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/SequenceTraceTestCaseGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/SequenceTraceTestCaseGenerated.java @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec; +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence") +@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCase { @@ -26,10 +26,10 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInSequence() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true, "terminal"); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true, "terminal"); } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/append") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Append extends AbstractSequenceTraceTestCase { @@ -38,31 +38,31 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInAppend() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/append"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("PlusArray.kt") public void testPlusArray() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/append/PlusArray.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append/PlusArray.kt"); } @TestMetadata("PlusElement.kt") public void testPlusElement() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/append/PlusElement.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append/PlusElement.kt"); } @TestMetadata("PlusSequence.kt") public void testPlusSequence() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/append/PlusSequence.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append/PlusSequence.kt"); } @TestMetadata("PlusSingle.kt") public void testPlusSingle() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/append/PlusSingle.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/append/PlusSingle.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/distinct") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Distinct extends AbstractSequenceTraceTestCase { @@ -71,46 +71,46 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInDistinct() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/distinct"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("Distinct.kt") public void testDistinct() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/Distinct.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/Distinct.kt"); } @TestMetadata("DistinctBy.kt") public void testDistinctBy() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctBy.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctBy.kt"); } @TestMetadata("DistinctByBigPrimitives.kt") public void testDistinctByBigPrimitives() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctByBigPrimitives.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctByBigPrimitives.kt"); } @TestMetadata("DistinctByNullableElement.kt") public void testDistinctByNullableElement() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctByNullableElement.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctByNullableElement.kt"); } @TestMetadata("DistinctByNullableKey.kt") public void testDistinctByNullableKey() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctByNullableKey.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctByNullableKey.kt"); } @TestMetadata("DistinctByNullableKeyAndElement.kt") public void testDistinctByNullableKeyAndElement() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctByNullableKeyAndElement.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctByNullableKeyAndElement.kt"); } @TestMetadata("DistinctObjects.kt") public void testDistinctObjects() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/distinct/DistinctObjects.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/distinct/DistinctObjects.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/filter") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Filter extends AbstractSequenceTraceTestCase { @@ -119,61 +119,61 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInFilter() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/filter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("Drop.kt") public void testDrop() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/Drop.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/Drop.kt"); } @TestMetadata("DropWhile.kt") public void testDropWhile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/DropWhile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/DropWhile.kt"); } @TestMetadata("Filter.kt") public void testFilter() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/Filter.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/Filter.kt"); } @TestMetadata("FilterIndexed.kt") public void testFilterIndexed() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/FilterIndexed.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/FilterIndexed.kt"); } @TestMetadata("FilterIsInstance.kt") public void testFilterIsInstance() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/FilterIsInstance.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/FilterIsInstance.kt"); } @TestMetadata("FilterNot.kt") public void testFilterNot() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/FilterNot.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/FilterNot.kt"); } @TestMetadata("Minus.kt") public void testMinus() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/Minus.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/Minus.kt"); } @TestMetadata("MinusElement.kt") public void testMinusElement() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/MinusElement.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/MinusElement.kt"); } @TestMetadata("Take.kt") public void testTake() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/Take.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/Take.kt"); } @TestMetadata("TakeWhile.kt") public void testTakeWhile() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/filter/TakeWhile.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/filter/TakeWhile.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/flatMap") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/flatMap") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class FlatMap extends AbstractSequenceTraceTestCase { @@ -182,21 +182,21 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInFlatMap() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/flatMap"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/flatMap"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("FlatMap.kt") public void testFlatMap() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/flatMap/FlatMap.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/flatMap/FlatMap.kt"); } @TestMetadata("Flatten.kt") public void testFlatten() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/flatMap/Flatten.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/flatMap/Flatten.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/map") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Map extends AbstractSequenceTraceTestCase { @@ -205,31 +205,31 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInMap() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/map"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("Map.kt") public void testMap() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/map/Map.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map/Map.kt"); } @TestMetadata("MapIndexed.kt") public void testMapIndexed() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/map/MapIndexed.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map/MapIndexed.kt"); } @TestMetadata("MapNotNull.kt") public void testMapNotNull() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/map/MapNotNull.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map/MapNotNull.kt"); } @TestMetadata("WithIndex.kt") public void testWithIndex() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/map/WithIndex.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/map/WithIndex.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/misc") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Misc extends AbstractSequenceTraceTestCase { @@ -238,86 +238,86 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInMisc() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/misc"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("AsSequence.kt") public void testAsSequence() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/AsSequence.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/AsSequence.kt"); } @TestMetadata("Chunked.kt") public void testChunked() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/Chunked.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/Chunked.kt"); } @TestMetadata("ChunkedWithTransform.kt") public void testChunkedWithTransform() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ChunkedWithTransform.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ChunkedWithTransform.kt"); } @TestMetadata("ConstrainOnce.kt") public void testConstrainOnce() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ConstrainOnce.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ConstrainOnce.kt"); } @TestMetadata("OnEach.kt") public void testOnEach() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/OnEach.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/OnEach.kt"); } @TestMetadata("RequireNoNulls.kt") public void testRequireNoNulls() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/RequireNoNulls.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/RequireNoNulls.kt"); } @TestMetadata("Windowed.kt") public void testWindowed() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/Windowed.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/Windowed.kt"); } @TestMetadata("WindowedWithBigStep.kt") public void testWindowedWithBigStep() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/WindowedWithBigStep.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/WindowedWithBigStep.kt"); } @TestMetadata("WindowedWithPartial.kt") public void testWindowedWithPartial() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/WindowedWithPartial.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/WindowedWithPartial.kt"); } @TestMetadata("WindowedWithStep.kt") public void testWindowedWithStep() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/WindowedWithStep.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/WindowedWithStep.kt"); } @TestMetadata("ZipWithGreater.kt") public void testZipWithGreater() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ZipWithGreater.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ZipWithGreater.kt"); } @TestMetadata("ZipWithLesser.kt") public void testZipWithLesser() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ZipWithLesser.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ZipWithLesser.kt"); } @TestMetadata("ZipWithNextMany.kt") public void testZipWithNextMany() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ZipWithNextMany.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ZipWithNextMany.kt"); } @TestMetadata("ZipWithNextSingle.kt") public void testZipWithNextSingle() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ZipWithNextSingle.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ZipWithNextSingle.kt"); } @TestMetadata("ZipWithSame.kt") public void testZipWithSame() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/misc/ZipWithSame.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/misc/ZipWithSame.kt"); } } - @TestMetadata("idea/testData/debugger/tinyApp/src/streams/sequence/sort") + @TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Sort extends AbstractSequenceTraceTestCase { @@ -326,32 +326,32 @@ public class SequenceTraceTestCaseGenerated extends AbstractSequenceTraceTestCas } public void testAllFilesPresentInSort() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/debugger/tinyApp/src/streams/sequence/sort"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("Sorted.kt") public void testSorted() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/sort/Sorted.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/Sorted.kt"); } @TestMetadata("SortedBy.kt") public void testSortedBy() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/sort/SortedBy.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedBy.kt"); } @TestMetadata("SortedByDescending.kt") public void testSortedByDescending() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/sort/SortedByDescending.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedByDescending.kt"); } @TestMetadata("SortedDescending.kt") public void testSortedDescending() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/sort/SortedDescending.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedDescending.kt"); } @TestMetadata("SortedWith.kt") public void testSortedWith() throws Exception { - runTest("idea/testData/debugger/tinyApp/src/streams/sequence/sort/SortedWith.kt"); + runTest("idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedWith.kt"); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/StreamTraceChecker.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/StreamTraceChecker.kt similarity index 92% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/StreamTraceChecker.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/StreamTraceChecker.kt index 699c9c6957c..795f5519f9e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/exec/StreamTraceChecker.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/exec/StreamTraceChecker.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.exec +package org.jetbrains.kotlin.idea.debugger.test.sequence.exec import com.intellij.debugger.streams.resolve.ResolvedStreamCall import com.intellij.debugger.streams.resolve.ResolvedStreamChain @@ -12,7 +12,6 @@ import com.intellij.execution.ExecutionTestCase import com.intellij.execution.process.ProcessOutputTypes import com.intellij.testFramework.UsefulTestCase import junit.framework.TestCase -import one.util.streamex.StreamEx import java.util.* class StreamTraceChecker(private val testCase: ExecutionTestCase) { @@ -73,7 +72,10 @@ class StreamTraceChecker(private val testCase: ExecutionTestCase) { for (element in values) { val mappedValues = mapper(element) val mapped = traceToString(mappedValues) - val line = if (Direction.FORWARD == direction) element.time.toString() + " -> " + mapped else mapped + " <- " + element.time + val line = when (direction) { + Direction.FORWARD -> element.time.toString() + " -> " + mapped + else -> mapped + " <- " + element.time + } println(" $line") } } @@ -99,7 +101,7 @@ class StreamTraceChecker(private val testCase: ExecutionTestCase) { TestCase.assertEquals(terminator.call.name, terminatorCall!!.name) } - if (!intermediates.isEmpty()) { + if (intermediates.isNotEmpty()) { val lastIntermediate = intermediates[intermediates.size - 1] val stateAfterIntermediates = lastIntermediate.stateAfter UsefulTestCase.assertInstanceOf(stateAfterIntermediates, NextAwareState::class.java) @@ -163,14 +165,13 @@ class StreamTraceChecker(private val testCase: ExecutionTestCase) { } private fun traceToString(trace: Collection): String { - return replaceIfEmpty(StreamEx.of(trace).map({ it.time }).sorted().joining(",")) - } + if (trace.isEmpty()) { + return "nothing" + } - private fun replaceIfEmpty(str: String): String { - return if (str.isEmpty()) "nothing" else str + return trace.map { it.time }.sorted().joinToString(",") } private fun println(msg: String) = testCase.println(msg, ProcessOutputTypes.SYSTEM) - private fun print(msg: String) = testCase.print(msg, ProcessOutputTypes.SYSTEM) } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/TypedChainTestCase.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/TypedChainTestCase.kt similarity index 86% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/TypedChainTestCase.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/TypedChainTestCase.kt index b363955068d..86fae0d837d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/TypedChainTestCase.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/TypedChainTestCase.kt @@ -2,17 +2,13 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi import com.intellij.debugger.streams.trace.impl.handler.type.GenericType -import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.KotlinPsiChainBuilderTestCase abstract class TypedChainTestCase(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) { - - protected fun doTest( - producerAfterType: GenericType, - vararg intermediateAfterTypes: GenericType - ) { + protected fun doTest(producerAfterType: GenericType, vararg intermediateAfterTypes: GenericType) { val elementAtCaret = configureAndGetElementAtCaret() assertNotNull(elementAtCaret) val chains = chainBuilder.build(elementAtCaret) diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/PositiveCollectionBuildTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/PositiveCollectionBuildTest.kt similarity index 85% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/PositiveCollectionBuildTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/PositiveCollectionBuildTest.kt index cc0b5fa887a..8e7233abf6e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/PositiveCollectionBuildTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/PositiveCollectionBuildTest.kt @@ -2,10 +2,10 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.collection +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.collection import com.intellij.debugger.streams.wrapper.StreamChainBuilder -import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.KotlinPsiChainBuilderTestCase import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/TypedCollectionChainTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/TypedCollectionChainTest.kt similarity index 94% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/TypedCollectionChainTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/TypedCollectionChainTest.kt index f912b7af2bf..336780e3b10 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/collection/TypedCollectionChainTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/collection/TypedCollectionChainTest.kt @@ -2,11 +2,11 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.collection +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.collection import com.intellij.debugger.streams.wrapper.StreamChainBuilder import org.jetbrains.kotlin.idea.debugger.sequence.lib.collections.KotlinCollectionSupportProvider -import org.jetbrains.kotlin.idea.debugger.sequence.psi.TypedChainTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.psi.TypedChainTestCase import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinSequenceTypes import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/AmbiguousChainsTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/AmbiguousChainsTest.kt similarity index 95% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/AmbiguousChainsTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/AmbiguousChainsTest.kt index 2c1273894d8..59b23c90380 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/AmbiguousChainsTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/AmbiguousChainsTest.kt @@ -2,7 +2,7 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.java import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/LocationPositiveChainTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/LocationPositiveChainTest.kt similarity index 95% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/LocationPositiveChainTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/LocationPositiveChainTest.kt index 1a535d7e338..e0970b668a3 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/LocationPositiveChainTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/LocationPositiveChainTest.kt @@ -2,7 +2,7 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.java import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/NegativeJavaStreamTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/NegativeJavaStreamTest.kt similarity index 89% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/NegativeJavaStreamTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/NegativeJavaStreamTest.kt index 9554442d1df..c6adfae5a7d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/NegativeJavaStreamTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/NegativeJavaStreamTest.kt @@ -2,10 +2,10 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.java import com.intellij.debugger.streams.wrapper.StreamChainBuilder -import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.KotlinPsiChainBuilderTestCase import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/PositiveJavaStreamTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/PositiveJavaStreamTest.kt similarity index 80% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/PositiveJavaStreamTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/PositiveJavaStreamTest.kt index b3ed9740a51..5449f0ee94d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/PositiveJavaStreamTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/PositiveJavaStreamTest.kt @@ -2,10 +2,10 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.java import com.intellij.debugger.streams.wrapper.StreamChainBuilder -import org.jetbrains.kotlin.idea.debugger.sequence.KotlinPsiChainBuilderTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.KotlinPsiChainBuilderTestCase import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider abstract class PositiveJavaStreamTest(subDirectory: String) : KotlinPsiChainBuilderTestCase.Positive("streams/positive/$subDirectory") { diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/TypedJavaChainTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/TypedJavaChainTest.kt similarity index 91% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/TypedJavaChainTest.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/TypedJavaChainTest.kt index 082e6ad0b6d..bc8cf88a746 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/java/TypedJavaChainTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/java/TypedJavaChainTest.kt @@ -2,11 +2,11 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.java +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.java import com.intellij.debugger.streams.wrapper.StreamChainBuilder import org.jetbrains.kotlin.idea.debugger.sequence.lib.java.JavaStandardLibrarySupportProvider -import org.jetbrains.kotlin.idea.debugger.sequence.psi.TypedChainTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.psi.TypedChainTestCase import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinSequenceTypes.DOUBLE import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinSequenceTypes.INT import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinSequenceTypes.LONG diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/TypedSequenceChain.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/sequence/TypedSequenceChain.kt similarity index 84% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/TypedSequenceChain.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/sequence/TypedSequenceChain.kt index 9248d4d7c1f..9bd1737f274 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/psi/sequence/TypedSequenceChain.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/sequence/psi/sequence/TypedSequenceChain.kt @@ -2,11 +2,11 @@ * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger.sequence.psi.sequence +package org.jetbrains.kotlin.idea.debugger.test.sequence.psi.sequence import com.intellij.debugger.streams.wrapper.StreamChainBuilder import org.jetbrains.kotlin.idea.debugger.sequence.lib.sequence.KotlinSequenceSupportProvider -import org.jetbrains.kotlin.idea.debugger.sequence.psi.TypedChainTestCase +import org.jetbrains.kotlin.idea.debugger.test.sequence.psi.TypedChainTestCase import org.jetbrains.kotlin.idea.debugger.sequence.trace.dsl.KotlinSequenceTypes import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner import org.junit.runner.RunWith @@ -51,7 +51,9 @@ class TypedSequenceChain : TypedChainTestCase("sequence/positive/types") { fun testNullableToNotNull() = doTest(KotlinSequenceTypes.NULLABLE_ANY, KotlinSequenceTypes.INT) fun testNotNullToNullable() = doTest(KotlinSequenceTypes.DOUBLE, KotlinSequenceTypes.NULLABLE_ANY) - fun testFewTransitions1() = doTest(KotlinSequenceTypes.BYTE, KotlinSequenceTypes.ANY, KotlinSequenceTypes.NULLABLE_ANY, KotlinSequenceTypes.INT) - fun testFewTransitions2() = doTest(KotlinSequenceTypes.CHAR, KotlinSequenceTypes.BOOLEAN, KotlinSequenceTypes.DOUBLE, KotlinSequenceTypes.ANY) + fun testFewTransitions1() = + doTest(KotlinSequenceTypes.BYTE, KotlinSequenceTypes.ANY, KotlinSequenceTypes.NULLABLE_ANY, KotlinSequenceTypes.INT) -} + fun testFewTransitions2() = + doTest(KotlinSequenceTypes.CHAR, KotlinSequenceTypes.BOOLEAN, KotlinSequenceTypes.DOUBLE, KotlinSequenceTypes.ANY) +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/BreakpointCreator.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/BreakpointCreator.kt new file mode 100644 index 00000000000..454aa061a7f --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/BreakpointCreator.kt @@ -0,0 +1,225 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.util + +import org.jetbrains.kotlin.test.InTextDirectivesUtils.findLinesWithPrefixesRemoved +import com.intellij.debugger.DebuggerInvocationUtil +import com.intellij.openapi.application.ModalityState +import com.intellij.psi.PsiDocumentManager +import com.intellij.psi.PsiManager +import com.intellij.psi.search.FilenameIndex +import com.intellij.xdebugger.XDebuggerManager +import org.jetbrains.kotlin.test.testFramework.runWriteAction +import org.jetbrains.kotlin.idea.util.application.runReadAction +import com.intellij.debugger.engine.evaluation.CodeFragmentKind +import com.intellij.debugger.engine.evaluation.TextWithImportsImpl +import com.intellij.debugger.ui.breakpoints.Breakpoint +import com.intellij.debugger.ui.breakpoints.BreakpointManager +import com.intellij.debugger.ui.breakpoints.LineBreakpoint +import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.PsiFile +import com.intellij.xdebugger.XDebuggerUtil +import com.intellij.xdebugger.breakpoints.XBreakpointManager +import com.intellij.xdebugger.breakpoints.XBreakpointProperties +import com.intellij.xdebugger.breakpoints.XBreakpointType +import com.intellij.xdebugger.breakpoints.XLineBreakpointType +import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties +import org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties +import org.jetbrains.kotlin.idea.debugger.breakpoints.* +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences +import javax.swing.SwingUtilities + +internal class BreakpointCreator( + private val project: Project, + private val logger: (String) -> Unit, + private val preferences: DebuggerPreferences +) { + fun createBreakpoints(file: PsiFile) { + val document = runReadAction { PsiDocumentManager.getInstance(project).getDocument(file) } ?: return + val breakpointManager = XDebuggerManager.getInstance(project).breakpointManager + val kotlinFieldBreakpointType = findBreakpointType(KotlinFieldBreakpointType::class.java) + val virtualFile = file.virtualFile + + val runnable = { + var offset = -1 + while (true) { + val fileText = document.text + offset = fileText.indexOf("point!", offset + 1) + if (offset == -1) break + + val commentLine = document.getLineNumber(offset) + val lineIndex = commentLine + 1 + + val comment = fileText + .substring(document.getLineStartOffset(commentLine), document.getLineEndOffset(commentLine)) + .trim() + + when { + @Suppress("SpellCheckingInspection") comment.startsWith("//FieldWatchpoint!") -> { + val javaBreakpoint = createBreakpointOfType( + breakpointManager, + kotlinFieldBreakpointType, + lineIndex, + virtualFile + ) + + (javaBreakpoint as? KotlinFieldBreakpoint)?.apply { + @Suppress("SpellCheckingInspection") + val fieldName = comment.substringAfter("//FieldWatchpoint! (").substringBefore(")") + + setFieldName(fieldName) + setWatchAccess(preferences[DebuggerPreferenceKeys.WATCH_FIELD_ACCESS]) + setWatchModification(preferences[DebuggerPreferenceKeys.WATCH_FIELD_MODIFICATION]) + setWatchInitialization(preferences[DebuggerPreferenceKeys.WATCH_FIELD_INITIALISATION]) + + BreakpointManager.addBreakpoint(javaBreakpoint) + logger("KotlinFieldBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}") + } + } + comment.startsWith("//Breakpoint!") -> { + val ordinal = getPropertyFromComment(comment, "lambdaOrdinal")?.toInt() + val condition = getPropertyFromComment(comment, "condition") + createLineBreakpoint(breakpointManager, file, lineIndex, ordinal, condition) + } + comment.startsWith("//FunctionBreakpoint!") -> { + createFunctionBreakpoint(breakpointManager, file, lineIndex) + } + else -> throw AssertionError("Cannot create breakpoint at line ${lineIndex + 1}") + } + } + } + + if (!SwingUtilities.isEventDispatchThread()) { + DebuggerInvocationUtil.invokeAndWait(project, runnable, ModalityState.defaultModalityState()) + } else { + runnable.invoke() + } + } + + fun createAdditionalBreakpoints(fileContents: String) { + val breakpoints = findLinesWithPrefixesRemoved(fileContents, "// ADDITIONAL_BREAKPOINT: ") + for (breakpoint in breakpoints) { + val position = breakpoint.split(".kt:") + assert(position.size == 2) { "Couldn't parse position from test directive: directive = $breakpoint" } + + var lineMarker = position[1] + var ordinal: Int? = null + + if (lineMarker.contains(":(") && lineMarker.endsWith(")")) { + val lineMarkerAndOrdinal = lineMarker.split(":(") + lineMarker = lineMarkerAndOrdinal[0] + ordinal = lineMarkerAndOrdinal[1].substringBefore(")").toInt() + } + + createBreakpoint(position[0], lineMarker, ordinal) + } + } + + private fun getPropertyFromComment(comment: String, propertyName: String): String? { + if (comment.contains("$propertyName = ")) { + val result = comment.substringAfter("$propertyName = ") + if (result.contains(", ")) { + return result.substringBefore(", ") + } + if (result.contains(")")) { + return result.substringBefore(")") + } + } + return null + } + + private fun createBreakpoint(fileName: String, lineMarker: String, ordinal: Int?) { + val sourceFiles = runReadAction { + FilenameIndex.getAllFilesByExt(project, "kt") + .filter { it.name.contains(fileName) && it.contentsToByteArray().toString(Charsets.UTF_8).contains(lineMarker) } + } + + assert(sourceFiles.size == 1) { "One source file should be found: name = $fileName, sourceFiles = $sourceFiles" } + + val runnable = Runnable { + val psiSourceFile = PsiManager.getInstance(project).findFile(sourceFiles.first())!! + + val breakpointManager = XDebuggerManager.getInstance(project).breakpointManager + val document = PsiDocumentManager.getInstance(project).getDocument(psiSourceFile)!! + + val index = psiSourceFile.text!!.indexOf(lineMarker) + val lineNumber = document.getLineNumber(index) + 1 // lineMarker is for previous line + + createLineBreakpoint(breakpointManager, psiSourceFile, lineNumber, ordinal, null) + } + + DebuggerInvocationUtil.invokeAndWait(project, runnable, ModalityState.defaultModalityState()) + } + + private fun createFunctionBreakpoint(breakpointManager: XBreakpointManager, file: PsiFile, lineIndex: Int) { + val breakpointType = findBreakpointType(KotlinFunctionBreakpointType::class.java) + val breakpoint = createBreakpointOfType(breakpointManager, breakpointType, lineIndex, file.virtualFile) + if (breakpoint is KotlinFunctionBreakpoint) { + logger("FunctionBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}") + } + } + + private fun createLineBreakpoint( + breakpointManager: XBreakpointManager, + file: PsiFile, + lineIndex: Int, + lambdaOrdinal: Int?, + condition: String? + ) { + val kotlinLineBreakpointType = findBreakpointType(KotlinLineBreakpointType::class.java) + val javaBreakpoint = createBreakpointOfType( + breakpointManager, + kotlinLineBreakpointType, + lineIndex, + file.virtualFile + ) + + if (javaBreakpoint is LineBreakpoint<*>) { + val properties = javaBreakpoint.xBreakpoint.properties as? JavaLineBreakpointProperties ?: return + var suffix = "" + if (lambdaOrdinal != null) { + if (lambdaOrdinal != -1) { + properties.lambdaOrdinal = lambdaOrdinal - 1 + } else { + properties.lambdaOrdinal = lambdaOrdinal + } + suffix += " lambdaOrdinal = $lambdaOrdinal" + } + if (condition != null) { + javaBreakpoint.setCondition(TextWithImportsImpl(CodeFragmentKind.EXPRESSION, condition)) + suffix += " condition = $condition" + } + + BreakpointManager.addBreakpoint(javaBreakpoint) + logger("LineBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}$suffix") + } + } + + private fun createBreakpointOfType( + breakpointManager: XBreakpointManager, + breakpointType: XLineBreakpointType>, + lineIndex: Int, + virtualFile: VirtualFile + ): Breakpoint>? { + if (!breakpointType.canPutAt(virtualFile, lineIndex, project)) return null + val xBreakpoint = runWriteAction { + breakpointManager.addLineBreakpoint( + breakpointType, + virtualFile.url, + lineIndex, + breakpointType.createBreakpointProperties(virtualFile, lineIndex) + ) + } + return BreakpointManager.getJavaBreakpoint(xBreakpoint) + } + + @Suppress("UNCHECKED_CAST") + private inline fun > findBreakpointType(javaClass: Class): XLineBreakpointType> { + return XDebuggerUtil.getInstance().findBreakpointType(javaClass) as XLineBreakpointType> + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinter.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinter.kt new file mode 100644 index 00000000000..c2e0f3626e5 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinter.kt @@ -0,0 +1,322 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.util + +import com.intellij.debugger.SourcePosition +import com.intellij.debugger.engine.* +import com.intellij.debugger.engine.evaluation.CodeFragmentKind +import com.intellij.debugger.engine.evaluation.TextWithImports +import com.intellij.debugger.engine.evaluation.TextWithImportsImpl +import com.intellij.debugger.impl.DebuggerSession +import com.intellij.debugger.settings.NodeRendererSettings +import com.intellij.debugger.ui.impl.watch.* +import com.intellij.debugger.ui.tree.* +import com.intellij.openapi.Disposable +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.application.ModalityState +import com.intellij.openapi.roots.JdkOrderEntry +import com.intellij.openapi.roots.libraries.LibraryUtil +import com.intellij.openapi.util.Disposer +import com.intellij.openapi.util.io.FileUtil +import com.intellij.psi.PsiExpression +import com.intellij.xdebugger.impl.XDebugSessionImpl +import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl +import com.intellij.xdebugger.impl.frame.XDebugViewSessionListener +import com.intellij.xdebugger.impl.frame.XVariablesView +import com.intellij.xdebugger.impl.frame.XWatchesViewImpl +import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants +import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree +import com.intellij.xdebugger.impl.ui.tree.nodes.* +import org.jetbrains.kotlin.idea.debugger.KotlinFrameExtraVariablesProvider +import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinCodeFragmentFactory +import org.jetbrains.kotlin.idea.debugger.invokeInManagerThread +import org.jetbrains.kotlin.idea.debugger.test.KOTLIN_LIBRARY_NAME +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys +import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferences +import org.jetbrains.kotlin.idea.debugger.test.util.PrinterConfig.DescriptorViewOptions +import org.jetbrains.kotlin.psi.KtFile +import java.io.Closeable +import javax.swing.tree.TreeNode + +class FramePrinter( + debuggerSession: DebuggerSession, + private val delegate: FramePrinterDelegate, + private val preferences: DebuggerPreferences, + private val testRootDisposable: Disposable +) : Closeable { + private companion object { + fun getClassRenderer() = NodeRendererSettings.getInstance()!!.classRenderer!! + } + + private lateinit var variablesView: XVariablesView + private lateinit var watchesView: XWatchesViewImpl + + private val oldShowFqTypeNames: Boolean + + init { + ApplicationManager.getApplication().invokeAndWait( + { + variablesView = createVariablesView(debuggerSession) + watchesView = createWatchesView(debuggerSession) + }, ModalityState.any() + ) + + getClassRenderer().let { renderer -> + oldShowFqTypeNames = renderer.SHOW_FQ_TYPE_NAMES + renderer.SHOW_FQ_TYPE_NAMES = true + } + } + + override fun close() { + getClassRenderer().SHOW_FQ_TYPE_NAMES = oldShowFqTypeNames + } + + fun printFrame(completion: () -> Unit) { + if (preferences[DebuggerPreferenceKeys.PRINT_FRAME]) { + doPrintFrame(completion) + } else { + completion() + } + } + + private fun doPrintFrame(completion: () -> Unit) { + val tree = variablesView.tree + + val config = getPrinterConfig() + + fun processor() { + Printer(delegate, config).printTree(tree) + + for (extra in getExtraVars()) { + watchesView.addWatchExpression(XExpressionImpl.fromText(extra.text), -1, false) + } + + Printer(delegate, config).printTree(watchesView.tree) + + completion() + } + + // TODO why this is needed? Otherwise some tests are never ended + val filter: (TreeNode) -> Boolean = { it !is XValueNodeImpl || it.name != "cause" } + + delegate.expandAll(tree, ::processor, filter, delegate.evaluationContext.suspendContext) + } + + private fun getPrinterConfig(): PrinterConfig { + val skipInPrintFrame = preferences[DebuggerPreferenceKeys.SKIP].flatMap { it.split(',') }.map { it.trim() } + val viewOptions = DescriptorViewOptions.valueOf(preferences[DebuggerPreferenceKeys.DESCRIPTOR_VIEW_OPTIONS]) + return PrinterConfig(skipInPrintFrame, viewOptions) + } + + private fun createWatchesView(debuggerSession: DebuggerSession): XWatchesViewImpl { + val session = debuggerSession.xDebugSession as XDebugSessionImpl + val watchesView = XWatchesViewImpl(session, false) + Disposer.register(testRootDisposable, watchesView) + XDebugViewSessionListener.attach(watchesView, session) + return watchesView + } + + private fun createVariablesView(debuggerSession: DebuggerSession): XVariablesView { + val session = debuggerSession.xDebugSession as XDebugSessionImpl + val variablesView = XVariablesView(session) + Disposer.register(testRootDisposable, variablesView) + XDebugViewSessionListener.attach(variablesView, session) + return variablesView + } + + private fun getExtraVars(): Set { + return KotlinFrameExtraVariablesProvider() + .collectVariables(delegate.debuggerContext.sourcePosition, delegate.evaluationContext, hashSetOf()) + } +} + +private class PrinterConfig( + val variablesToSkipInPrintFrame: List = emptyList(), + val viewOptions: DescriptorViewOptions = DescriptorViewOptions.FULL +) { + enum class DescriptorViewOptions { + FULL, NAME_EXPRESSION, NAME_EXPRESSION_RESULT + } + + fun shouldRenderSourcesPosition(): Boolean { + return when (viewOptions) { + DescriptorViewOptions.FULL -> true + else -> false + } + } + + fun shouldRenderExpression(): Boolean { + return when { + viewOptions.toString().contains("EXPRESSION") -> true + else -> false + } + } + + fun renderLabel(node: TreeNode, descriptor: NodeDescriptorImpl): String { + return when { + descriptor is WatchItemDescriptor -> descriptor.calcValueName() + viewOptions.toString().contains("NAME") -> (node as? XValueNodeImpl)?.name ?: descriptor.name ?: descriptor.label + else -> descriptor.label + } + } + + fun shouldComputeResultOfCreateExpression(): Boolean { + return viewOptions == DescriptorViewOptions.NAME_EXPRESSION_RESULT + } +} + +private class Printer(private val delegate: FramePrinterDelegate, private val config: PrinterConfig) { + fun printTree(tree: XDebuggerTree) { + val root = tree.treeModel.root as TreeNode + printNode(root, 0) + } + + private fun printNode(node: TreeNode, indent: Int) { + val project = delegate.debuggerContext.project + + val descriptor = when (node) { + is DebuggerTreeNodeImpl -> node.descriptor + is XValueNodeImpl -> (node.valueContainer as? JavaValue)?.descriptor ?: MessageDescriptor(node.text.toString()) + is XStackFrameNode -> (node.valueContainer as? JavaStackFrame)?.descriptor + is XValueGroupNodeImpl -> (node.valueContainer as? JavaStaticGroup)?.descriptor + is WatchesRootNode -> null + is WatchNodeImpl -> WatchItemDescriptor(project, TextWithImportsImpl(CodeFragmentKind.EXPRESSION, node.expression.expression)) + is MessageTreeNode -> MessageDescriptor(node.text.toString()) + else -> MessageDescriptor(node.toString()) + } + + if (descriptor != null && printDescriptor(node, descriptor, indent)) { + return + } + + printChildren(node, indent + 2) + } + + fun printDescriptor(node: TreeNode, descriptor: NodeDescriptorImpl, indent: Int): Boolean { + if (descriptor is DefaultNodeDescriptor || config.variablesToSkipInPrintFrame.contains(descriptor.name)) { + return true + } + + val label = calculateLabel(node, descriptor) ?: return true + + val project = delegate.debuggerContext.project + val debugProcess = delegate.debuggerContext.debugProcess ?: error("Debugger process is not launched") + + val text = buildString { + append(" ".repeat(indent + 1)) + append(getPrefix(descriptor)) + append(label) + if (config.shouldRenderSourcesPosition() && hasSourcePosition(descriptor)) { + val sp = debugProcess.invokeInManagerThread { + SourcePositionProvider.getSourcePosition(descriptor, project, delegate.debuggerContext) + } + append(" (sp = ${render(sp)})") + } + + if (config.shouldRenderExpression() && descriptor is ValueDescriptorImpl) { + val expression = debugProcess.invokeInManagerThread { + descriptor.getTreeEvaluation((node as XValueNodeImpl).valueContainer as JavaValue, it) as? PsiExpression + } + + if (expression != null) { + val text = TextWithImportsImpl(expression) + val imports = expression.getUserData(DebuggerTreeNodeExpression.ADDITIONAL_IMPORTS_KEY)?.joinToString { it } ?: "" + + val codeFragment = KotlinCodeFragmentFactory().createPresentationCodeFragment( + TextWithImportsImpl(text.kind, text.text, text.imports + imports, text.fileType), + delegate.debuggerContext.sourcePosition.elementAt, project + ) + val codeFragmentText = codeFragment.text + + if (config.shouldComputeResultOfCreateExpression()) { + debugProcess.invokeInManagerThread { + val suspendContext = it.suspendContext ?: error(SuspendContext::class.java.simpleName + " is not set") + val fragment = TextWithImportsImpl(text.kind, codeFragmentText, codeFragment.importsToString(), text.fileType) + delegate.evaluate(suspendContext, fragment) + } + } + + append(" (expression = $codeFragmentText)") + } + } + append("\n") + } + + delegate.logDescriptor(descriptor, text) + + return false + } + + private fun calculateLabel(node: TreeNode, descriptor: NodeDescriptorImpl): String? { + var label = config.renderLabel(node, descriptor) + + // TODO: update presentation before calc label + if (label == NodeDescriptorImpl.UNKNOWN_VALUE_MESSAGE && descriptor is StaticDescriptor) { + label = "static = " + NodeRendererSettings.getInstance().classRenderer.renderTypeName(descriptor.type.name()) + } + + if (label.endsWith(XDebuggerUIConstants.COLLECTING_DATA_MESSAGE)) { + return null + } + + return label + } + + private fun getPrefix(descriptor: NodeDescriptorImpl): String { + val prefix = when (descriptor) { + is StackFrameDescriptor -> "frame" + is WatchItemDescriptor -> "extra" + is LocalVariableDescriptor -> "local" + is StaticDescriptor -> "static" + is ThisDescriptorImpl -> "this" + is FieldDescriptor -> "field" + is ArrayElementDescriptor -> "element" + is MessageDescriptor -> "" + else -> "unknown" + } + return prefix + " ".repeat("unknown ".length - prefix.length) + if (descriptor is MessageDescriptor) " - " else " = " + } + + private fun hasSourcePosition(descriptor: NodeDescriptorImpl): Boolean { + return when (descriptor) { + is LocalVariableDescriptor, + is FieldDescriptor -> true + else -> false + } + } + + private fun printChildren(node: TreeNode, indent: Int) { + val e = node.children() + while (e.hasMoreElements()) { + printNode(e.nextElement() as TreeNode, indent) + } + } + + private fun render(sp: SourcePosition?): String { + return renderSourcePosition(sp).replace(":", ", ") + } +} + +fun renderSourcePosition(sourcePosition: SourcePosition?): String { + if (sourcePosition == null) { + return "null" + } + + val virtualFile = sourcePosition.file.originalFile.virtualFile ?: sourcePosition.file.viewProvider.virtualFile + + val libraryEntry = LibraryUtil.findLibraryEntry(virtualFile, sourcePosition.file.project) + if (libraryEntry != null && (libraryEntry is JdkOrderEntry || libraryEntry.presentableName == KOTLIN_LIBRARY_NAME)) { + val suffix = if (sourcePosition.isInCompiledFile()) "COMPILED" else "EXT" + return FileUtil.getNameWithoutExtension(virtualFile.name) + ".!$suffix!" + } + + return virtualFile.name + ":" + (sourcePosition.line + 1) +} + +private fun SourcePosition.isInCompiledFile(): Boolean { + val ktFile = file as? KtFile ?: return false + return ktFile.isCompiled +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinterDelegate.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinterDelegate.kt new file mode 100644 index 00000000000..829fafe4c00 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/FramePrinterDelegate.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.util + +import com.intellij.debugger.engine.SuspendContextImpl +import com.intellij.debugger.engine.evaluation.EvaluationContextImpl +import com.intellij.debugger.engine.evaluation.TextWithImportsImpl +import com.intellij.debugger.impl.DebuggerContextImpl +import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl +import com.intellij.ui.treeStructure.Tree +import javax.swing.tree.TreeNode + +interface FramePrinterDelegate { + val debuggerContext: DebuggerContextImpl + val evaluationContext: EvaluationContextImpl + + fun evaluate(suspendContext: SuspendContextImpl, textWithImports: TextWithImportsImpl) + + fun expandAll(tree: Tree, runnable: () -> Unit, filter: (TreeNode) -> Boolean, suspendContext: SuspendContextImpl) + fun logDescriptor(descriptor: NodeDescriptorImpl, text: String) +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinOutputChecker.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/KotlinOutputChecker.kt similarity index 80% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinOutputChecker.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/KotlinOutputChecker.kt index 7e81c6e0f66..cd1ec8aa2a4 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinOutputChecker.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/KotlinOutputChecker.kt @@ -3,7 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test.util import com.intellij.debugger.impl.OutputChecker import com.intellij.idea.IdeaLogger @@ -19,18 +19,22 @@ import java.io.File import kotlin.math.min internal class KotlinOutputChecker( - private val testDir: String, - appPath: String, outputPath: String) : OutputChecker(appPath, outputPath) { + private val testDir: String, + appPath: String, + outputPath: String +) : OutputChecker(appPath, outputPath) { companion object { @JvmStatic private val LOG = Logger.getInstance(KotlinOutputChecker::class.java) - private val CONNECT_PREFIX = "Connected to the target VM" - private val DISCONNECT_PREFIX = "Disconnected from the target VM" - private val RUN_JAVA = "Run Java" + private const val CONNECT_PREFIX = "Connected to the target VM" + private const val DISCONNECT_PREFIX = "Disconnected from the target VM" + private const val RUN_JAVA = "Run Java" //ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 - private val JDI_BUG_OUTPUT_PATTERN_1 = Regex("ERROR:\\s+JDWP\\s+Unable\\s+to\\s+get\\s+JNI\\s+1\\.2\\s+environment,\\s+jvm->GetEnv\\(\\)\\s+return\\s+code\\s+=\\s+-2") + private val JDI_BUG_OUTPUT_PATTERN_1 = + Regex("ERROR:\\s+JDWP\\s+Unable\\s+to\\s+get\\s+JNI\\s+1\\.2\\s+environment,\\s+jvm->GetEnv\\(\\)\\s+return\\s+code\\s+=\\s+-2") + //JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820] private val JDI_BUG_OUTPUT_PATTERN_2 = Regex("JDWP\\s+exit\\s+error\\s+AGENT_ERROR_NO_JNI_ENV.*]") } @@ -51,16 +55,15 @@ internal class KotlinOutputChecker( val actual = preprocessBuffer(buildOutputString()) val outDir = File(testDir) - var outFile = File(outDir, myTestName + ".out") + var outFile = File(outDir, "$myTestName.out") if (!outFile.exists()) { if (SystemInfo.isWindows) { - val winOut = File(outDir, myTestName + ".win.out") + val winOut = File(outDir, "$myTestName.win.out") if (winOut.exists()) { outFile = winOut } - } - else if (SystemInfo.isUnix) { - val unixOut = File(outDir, myTestName + ".unx.out") + } else if (SystemInfo.isUnix) { + val unixOut = File(outDir, "$myTestName.unx.out") if (unixOut.exists()) { outFile = unixOut } @@ -70,8 +73,7 @@ internal class KotlinOutputChecker( if (!outFile.exists()) { FileUtil.writeToFile(outFile, actual) LOG.error("Test file created ${outFile.path}\n**************** Don't forget to put it into VCS! *******************") - } - else { + } else { val originalText = FileUtilRt.loadFile(outFile, CharsetToolkit.UTF8) val expected = StringUtilRt.convertLineSeparators(originalText) if (expected != actual) { @@ -86,8 +88,7 @@ internal class KotlinOutputChecker( } if (expected.length > len) { println("Rest from expected text is: \"" + expected.substring(len) + "\"") - } - else if (actual.length > len) { + } else if (actual.length > len) { println("Rest from actual text is: \"" + actual.substring(len) + "\"") } @@ -108,7 +109,9 @@ internal class KotlinOutputChecker( val disconnectedIndex = lines.indexOfFirst { it.startsWith(DISCONNECT_PREFIX) } lines[disconnectedIndex] = DISCONNECT_PREFIX - return lines.filter { !(it.matches(JDI_BUG_OUTPUT_PATTERN_1) || it.matches(JDI_BUG_OUTPUT_PATTERN_2)) }.joinToString("\n") + return lines.filter { !(it.matches(JDI_BUG_OUTPUT_PATTERN_1) || it.matches( + JDI_BUG_OUTPUT_PATTERN_2 + )) }.joinToString("\n") } private fun buildOutputString(): String { @@ -119,8 +122,7 @@ internal class KotlinOutputChecker( try { m.isAccessible = true return m.invoke(this) as String - } - finally { + } finally { m.isAccessible = isAccessible } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/LogPropagator.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/LogPropagator.kt new file mode 100644 index 00000000000..ae05ebbf28c --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/LogPropagator.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.util + +import org.apache.log4j.AppenderSkeleton +import org.apache.log4j.Level +import org.apache.log4j.Logger +import org.apache.log4j.spi.LoggingEvent +import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerCaches + +internal class LogPropagator(val systemLogger: (String) -> Unit) { + private var oldLogLevel: Level? = null + private val logger = Logger.getLogger(KotlinDebuggerCaches::class.java) + private var appender: AppenderSkeleton? = null + + fun attach() { + oldLogLevel = logger.level + logger.level = Level.DEBUG + + appender = object : AppenderSkeleton() { + override fun append(event: LoggingEvent?) { + val message = event?.renderedMessage + if (message != null) { + systemLogger(message) + } + } + + override fun close() {} + override fun requiresLayout() = false + } + + logger.addAppender(appender) + } + + fun detach() { + logger.removeAppender(appender) + appender = null + + logger.level = oldLogLevel + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/SteppingInstruction.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/SteppingInstruction.kt new file mode 100644 index 00000000000..6470e69adef --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/SteppingInstruction.kt @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.test.util + +import org.jetbrains.kotlin.codegen.CodegenTestCase + +enum class SteppingInstructionKind(val directiveName: String) { + StepInto("STEP_INTO"), + StepOut("STEP_OUT"), + StepOver("STEP_OVER"), + ForceStepOver("STEP_OVER_FORCE"), + SmartStepInto("SMART_STEP_INTO"), + SmartStepIntoByIndex("SMART_STEP_INTO_BY_INDEX"), + Resume("RESUME") +} + +class SteppingInstruction(val kind: SteppingInstructionKind, val arg: Int) { + companion object { + fun parse(file: CodegenTestCase.TestFile): List { + return parse(file, Companion::parseLine) + } + + fun parseSingle(file: CodegenTestCase.TestFile, kind: SteppingInstructionKind): SteppingInstruction? { + val instructions = parse(file) { line -> parseKind(line, kind) } + if (instructions.size > 1) { + error("Several instructions found for kind $kind") + } + + return instructions.singleOrNull() + } + + private fun parse(file: CodegenTestCase.TestFile, processor: (String) -> SteppingInstruction?): List { + return file.content.lineSequence() + .map { it.trimStart() } + .filter { it.startsWith("// ") } + .mapNotNullTo(mutableListOf(), processor) + } + + private fun parseLine(line: String): SteppingInstruction? { + for (kind in SteppingInstructionKind.values()) { + parseKind(line, kind)?.let { return it } + } + + return null + } + + private fun parseKind(line: String, kind: SteppingInstructionKind): SteppingInstruction? { + val prefix = "// " + kind.directiveName + ": " + if (line.startsWith(prefix)) { + val rawValue = line.drop(prefix.length).trim() + val n = rawValue.toIntOrNull() ?: error("Int expected, got $rawValue") + return SteppingInstruction(kind, n) + } + + return null + } + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/dexLikeBytecodePatch.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/dexLikeBytecodePatch.kt similarity index 67% rename from idea/tests/org/jetbrains/kotlin/idea/debugger/dexLikeBytecodePatch.kt rename to idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/dexLikeBytecodePatch.kt index de781c76dcd..e20d9d50c4f 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/dexLikeBytecodePatch.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/util/dexLikeBytecodePatch.kt @@ -3,34 +3,27 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.idea.debugger +package org.jetbrains.kotlin.idea.debugger.test.util import org.jetbrains.org.objectweb.asm.* import java.io.File import java.util.* -val DEX_BEFORE_PATCH_EXTENSION = "before_dex" - -fun String.needDexPatch() = split('.').any { it.endsWith("Dex") } - -fun patchDexTests(dir: File) { - dir.listFiles { file -> file.isDirectory && file.name.needDexPatch() }.forEach { - it.listFiles { testOutputFile -> testOutputFile.extension == "class" }.forEach(::applyDexLikePatch) - } +fun patchDexTests(classesDir: File) { + classesDir.walk() + .filter { it.isFile && it.nameWithoutExtension.endsWith("Dex") && it.extension == "class" } + .forEach(::applyDexLikePatch) } private fun applyDexLikePatch(file: File) { - file.copyTo(File(file.absolutePath + ".$DEX_BEFORE_PATCH_EXTENSION")) - val reader = ClassReader(file.readBytes()) val writer = ClassWriter(ClassWriter.COMPUTE_FRAMES) val visitor = writer - .withRemoveSourceDebugExtensionVisitor() - .withRemoveSameLinesInLineTableVisitor() + .withRemoveSourceDebugExtensionVisitor() + .withRemoveSameLinesInLineTableVisitor() reader.accept(visitor, 0) - file.writeBytes(writer.toByteArray()) } @@ -44,7 +37,13 @@ private fun ClassVisitor.withRemoveSourceDebugExtensionVisitor(): ClassVisitor { private fun ClassVisitor.withRemoveSameLinesInLineTableVisitor(): ClassVisitor { return object : ClassVisitor(Opcodes.API_VERSION, this) { - override fun visitMethod(access: Int, name: String?, desc: String?, signature: String?, exceptions: Array?): MethodVisitor? { + override fun visitMethod( + access: Int, + name: String?, + desc: String?, + signature: String?, + exceptions: Array? + ): MethodVisitor? { val methodVisitor = super.visitMethod(access, name, desc, signature, exceptions) ?: return null return object : MethodVisitor(Opcodes.API_VERSION, methodVisitor) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.kt index c7a47edfa41..6d115df1d19 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.kt @@ -1,3 +1,4 @@ +// FILE: text.kt package isInsideInlineLambda fun main(args: Array) { @@ -73,3 +74,46 @@ class A { // ADDITIONAL_BREAKPOINT: isInsideInlineLambdaInLibrary.kt:Breakpoint5:(1) // EXPRESSION: it + 15 // RESULT: 20: I + +// FILE: isInsideInlineLambdaInLibrary.kt +package isInsideInlineLambdaInLibrary + +public fun test() { + val a = A() + //Breakpoint1 + a.foo(1) { 1 } + + // inside other lambda + a.foo(100) { + //Breakpoint2 + a.foo(2) { 1 } + 1 + } + + // inside variable declaration + //Breakpoint3 + val x = a.foo(3) { 1 } + + // inside object declaration + val y = object { + fun foo() { + //Breakpoint4 + a.foo(4) { 1 } + } + } + y.foo() + + // inside local function + fun local() { + //Breakpoint5 + a.foo(5) { 1 } + } + local() +} + +class A { + inline fun foo(i: Int, f: (i: Int) -> Int): A { + f(i) + return this + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.out index 37ff1025589..e04be351a23 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/isInsideInlineLambda.out @@ -1,34 +1,34 @@ -LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:6 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:11 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:17 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:23 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:31 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambda.kt:9 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambda.kt:17 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambda.kt:25 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambda.kt:33 lambdaOrdinal = 1 -LineBreakpoint created at isInsideInlineLambda.kt:43 lambdaOrdinal = 1 +LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:7 lambdaOrdinal = 1 +LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:12 lambdaOrdinal = 1 +LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:18 lambdaOrdinal = 1 +LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:24 lambdaOrdinal = 1 +LineBreakpoint created at isInsideInlineLambdaInLibrary.kt:32 lambdaOrdinal = 1 +LineBreakpoint created at text.kt:10 lambdaOrdinal = 1 +LineBreakpoint created at text.kt:18 lambdaOrdinal = 1 +LineBreakpoint created at text.kt:26 lambdaOrdinal = 1 +LineBreakpoint created at text.kt:34 lambdaOrdinal = 1 +LineBreakpoint created at text.kt:44 lambdaOrdinal = 1 Run Java Connected to the target VM -isInsideInlineLambda.kt:9 +text.kt:10 Compile bytecode for it + 1 -isInsideInlineLambda.kt:17 +text.kt:18 Compile bytecode for it + 2 -isInsideInlineLambda.kt:25 +text.kt:26 Compile bytecode for it + 3 -isInsideInlineLambda.kt:33 +text.kt:34 Compile bytecode for it + 4 -isInsideInlineLambda.kt:43 +text.kt:44 Compile bytecode for it + 5 -isInsideInlineLambdaInLibrary.kt:6 +isInsideInlineLambdaInLibrary.kt:7 Compile bytecode for it + 11 -isInsideInlineLambdaInLibrary.kt:11 +isInsideInlineLambdaInLibrary.kt:12 Compile bytecode for it + 12 -isInsideInlineLambdaInLibrary.kt:17 +isInsideInlineLambdaInLibrary.kt:18 Compile bytecode for it + 13 -isInsideInlineLambdaInLibrary.kt:23 +isInsideInlineLambdaInLibrary.kt:24 Compile bytecode for it + 14 -isInsideInlineLambdaInLibrary.kt:31 +isInsideInlineLambdaInLibrary.kt:32 Compile bytecode for it + 15 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.kt index 3b5ec0a8860..f3c9cd80377 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.kt @@ -1,3 +1,4 @@ +// FILE: customLibClassName.kt package customLibClassName fun main(args: Array) { @@ -26,4 +27,87 @@ fun main(args: Array) { // ADDITIONAL_BREAKPOINT: simpleLibFile.kt:public fun foo() { // EXPRESSION: 1 + 5 -// RESULT: 6: I \ No newline at end of file +// RESULT: 6: I + +// FILE: lib/oneFunSameClassName/1/a1.kt +@file:JvmName("SameNameOneFunSameFileName") +@file:JvmMultifileClass +package customLib.oneFunSameClassName + +public fun oneFunSameFileNameFun(): Int { + return 1 +} + +// FILE: lib/oneFunSameClassName/2/a2.kt +@file:JvmName("SameNameOneFunSameFileName") +@file:JvmMultifileClass +package customLib.oneFunSameClassName + +public fun oneFunSameFileNameFun2(): Int { + return 1 +} + +// FILE: lib/twoFunDifferentSignature/1/a1.kt +@file:JvmName("SameNameTwoFunDifferentSignature") +@file:JvmMultifileClass +package customLib.twoFunDifferentSignature + +public fun twoFunDifferentSignatureFun(): Int { + return 1 +} + +// FILE: lib/twoFunDifferentSignature/2/a2.kt +@file:JvmName("SameNameTwoFunDifferentSignature") +@file:JvmMultifileClass +package customLib.twoFunDifferentSignature + +public fun twoFunDifferentSignatureFun(i: Int): Int { + return 1 +} + +// FILE: lib/breakpointOnLocalProperty/1/a1.kt +@file:JvmName("SameNameBreakpointOnLocalProperty") +@file:JvmMultifileClass +package customLib.breakpointOnLocalProperty + +public fun breakpointOnLocalPropertyFun(): Int { + val a = 1 + return 1 +} + +// FILE: lib/breakpointOnLocalProperty/2/a2.kt +@file:JvmName("SameNameBreakpointOnLocalProperty") +@file:JvmMultifileClass +package customLib.breakpointOnLocalProperty + +public fun breakpointOnLocalPropertyFun2(): Int { + return 1 +} + +// FILE: lib/property/1/a1.kt +@file:JvmName("SameNameProperty") +@file:JvmMultifileClass +package customLib.property + +public val foo: Int = + 1 + +// FILE: lib/property/2/a2.kt +@file:JvmName("SameNameProperty") +@file:JvmMultifileClass +package customLib.property + +public fun someFun(): Int { + return 1 +} + +// FILE: lib/simpleLibFile/simpleLibFile.kt +package customLib.simpleLibFile + +public fun foo() { + 1 + 1 +} + +class B { + public var prop: Int = 1 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.out index 64a6003bc65..8c5cf5808da 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/customLibClassName.out @@ -1,19 +1,19 @@ -LineBreakpoint created at a1.kt:6 -LineBreakpoint created at a1.kt:6 -LineBreakpoint created at a1.kt:6 -LineBreakpoint created at a1.kt:6 -LineBreakpoint created at simpleLibFile.kt:4 +LineBreakpoint created at a1.kt:7 +LineBreakpoint created at a1.kt:7 +LineBreakpoint created at a1.kt:7 +LineBreakpoint created at a1.kt:7 +LineBreakpoint created at simpleLibFile.kt:5 Run Java Connected to the target VM -a1.kt:6 +a1.kt:7 Compile bytecode for 1 + 1 -a1.kt:6 +a1.kt:7 Compile bytecode for 1 + 2 -a1.kt:6 +a1.kt:7 Compile bytecode for 1 + 3 -a1.kt:6 +a1.kt:7 Compile bytecode for 1 + 4 -simpleLibFile.kt:4 +simpleLibFile.kt:5 Compile bytecode for 1 + 5 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.kt index c5e5b3838ed..50162588180 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.kt @@ -1,3 +1,4 @@ +// FILE: test.kt package localFunInLibrary fun main(args: Array) { @@ -6,4 +7,12 @@ fun main(args: Array) { // ADDITIONAL_BREAKPOINT: localFunCustomLib.kt:localFunInLibraryCustomLibProperty // EXPRESSION: localFun() -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: localFunCustomLib.kt +package customLib.localFunInLibraryCustomLib + +public fun localFunInLibraryCustomLibMainFun() { + fun localFun() = 1 + val localFunInLibraryCustomLibProperty = 1 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.out index 5418a959332..5907dff2403 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/multipleBreakpoints/library/localFunInLibrary.out @@ -1,7 +1,7 @@ -LineBreakpoint created at localFunCustomLib.kt:6 +LineBreakpoint created at localFunCustomLib.kt:7 Run Java Connected to the target VM -localFunCustomLib.kt:6 +localFunCustomLib.kt:7 Compile bytecode for localFun() Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.kt index 348c5891042..f253ed1f376 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.kt @@ -1,3 +1,4 @@ +// FILE: breakpointInInlineFun.kt package breakpointInInlineFun import customLib.inlineFunInLibrary.* @@ -9,4 +10,19 @@ fun main(args: Array) { // RESUME: 2 // ADDITIONAL_BREAKPOINT: inlineFunInLibrary.kt:public inline fun inlineFun -// ADDITIONAL_BREAKPOINT: inlineFunInLibrary.kt: Breakpoint 2 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: inlineFunInLibrary.kt: Breakpoint 2 + +// FILE: customLib/inlineFunInLibrary/inlineFunInLibrary.kt +package customLib.inlineFunInLibrary + +public inline fun inlineFun(f: () -> Unit) { + 1 + 1 + inlineFunInner { + 1 + 1 + } +} + +public inline fun inlineFunInner(f: () -> Unit) { + // Breakpoint 2 + 1 + 1 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.out index ac64e84f497..09f7213459a 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/breakpointInInlineFun.out @@ -1,9 +1,9 @@ -LineBreakpoint created at inlineFunInLibrary.kt:4 -LineBreakpoint created at inlineFunInLibrary.kt:12 +LineBreakpoint created at inlineFunInLibrary.kt:5 +LineBreakpoint created at inlineFunInLibrary.kt:13 Run Java Connected to the target VM -inlineFunInLibrary.kt:4 -inlineFunInLibrary.kt:12 +inlineFunInLibrary.kt:5 +inlineFunInLibrary.kt:13 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.kt index b94f5b8da9e..4ae4c17ba66 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.kt @@ -1,3 +1,4 @@ +// FILE: classFromAnotherPackage.kt package classFromAnotherPackage import forTests.MyJavaClass @@ -12,3 +13,7 @@ fun main(args: Array) { // EXPRESSION: forTests.MyJavaClass() // RESULT: instance of forTests.MyJavaClass(id=ID): LforTests/MyJavaClass; + +// FILE: forTests/MyJavaClass.java +package forTests; +public class MyJavaClass {} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.out index 07977b5c426..af530bb6ffc 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/classFromAnotherPackage.out @@ -1,7 +1,7 @@ -LineBreakpoint created at classFromAnotherPackage.kt:7 +LineBreakpoint created at classFromAnotherPackage.kt:8 Run Java Connected to the target VM -classFromAnotherPackage.kt:7 +classFromAnotherPackage.kt:8 Compile bytecode for MyJavaClass() Compile bytecode for forTests.MyJavaClass() Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.kt index dcb7e747f6b..135e0d0bd02 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.kt @@ -1,3 +1,4 @@ +// FILE: createExpressionWithArray.kt package createExpressionWithArray import forTests.MyJavaClass @@ -13,3 +14,28 @@ fun main(args: Array) { // PRINT_FRAME // DESCRIPTOR_VIEW_OPTIONS: NAME_EXPRESSION_RESULT + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; +import java.util.List; + +public class MyJavaClass { + public static class BaseClass { + public final int i2 = 1; + } + + public BaseClass getBaseClassValue() { + return new BaseClass(); + } + public BaseClass getInnerClassValue() { + return new InnerClass(); + } + + public static class InnerClass extends BaseClass { + public final int i = 1; + } + + public MyJavaClass() {} +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.out index 421c609be92..24e48c8c688 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/createExpression/createExpressionWithArray.out @@ -1,7 +1,7 @@ -LineBreakpoint created at createExpressionWithArray.kt:11 +LineBreakpoint created at createExpressionWithArray.kt:12 Run Java Connected to the target VM -createExpressionWithArray.kt:11 +createExpressionWithArray.kt:12 Compile bytecode for args Compile bytecode for baseArray Compile bytecode for baseArray[0] diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.kt index e623ca99a63..324a62d0df8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.kt @@ -1,3 +1,4 @@ +// FILE: delegatedPropertyInOtherFile.kt package delegatedPropertyInOtherFile import delegatedPropertyInOtherFileOther.* @@ -11,3 +12,16 @@ fun main(a: Array) { // EXPRESSION: t.a // RESULT: 12: I + +// FILE: delegatedPropertyInOtherFile/delegatedPropertyInOtherFile2.kt +package delegatedPropertyInOtherFileOther + +import kotlin.reflect.KProperty + +class WithDelegate { + val a: Int by Id(12) +} + +class Id(val v: Int) { + operator fun getValue(o: Any, property: KProperty<*>): Int = v +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.out index 124bc04a986..2d5a6033803 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/delegatedPropertyInOtherFile.out @@ -1,7 +1,7 @@ -LineBreakpoint created at delegatedPropertyInOtherFile.kt:9 +LineBreakpoint created at delegatedPropertyInOtherFile.kt:10 Run Java Connected to the target VM -delegatedPropertyInOtherFile.kt:9 +delegatedPropertyInOtherFile.kt:10 Compile bytecode for t.a Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDelegatedProperty.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDelegatedProperty.out index a73f36cb175..6b17b0ddcee 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDelegatedProperty.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/extraVariables/evDelegatedProperty.out @@ -2,7 +2,6 @@ LineBreakpoint created at evDelegatedProperty.kt:13 Run Java Connected to the target VM evDelegatedProperty.kt:13 -Compile bytecode for a.prop frame = main:13, EvDelegatedPropertyKt {evDelegatedProperty} local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDelegatedProperty.kt, 9) local = a: evDelegatedProperty.A = {evDelegatedProperty.A@uniqueID} (sp = evDelegatedProperty.kt, 10) diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.kt index e1fc96a426c..2e3bd99b37b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.kt @@ -1,3 +1,4 @@ +// FILE: fieldGetters.kt package fieldGetters import forTests.FieldsGetters @@ -30,8 +31,6 @@ class K2 { // EXPRESSION: K2().a_field // RESULT: 0: I - - // EXPRESSION: PublicField().foo // RESULT: "a": Ljava/lang/String; @@ -102,4 +101,82 @@ class K2 { // RESULT: "a": Ljava/lang/String; // EXPRESSION: PublicFieldAndGetterInParent().foo_field -// RESULT: "b": Ljava/lang/String; \ No newline at end of file +// RESULT: "b": Ljava/lang/String; + +// FILE: forTests/FieldsGetters.java +package forTests; + +public class FieldsGetters { + public static class PublicField { + public String foo = "a"; + } + + public static class PackagePrivateField { + String foo = "b"; + } + + public static class ProtectedField { + protected String foo = "c"; + } + + public static class PrivateField { + private String foo = "d"; + } + + public static class PublicFieldGetter { + public final String foo = "a"; + + public String getFoo() { + return "b"; + } + } + + public static class PrivateFieldPublicGetter { + private final String foo = "c"; + + public String getFoo() { + return "d"; + } + } + + public static class PrivateFieldPrivateGetter { + private final String foo = "e"; + + public String getFoo() { + return "f"; + } + } + + public static class PublicGetter1 extends PublicField { + public String getFoo() { + return "g"; + } + } + + public static class PublicGetter2 extends PackagePrivateField { + public String getFoo() { + return "h"; + } + } + + public static class PrivateGetter1 extends PrivateField { + private String getFoo() { + return "g"; + } + } + + public static class PublicGetterOnly { + public String getFoo() { + return "a"; + } + } + + public static class PublicFieldAndGetterInParent extends PublicGetterOnly { + public String foo = "b"; + } + + public abstract class AbstractGetter { + public String foo = "c"; + public abstract String getFoo(); + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.out index 1b1d96df347..acf29dcca3d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fieldGetters.out @@ -1,7 +1,7 @@ -LineBreakpoint created at fieldGetters.kt:8 +LineBreakpoint created at fieldGetters.kt:9 Run Java Connected to the target VM -fieldGetters.kt:8 +fieldGetters.kt:9 Compile bytecode for K1().a Compile bytecode for K1().a_field Compile bytecode for K2().a diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.kt index 52a3370def7..63fe56a2855 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.kt @@ -1,3 +1,4 @@ +// FILE: fileWithError.kt package fileWithError fun main(args: Array) { @@ -8,4 +9,17 @@ fun main(args: Array) { // ADDITIONAL_BREAKPOINT: fileWithInternal.kt:Breakpoint // EXPRESSION: 1 -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: lib/fileWithInternal.kt +package fileWithInternal + +fun test() { + // Breakpoint + val a = fileWithInternal2.MyInternal() +} + +// FILE: lib/fileWithInternal2.kt +package fileWithInternal2 + +internal class MyInternal \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.out index 6719c130808..ce3ffabd181 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/fileWithError.out @@ -1,7 +1,7 @@ -LineBreakpoint created at fileWithInternal.kt:5 +LineBreakpoint created at fileWithInternal.kt:6 Run Java Connected to the target VM -fileWithInternal.kt:5 +fileWithInternal.kt:6 Compile bytecode for 1 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.kt index c05f14cbd35..c4859e97cff 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.kt @@ -1,3 +1,4 @@ +// FILE: inlineFunInMultiFilePackage.kt package inlineFunInMultiFilePackage fun main(args: Array) { @@ -8,3 +9,9 @@ fun main(args: Array) { // EXPRESSION: multiFilePackage.foo { 1 } // RESULT: 1: I +// FILE: multiFilePackage.kt +@file:JvmMultifileClass +@file:JvmName("NewName") +package multiFilePackage + +inline fun foo(f: () -> Int) = f() \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.out index e3b16a3d8ab..51a29743f4c 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunInMultiFilePackage.out @@ -1,7 +1,7 @@ -LineBreakpoint created at inlineFunInMultiFilePackage.kt:5 +LineBreakpoint created at inlineFunInMultiFilePackage.kt:6 Run Java Connected to the target VM -inlineFunInMultiFilePackage.kt:5 +inlineFunInMultiFilePackage.kt:6 Compile bytecode for multiFilePackage.foo { 1 } Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.kt index d436f68ca20..ed69becdc67 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.kt @@ -1,3 +1,4 @@ +// FILE: inlineFunction.kt package inlineFunction import inlineFunctionOtherPackage.* @@ -13,4 +14,14 @@ inline fun foo() = 1 // RESULT: 1: I // EXPRESSION: foo() -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: lib.kt +package inlineFunctionOtherPackage + +inline fun myFun(f: () -> Int): Int = f() + +val String.prop: String + get() { + return "a" + } \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.out index 6814059eaef..783076b57d1 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunction.out @@ -1,7 +1,7 @@ -LineBreakpoint created at inlineFunction.kt:7 +LineBreakpoint created at inlineFunction.kt:8 Run Java Connected to the target VM -inlineFunction.kt:7 +inlineFunction.kt:8 Compile bytecode for myFun { 1 } Compile bytecode for foo() Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt index b7e14820c2e..3736f84a0bf 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.kt @@ -1,3 +1,4 @@ +// FILE: test.kt package inlineFunctionBreakpointAnotherFile fun main(args: Array) { @@ -10,4 +11,11 @@ fun main(args: Array) { } } -// ADDITIONAL_BREAKPOINT: inlineFunctionWithBreakpoint.kt:inline fun myFun \ No newline at end of file +// ADDITIONAL_BREAKPOINT: inlineFunctionWithBreakpoint.kt:inline fun myFun + +// FILE: inlineFunctionWithBreakpoint.kt +package inlineFunctionWithBreakpoint + +inline fun myFun(f: (Int) -> Unit) { + f(1) +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.out index c062e25fd8a..4f6361c5758 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/inlineFunctionBreakpointAnotherFile.out @@ -1,7 +1,7 @@ -LineBreakpoint created at inlineFunctionWithBreakpoint.kt:4 +LineBreakpoint created at inlineFunctionWithBreakpoint.kt:5 Run Java Connected to the target VM -inlineFunctionWithBreakpoint.kt:4 +inlineFunctionWithBreakpoint.kt:5 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.kt index 7419cf1a626..59df845dddb 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.kt @@ -1,3 +1,4 @@ +// FILE: jcBlock.kt package jcBlock fun main(args: Array) { @@ -16,4 +17,20 @@ fun main(args: Array) { // RESULT: 1: I // EXPRESSION: elseVal -// RESULT: Unresolved reference: elseVal \ No newline at end of file +// RESULT: Unresolved reference: elseVal + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public void block() { + int bodyVal = 1; + if (true) { + int thenVal = 1; + int breakpoint = 1; + } + else { + int elseVal = 1; + } + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.out index 670b5ffa537..f74cd5d872a 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcBlock.out @@ -1,10 +1,10 @@ -LineBreakpoint created at jcBlock.kt:6 +LineBreakpoint created at jcBlock.kt:7 Run Java Connected to the target VM -jcBlock.kt:6 -JavaClass.java:16 -JavaClass.java:18 -JavaClass.java:19 +jcBlock.kt:7 +JavaClass.java:6 +JavaClass.java:8 +JavaClass.java:9 Compile bytecode for bodyVal Compile bytecode for thenVal Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.kt index 926cdfdb2b3..48a1626866e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.kt @@ -1,3 +1,4 @@ +// FILE: jcImports.kt package jcImports fun main(args: Array) { @@ -10,4 +11,23 @@ fun main(args: Array) { // STEP_OVER: 1 // EXPRESSION: list.filter { it == 1 }.size -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +import java.util.ArrayList; + +public class JavaClass { + public void imports() { + ArrayList list = createList(); + int breakpoint = 1; + } + + private ArrayList createList() { + ArrayList list = new ArrayList(); + list.add(1); + list.add(2); + return list; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.out index b255f355174..a5b8bc9a466 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcImports.out @@ -1,9 +1,9 @@ -LineBreakpoint created at jcImports.kt:6 +LineBreakpoint created at jcImports.kt:7 Run Java Connected to the target VM -jcImports.kt:6 -JavaClass.java:27 -JavaClass.java:28 +jcImports.kt:7 +JavaClass.java:8 +JavaClass.java:9 Compile bytecode for list.filter { it == 1 }.size Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.kt index 40281433261..b3cdc3ec956 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.kt @@ -1,3 +1,4 @@ +// FILE: jcLocalVariable.kt package jcLocalVariable fun main(args: Array) { @@ -10,4 +11,14 @@ fun main(args: Array) { // STEP_OVER: 1 // EXPRESSION: i -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public void localVariable() { + int i = 1; + int breakpoint = 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.out index 205e29d95d2..85ee1a94c33 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcLocalVariable.out @@ -1,9 +1,9 @@ -LineBreakpoint created at jcLocalVariable.kt:6 +LineBreakpoint created at jcLocalVariable.kt:7 Run Java Connected to the target VM -jcLocalVariable.kt:6 -JavaClass.java:11 -JavaClass.java:12 +jcLocalVariable.kt:7 +JavaClass.java:6 +JavaClass.java:7 Compile bytecode for i Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.kt index f8d9aeb7228..136c4299018 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.kt @@ -1,3 +1,4 @@ +// FILE: test.kt package jcMarkedObject fun main(args: Array) { @@ -15,4 +16,14 @@ fun main(args: Array) { // EXPRESSION: i_DebugLabel // RESULT: instance of java.lang.Integer(id=ID): Ljava/lang/Integer; -// DEBUG_LABEL: i = i \ No newline at end of file +// DEBUG_LABEL: i = i + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public void markObject() { + Integer i = 1; + int breakpoint = 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.out index e7e1adcaf75..1fdb5e045f2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcMarkedObject.out @@ -1,9 +1,9 @@ -LineBreakpoint created at jcMarkedObject.kt:6 +LineBreakpoint created at test.kt:7 Run Java Connected to the target VM -jcMarkedObject.kt:6 -JavaClass.java:39 -JavaClass.java:40 +test.kt:7 +JavaClass.java:6 +JavaClass.java:7 Compile bytecode for i Compile bytecode for i_DebugLabel Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.kt index 973f36cdaaa..7e35ffb8058 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.kt @@ -1,3 +1,4 @@ +// FILE: test.kt package jcProperty fun main(args: Array) { @@ -15,4 +16,16 @@ fun main(args: Array) { // RESULT: 1: I // EXPRESSION: javaPrivateProperty -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public int javaProperty = 1; + private int javaPrivateProperty = 1; + + public void property() { + int breakpoint = 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.out index 1f902cc7b49..3a284888126 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcProperty.out @@ -1,8 +1,8 @@ -LineBreakpoint created at jcProperty.kt:6 +LineBreakpoint created at test.kt:7 Run Java Connected to the target VM -jcProperty.kt:6 -JavaClass.java:47 +test.kt:7 +JavaClass.java:9 Compile bytecode for this.javaProperty Compile bytecode for javaProperty Compile bytecode for javaPrivateProperty diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.kt index 9ada270154d..f994953a1f1 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.kt @@ -1,3 +1,4 @@ +// FILE: jcSimple.kt package jcSimple fun main(args: Array) { @@ -9,4 +10,13 @@ fun main(args: Array) { // STEP_INTO: 1 // EXPRESSION: 1 + 1 -// RESULT: 2: I \ No newline at end of file +// RESULT: 2: I + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public void simple() { + int breakpoint = 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.out index a97015b25b3..7a640bfd278 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaContext/jcSimple.out @@ -1,8 +1,8 @@ -LineBreakpoint created at jcSimple.kt:6 +LineBreakpoint created at jcSimple.kt:7 Run Java Connected to the target VM -jcSimple.kt:6 -JavaClass.java:7 +jcSimple.kt:7 +JavaClass.java:6 Compile bytecode for 1 + 1 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.kt index aace99113b0..8c54afe6930 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.kt @@ -1,3 +1,4 @@ +// FILE: javaStaticMethods.kt package javaStaticMethods import forTests.javaContext.JavaClass.JavaStatic @@ -9,3 +10,12 @@ fun main() { // EXPRESSION: JavaStatic.state() // RESULT: 1: I + +// FILE: forTests/javaContext/JavaClass.java +package forTests.javaContext; + +public class JavaClass { + public interface JavaStatic { + static int state() { return 1; } + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.out index dc31802b5ad..3c184956fe4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/javaStaticMethods.out @@ -1,7 +1,7 @@ -LineBreakpoint created at javaStaticMethods.kt:7 +LineBreakpoint created at javaStaticMethods.kt:8 Run Java Connected to the target VM -javaStaticMethods.kt:7 +javaStaticMethods.kt:8 Compile bytecode for JavaStatic.state() Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.kt index da810adce5e..b2dc520e52e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.kt @@ -1,3 +1,4 @@ +// FILE: privateClass.kt package privateClass fun main(args: Array) { @@ -32,3 +33,15 @@ class A { // EXPRESSION: forTests.MyJavaClass.PrivateJavaClass().prop // RESULT: 1: I + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; +import java.util.List; + +public class MyJavaClass { + private static class PrivateJavaClass { + public final int prop = 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.out index 747851f438c..f025d6cbe48 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/privateClass.out @@ -1,7 +1,7 @@ -LineBreakpoint created at privateClass.kt:5 +LineBreakpoint created at privateClass.kt:6 Run Java Connected to the target VM -privateClass.kt:5 +privateClass.kt:6 Compile bytecode for A.PrivateClass() Compile bytecode for A.PrivateClass().prop Compile bytecode for A().PrivateInnerClass() diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.kt b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.kt index 86986bb30f9..4dc988084f6 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.kt @@ -1,3 +1,4 @@ +// FILE: rawTypeskt11831.kt package rawTypeskt11831 fun main(args: Array) { @@ -8,4 +9,22 @@ fun main(args: Array) { } // EXPRESSION: foo -// RESULT: 1: I \ No newline at end of file +// RESULT: 1: I + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; +import java.util.List; + +public class MyJavaClass { + public static class RawA { + public int foo(List p) { + return 1; + } + } + + public static class RawADerived extends RawA { + + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.out b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.out index 00e7cf052e0..97c45987fe9 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/evaluation/singleBreakpoint/rawTypeskt11831.out @@ -1,7 +1,7 @@ -LineBreakpoint created at rawTypeskt11831.kt:7 +LineBreakpoint created at rawTypeskt11831.kt:8 Run Java Connected to the target VM -rawTypeskt11831.kt:7 +rawTypeskt11831.kt:8 Compile bytecode for foo Disconnected from the target VM diff --git a/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt b/idea/jvm-debugger/jvm-debugger-test/testData/lib/coroutines/coroutines.kt similarity index 90% rename from idea/testData/debugger/tinyApp/src/forTests/coroutines.kt rename to idea/jvm-debugger/jvm-debugger-test/testData/lib/coroutines/coroutines.kt index 7353683583d..7693a53b46a 100644 --- a/idea/testData/debugger/tinyApp/src/forTests/coroutines.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/lib/coroutines/coroutines.kt @@ -18,8 +18,8 @@ fun builder(c: suspend () -> Unit) { } class WaitFinish( - private val timeout: Long = 5, - private val unit: TimeUnit = TimeUnit.SECONDS + private val timeout: Long = 5, + private val unit: TimeUnit = TimeUnit.SECONDS ) { private val cdl = CountDownLatch(1) diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedByDescending.kt b/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedByDescending.kt index d31a9fd51a1..8b94baee3e9 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedByDescending.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedByDescending.kt @@ -3,4 +3,6 @@ package streams.sequence.sort fun main(args: Array) { //Breakpoint! arrayOf(Person("Bob", 42), Person("Alice", 27)).asSequence().sortedByDescending { it.age }.count() -} \ No newline at end of file +} + +data class Person(val name: String, val age: Int) \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedWith.kt b/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedWith.kt index c4139563760..815b2d738ba 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedWith.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/sequence/streams/sequence/sort/SortedWith.kt @@ -4,4 +4,6 @@ fun main(args: Array) { //Breakpoint! arrayOf(Person("Bob", 42), Person("Alice", 27)).asSequence() .sortedWith(compareBy { it.name }).count() -} \ No newline at end of file +} + +data class Person(val name: String, val age: Int) \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.kt index 595693d7ffb..5ae30dd224b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package coroutine import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.out index 6842f7ca747..9f9a0963e9f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/coroutine.out @@ -1,9 +1,9 @@ -LineBreakpoint created at coroutine.kt:15 +LineBreakpoint created at coroutine.kt:17 Run Java Connected to the target VM -coroutine.kt:15 -coroutine.kt:15 -coroutine.kt:16 +coroutine.kt:17 +coroutine.kt:17 +coroutine.kt:18 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.kt index a545a7abce7..4654836f1d4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.kt @@ -1,3 +1,6 @@ +// FILE: inlineInObjectSameFileDex.kt +// EMULATE_DEX: true + package inlineInObjectSameFileDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.out index 6740d5df2fd..3032b7aa8fd 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/inlineInObjectSameFileDex.out @@ -1,9 +1,9 @@ -LineBreakpoint created at inlineInObjectSameFileDex.kt:5 -LineBreakpoint created at inlineInObjectSameFileDex.kt:11 +LineBreakpoint created at inlineInObjectSameFileDex.kt:8 +LineBreakpoint created at inlineInObjectSameFileDex.kt:14 Run Java Connected to the target VM -inlineInObjectSameFileDex.kt:5 -inlineInObjectSameFileDex.kt:11 +inlineInObjectSameFileDex.kt:8 +inlineInObjectSameFileDex.kt:14 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.First.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.First.kt deleted file mode 100644 index 3e3d9acb9d3..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.First.kt +++ /dev/null @@ -1,6 +0,0 @@ -package manyFilesWithInlineCalls1Dex.first - -inline fun firstInline() { - // Breakpoint 1 - 1 + 1 -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.Second.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.Second.kt deleted file mode 100644 index 9eacabc91c4..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.Second.kt +++ /dev/null @@ -1,5 +0,0 @@ -package manyFilesWithInlineCalls1Dex.second - -inline fun secondInline() { - 1 + 1 -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.kt index 0960a6416ad..ed272033a77 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.kt @@ -1,3 +1,6 @@ +// EMULATE_DEX: true +// FILE: manyFilesWithInlineCalls1Dex.kt + package manyFilesWithInlineCalls1Dex import manyFilesWithInlineCalls1Dex.first.* @@ -11,4 +14,19 @@ fun unused() { secondInline() } -// ADDITIONAL_BREAKPOINT: manyFilesWithInlineCalls1Dex.First.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: manyFilesWithInlineCalls1Dex.First.kt: Breakpoint 1 + +// FILE: manyFilesWithInlineCalls1Dex.First.kt +package manyFilesWithInlineCalls1Dex.first + +inline fun firstInline() { + // Breakpoint 1 + 1 + 1 +} + +// FILE: manyFilesWithInlineCalls1Dex.Second.kt +package manyFilesWithInlineCalls1Dex.second + +inline fun secondInline() { + 1 + 1 +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.out index 1edc8ca929a..7003824e5ae 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls1Dex.out @@ -1,7 +1,7 @@ -LineBreakpoint created at manyFilesWithInlineCalls1Dex.First.kt:5 +LineBreakpoint created at manyFilesWithInlineCalls1Dex.First.kt:6 Run Java Connected to the target VM -manyFilesWithInlineCalls1Dex.First.kt:5 +manyFilesWithInlineCalls1Dex.First.kt:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.First.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.First.kt deleted file mode 100644 index 215b81afbbc..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.First.kt +++ /dev/null @@ -1,5 +0,0 @@ -package manyFilesWithInlineCalls2Dex.first - -inline fun firstInline() { - 1 + 1 -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.Second.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.Second.kt deleted file mode 100644 index b66b2ca19bb..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.Second.kt +++ /dev/null @@ -1,6 +0,0 @@ -package manyFilesWithInlineCalls2Dex.second - -inline fun secondInline() { - // Breakpoint 1 - 1 + 1 -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.kt index 061ca3ee9b2..08f299f548d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.kt @@ -1,3 +1,6 @@ +// EMULATE_DEX: true +// FILE: manyFilesWithInlineCalls2Dex.kt + package manyFilesWithInlineCalls2Dex import manyFilesWithInlineCalls2Dex.first.* @@ -11,4 +14,19 @@ fun unused() { firstInline() } -// ADDITIONAL_BREAKPOINT: manyFilesWithInlineCalls2Dex.Second.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: manyFilesWithInlineCalls2Dex.Second.kt: Breakpoint 1 + +// FILE: manyFilesWithInlineCalls2Dex.First.kt +package manyFilesWithInlineCalls2Dex.first + +inline fun firstInline() { + 1 + 1 +} + +// FILE: manyFilesWithInlineCalls2Dex.Second.kt +package manyFilesWithInlineCalls2Dex.second + +inline fun secondInline() { + // Breakpoint 1 + 1 + 1 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.out index 18207f05d15..58661c1ef7d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/manyFilesWithInlineCalls2Dex.out @@ -1,7 +1,7 @@ -LineBreakpoint created at manyFilesWithInlineCalls2Dex.Second.kt:5 +LineBreakpoint created at manyFilesWithInlineCalls2Dex.Second.kt:6 Run Java Connected to the target VM -manyFilesWithInlineCalls2Dex.Second.kt:5 +manyFilesWithInlineCalls2Dex.Second.kt:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.Other.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.Other.kt deleted file mode 100644 index 14bbf032e31..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.Other.kt +++ /dev/null @@ -1,8 +0,0 @@ -package severalInlineCallsFromOtherFileDex - -inline fun inlineFun() { - var i = 1 - // Breakpoint 1 - i++ - i++ -} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.kt index b50058b1c94..1d1747ce8d7 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.kt @@ -1,3 +1,6 @@ +// FILE: severalInlineCallsFromOtherFileDex.kt +// EMULATE_DEX: true + package severalInlineCallsFromOtherFileDex fun main(args: Array) { @@ -16,3 +19,13 @@ fun secondCall() { // RESUME: 2 // ADDITIONAL_BREAKPOINT: severalInlineCallsFromOtherFileDex.Other.kt: Breakpoint 1 + +// FILE: severalInlineCallsFromOtherFileDex.Other.kt +package severalInlineCallsFromOtherFileDex + +inline fun inlineFun() { + var i = 1 + // Breakpoint 1 + i++ + i++ +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.out index 5b4cf1c8875..361edbdbe5f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineCallsFromOtherFileDex.out @@ -1,10 +1,10 @@ -LineBreakpoint created at severalInlineCallsFromOtherFileDex.Other.kt:6 -LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:5 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.Other.kt:7 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:8 Run Java Connected to the target VM -severalInlineCallsFromOtherFileDex.kt:5 -severalInlineCallsFromOtherFileDex.Other.kt:6 -severalInlineCallsFromOtherFileDex.Other.kt:6 +severalInlineCallsFromOtherFileDex.kt:8 +severalInlineCallsFromOtherFileDex.Other.kt:7 +severalInlineCallsFromOtherFileDex.Other.kt:7 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.kt index afc16f87ff4..adab1de8a7d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.kt @@ -1,3 +1,6 @@ +// FILE: severalInlineCallsFromOtherFileDex.kt +// EMULATE_DEX: true + package severalInlineCallsFromOtherFileDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.out index 75665cb5f7d..b13fc57d167 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/severalInlineFunctionsInOneFileDex.out @@ -1,6 +1,23 @@ +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:8 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:26 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:32 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:37 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:44 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:49 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:56 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:63 +LineBreakpoint created at severalInlineCallsFromOtherFileDex.kt:69 Run Java Connected to the target VM +severalInlineCallsFromOtherFileDex.kt:8 +severalInlineCallsFromOtherFileDex.kt:26 +severalInlineCallsFromOtherFileDex.kt:32 +severalInlineCallsFromOtherFileDex.kt:44 +severalInlineCallsFromOtherFileDex.kt:69 +severalInlineCallsFromOtherFileDex.kt:37 +severalInlineCallsFromOtherFileDex.kt:49 +severalInlineCallsFromOtherFileDex.kt:56 +severalInlineCallsFromOtherFileDex.kt:63 Disconnected from the target VM -Process finished with exit code 1 -Error: Could not find or load main class severalInlineFunctionsInOneFileDex.SeveralInlineFunctionsInOneFileDexKt +Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/simpleConditionalBreakpoint.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/simpleConditionalBreakpoint.out index 3217787669a..45fa6924214 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/simpleConditionalBreakpoint.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/simpleConditionalBreakpoint.out @@ -1,6 +1,7 @@ LineBreakpoint created at simpleConditionalBreakpoint.kt:5 condition = 1 == 1 Run Java Connected to the target VM +Compile bytecode for 1 == 1 simpleConditionalBreakpoint.kt:5 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.kt index ecb5e562210..ccffea883ce 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.kt @@ -1,3 +1,4 @@ +// FILE: smartStepIntoInterfaceImpl.kt package smartStepIntoInterfaceImpl import forTests.MyJavaClass @@ -153,3 +154,16 @@ fun testStepInto() { //Breakpoint! Obj2.staticCallInOverride("a") } + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; +import java.util.List; + +public class MyJavaClass { + @NotNull + public static int staticFun(Object s) { + return 1; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.out index 9057a991f36..c749f52b074 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/smartStepIntoInterfaceImpl.out @@ -1,40 +1,40 @@ -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:90 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:95 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:100 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:105 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:110 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:120 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:125 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:130 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:138 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:143 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:148 -LineBreakpoint created at smartStepIntoInterfaceImpl.kt:154 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:91 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:96 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:101 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:106 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:111 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:121 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:126 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:131 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:139 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:144 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:149 +LineBreakpoint created at smartStepIntoInterfaceImpl.kt:155 Run Java Connected to the target VM -smartStepIntoInterfaceImpl.kt:90 -smartStepIntoInterfaceImpl.kt:95 -smartStepIntoInterfaceImpl.kt:8 -smartStepIntoInterfaceImpl.kt:100 -smartStepIntoInterfaceImpl.kt:13 -smartStepIntoInterfaceImpl.kt:105 -smartStepIntoInterfaceImpl.kt:13 -smartStepIntoInterfaceImpl.kt:110 -smartStepIntoInterfaceImpl.kt:18 -smartStepIntoInterfaceImpl.kt:120 -smartStepIntoInterfaceImpl.kt:22 -smartStepIntoInterfaceImpl.kt:125 -smartStepIntoInterfaceImpl.kt:36 -smartStepIntoInterfaceImpl.kt:130 -smartStepIntoInterfaceImpl.kt:41 -smartStepIntoInterfaceImpl.kt:138 -MyJavaClass.java:17 -smartStepIntoInterfaceImpl.kt:143 -smartStepIntoInterfaceImpl.kt:59 -smartStepIntoInterfaceImpl.kt:148 -smartStepIntoInterfaceImpl.kt:64 -smartStepIntoInterfaceImpl.kt:154 -smartStepIntoInterfaceImpl.kt:70 +smartStepIntoInterfaceImpl.kt:91 +smartStepIntoInterfaceImpl.kt:96 +smartStepIntoInterfaceImpl.kt:9 +smartStepIntoInterfaceImpl.kt:101 +smartStepIntoInterfaceImpl.kt:14 +smartStepIntoInterfaceImpl.kt:106 +smartStepIntoInterfaceImpl.kt:14 +smartStepIntoInterfaceImpl.kt:111 +smartStepIntoInterfaceImpl.kt:19 +smartStepIntoInterfaceImpl.kt:121 +smartStepIntoInterfaceImpl.kt:23 +smartStepIntoInterfaceImpl.kt:126 +smartStepIntoInterfaceImpl.kt:37 +smartStepIntoInterfaceImpl.kt:131 +smartStepIntoInterfaceImpl.kt:42 +smartStepIntoInterfaceImpl.kt:139 +MyJavaClass.java:10 +smartStepIntoInterfaceImpl.kt:144 +smartStepIntoInterfaceImpl.kt:60 +smartStepIntoInterfaceImpl.kt:149 +smartStepIntoInterfaceImpl.kt:65 +smartStepIntoInterfaceImpl.kt:155 +smartStepIntoInterfaceImpl.kt:71 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt index 6ea5ada7811..6c7ea7e122e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.kt @@ -1,3 +1,4 @@ +// FILE: stepIntoStdlibInlineFun2step.kt package stepIntoStdlibInlineFun2step fun main(args: Array) { @@ -5,4 +6,15 @@ fun main(args: Array) { } // ADDITIONAL_BREAKPOINT: functionInLibrary.kt:public inline fun simpleFun() -// STEP_INTO: 5 \ No newline at end of file +// STEP_INTO: 5 + +// FILE: customLib/functionInLibrary/functionInLibrary.kt +package customLib.functionInLibrary + +public inline fun simpleFun() { + nextFun() +} + +public inline fun nextFun() { + val a = 1 +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.out index dfbbab4c9ab..da3354deb6e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepIntoStdlibInlineFun2step.out @@ -1,11 +1,11 @@ -LineBreakpoint created at functionInLibrary.kt:4 +LineBreakpoint created at functionInLibrary.kt:5 Run Java Connected to the target VM -functionInLibrary.kt:4 -functionInLibrary.kt:8 -functionInLibrary.kt:9 functionInLibrary.kt:5 -stepIntoStdlibInlineFun2step.kt:5 +functionInLibrary.kt:9 +functionInLibrary.kt:10 +functionInLibrary.kt:6 +stepIntoStdlibInlineFun2step.kt:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOutInlineFunctionStdlib.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOutInlineFunctionStdlib.out index a7b53bfd24f..e5c5df0785c 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOutInlineFunctionStdlib.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/stepOutInlineFunctionStdlib.out @@ -2,8 +2,8 @@ LineBreakpoint created at stepOutInlineFunctionStdlib.kt:6 Run Java Connected to the target VM stepOutInlineFunctionStdlib.kt:6 -stepOutInlineFunctionStdlib.kt:1 -Thread.!EXT! +_Collections.!EXT! +stepOutInlineFunctionStdlib.kt:9 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.kt index 132f505c255..a8d1fa47b97 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.kt @@ -1,3 +1,4 @@ +// FILE: checkNotNull.kt package checkNotNull import forTests.MyJavaClass @@ -10,3 +11,17 @@ fun main(args: Array) { } // STEP_INTO: 3 + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; + +public class MyJavaClass { + @NotNull + public String testNotNullFun() { + return "a"; + } + + public MyJavaClass() {} +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.out index 6ad8b44b937..174120f86cf 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/checkNotNull.out @@ -1,10 +1,10 @@ -LineBreakpoint created at checkNotNull.kt:8 +LineBreakpoint created at checkNotNull.kt:9 Run Java Connected to the target VM -checkNotNull.kt:8 -MyJavaClass.java:13 -checkNotNull.kt:8 checkNotNull.kt:9 +MyJavaClass.java:9 +checkNotNull.kt:9 +checkNotNull.kt:10 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipClassloader.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipClassloader.kt index 0fbcebd1895..f4149fd017e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipClassloader.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/doNotSkipClassloader.kt @@ -4,7 +4,7 @@ fun main(args: Array) { val loader = A::class.java.getClassLoader()!! try { //Breakpoint! - val aaa = loader.loadClass("skipClassloader.A") + val aaa = loader.loadClass("doNotSkipClassloader.A") } catch (e: ClassNotFoundException) { e.printStackTrace() diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.kt index 11b48a0c86d..16d609c9469 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.kt @@ -1,3 +1,4 @@ +// FILE: stepIntoMultiFileFacade.kt package stepIntoMultiFileFacade fun main(args: Array) { @@ -6,4 +7,22 @@ fun main(args: Array) { } // STEP_INTO: 2 -// TRACING_FILTERS_ENABLED: false \ No newline at end of file +// TRACING_FILTERS_ENABLED: false + +// FILE: oneFunSameClassName/1/a1.kt +@file:JvmName("SameNameOneFunSameFileName") +@file:JvmMultifileClass +package customLib.oneFunSameClassName + +public fun oneFunSameFileNameFun(): Int { + return 1 +} + +// FILE: oneFunSameClassName/2/a2.kt +@file:JvmName("SameNameOneFunSameFileName") +@file:JvmMultifileClass +package customLib.oneFunSameClassName + +public fun oneFunSameFileNameFun2(): Int { + return 1 +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.out index 2ff18d90bf4..24744a9d50e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoMultiFileFacade.out @@ -1,9 +1,9 @@ -LineBreakpoint created at stepIntoMultiFileFacade.kt:5 +LineBreakpoint created at stepIntoMultiFileFacade.kt:6 Run Java Connected to the target VM -stepIntoMultiFileFacade.kt:5 -a1.kt:6 -stepIntoMultiFileFacade.kt:5 +stepIntoMultiFileFacade.kt:6 +a1.kt:7 +stepIntoMultiFileFacade.kt:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.kt index 1733d14235a..0f1a5c3b073 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.kt @@ -1,3 +1,4 @@ +// FILE: stepIntoSpecificKotlinClasses.kt package stepIntoSpecificKotlinClasses import forTests.MyJavaClass @@ -12,3 +13,15 @@ fun main(args: Array) { // STEP_INTO: 5 // DISABLE_KOTLIN_INTERNAL_CLASSES: false // TRACING_FILTERS_ENABLED: false + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; + +public class MyJavaClass { + @NotNull + public String testNotNullFun() { + return "a"; + } +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.out index 716e7aaa227..b845a14468f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoSpecificKotlinClasses.out @@ -1,12 +1,12 @@ -LineBreakpoint created at stepIntoSpecificKotlinClasses.kt:8 +LineBreakpoint created at stepIntoSpecificKotlinClasses.kt:9 Run Java Connected to the target VM -stepIntoSpecificKotlinClasses.kt:8 -MyJavaClass.java:13 -stepIntoSpecificKotlinClasses.kt:8 +stepIntoSpecificKotlinClasses.kt:9 +MyJavaClass.java:9 +stepIntoSpecificKotlinClasses.kt:9 Intrinsics.!EXT! Intrinsics.!EXT! -stepIntoSpecificKotlinClasses.kt:8 +stepIntoSpecificKotlinClasses.kt:9 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlib.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlib.out index 72e1532c994..8ba8fd5b578 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlib.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlib.out @@ -2,7 +2,7 @@ LineBreakpoint created at stepIntoStdlib.kt:6 Run Java Connected to the target VM stepIntoStdlib.kt:6 -ArraysKt.!EXT! +_Arrays.!EXT! Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlibFacadeClass.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlibFacadeClass.out index 85ef62ce389..ccb36db37eb 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlibFacadeClass.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/filters/stepIntoStdlibFacadeClass.out @@ -2,8 +2,8 @@ LineBreakpoint created at stepIntoStdlibFacadeClass.kt:6 Run Java Connected to the target VM stepIntoStdlibFacadeClass.kt:6 -ArraysKt.!EXT! -Iterables.!EXT! +_Arrays.!EXT! +Intrinsics.!EXT! Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.kt index 4ce9dd03d17..987cbcf7a86 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.kt @@ -1,3 +1,4 @@ +// FILE: defaultAccessors.kt package defaultAccessors fun main(args: Array) { @@ -25,4 +26,15 @@ fun testPublicPropertyInLibrary() { // STEP_INTO: 21 // SKIP_SYNTHETIC_METHODS: true -// SKIP_CONSTRUCTORS: true \ No newline at end of file +// SKIP_CONSTRUCTORS: true + +// FILE: customLib/simpleLibFile.kt +package customLib.simpleLibFile + +public fun foo() { + 1 + 1 +} + +class B { + public var prop: Int = 1 +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.out index e7492b4c9d8..b43f804b391 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/defaultAccessors.out @@ -1,22 +1,22 @@ -LineBreakpoint created at defaultAccessors.kt:5 +LineBreakpoint created at defaultAccessors.kt:6 Run Java Connected to the target VM -defaultAccessors.kt:5 -defaultAccessors.kt:11 -defaultAccessors.kt:17 -defaultAccessors.kt:11 -defaultAccessors.kt:12 -defaultAccessors.kt:17 -defaultAccessors.kt:13 defaultAccessors.kt:6 -defaultAccessors.kt:21 -defaultAccessors.kt:22 -simpleLibFile.kt:8 +defaultAccessors.kt:12 +defaultAccessors.kt:18 +defaultAccessors.kt:12 +defaultAccessors.kt:13 +defaultAccessors.kt:18 +defaultAccessors.kt:14 +defaultAccessors.kt:7 defaultAccessors.kt:22 defaultAccessors.kt:23 -simpleLibFile.kt:8 +simpleLibFile.kt:9 +defaultAccessors.kt:23 defaultAccessors.kt:24 -defaultAccessors.kt:7 +simpleLibFile.kt:9 +defaultAccessors.kt:25 +defaultAccessors.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.kt index ab36f37a719..062f6000de4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.kt @@ -1,3 +1,6 @@ +// EMULATE_DEX: true +// FILE: trueseveralInlineFunctionsInOneFileDex.kt + package inlineDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.out index 39be06dd295..5bf2e14b04d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at inlineDex.kt:5 +LineBreakpoint created at trueseveralInlineFunctionsInOneFileDex.kt:8 Run Java Connected to the target VM -inlineDex.kt:5 -inlineDex.kt:9 +trueseveralInlineFunctionsInOneFileDex.kt:8 +trueseveralInlineFunctionsInOneFileDex.kt:12 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.kt index 737db2ba756..ae96efc530e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.kt @@ -27,5 +27,4 @@ inline fun forEach(s: () -> Unit) { } } -// STEP_INTO: 9 -// TRACING_FILTERS_ENABLED: false \ No newline at end of file +// STEP_INTO: 10 \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.out index edb5a34b1b8..273f9ae287f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/inlineOnly.out @@ -10,7 +10,7 @@ inlineOnly.kt:13 inlineOnly.kt:14 inlineOnly.kt:7 inlineOnly.kt:9 -PrintStream.!EXT! +inlineOnly.kt:10 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.kt index 0abe13a71f5..82ae6075cc5 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.kt @@ -1,3 +1,4 @@ +// FILE: samAdapter.kt package samAdapter fun main(args: Array) { @@ -10,4 +11,22 @@ fun runReadAction(action: () -> Int): Int { return forTests.MyJavaClass.runReadAction(action) } -// STEP_INTO: 8 \ No newline at end of file +// STEP_INTO: 8 + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; + +public class MyJavaClass { + public static T runReadAction(@NotNull Computable computation) { + return computation.compute(); + } +} + +// FILE: forTests/Computable.java +package forTests; + +public interface Computable { + T compute(); +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.out index 24bc6a962c7..b7499b8d4ab 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/samAdapter.out @@ -1,15 +1,15 @@ -LineBreakpoint created at samAdapter.kt:5 +LineBreakpoint created at samAdapter.kt:6 Run Java Connected to the target VM -samAdapter.kt:5 -samAdapter.kt:6 -samAdapter.kt:10 -MyJavaClass.java:21 -samAdapter.kt:6 -MyJavaClass.java:21 -samAdapter.kt:10 samAdapter.kt:6 samAdapter.kt:7 +samAdapter.kt:11 +MyJavaClass.java:8 +samAdapter.kt:7 +MyJavaClass.java:8 +samAdapter.kt:11 +samAdapter.kt:7 +samAdapter.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.kt index 2d893b35dd7..5b907bf1b8e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.kt @@ -1,3 +1,4 @@ +// FILE: sameFileNames.kt package sameFileNames fun main() { @@ -5,4 +6,11 @@ fun main() { val result = simple.foo() } -// STEP_INTO: 1 \ No newline at end of file +// STEP_INTO: 1 + +// FILE: simple.kt +package simple + +// test more than one file for package in JetPositionManager:prepareTypeMapper. the second file in this package is singleBreakpoint/simple.kt +fun foo() { +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.out index 640f12481ed..051dc4e8ba4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/sameFileNames.out @@ -1,8 +1,8 @@ -LineBreakpoint created at sameFileNames.kt:5 +LineBreakpoint created at sameFileNames.kt:6 Run Java Connected to the target VM -sameFileNames.kt:5 -simpleKt.kt:5 +sameFileNames.kt:6 +simple.kt:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.kt index 14e7205452e..1e2afd0f5a0 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package siSuspendFun import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.out index 231354b0bb2..b6411851106 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/siSuspendFun.out @@ -1,12 +1,12 @@ -LineBreakpoint created at siSuspendFun.kt:29 +LineBreakpoint created at siSuspendFun.kt:31 Run Java Connected to the target VM -siSuspendFun.kt:29 -siSuspendFun.kt:22 -siSuspendFun.kt:18 -siSuspendFun.kt:14 -siSuspendFun.kt:10 -siSuspendFun.kt:6 +siSuspendFun.kt:31 +siSuspendFun.kt:24 +siSuspendFun.kt:20 +siSuspendFun.kt:16 +siSuspendFun.kt:12 +siSuspendFun.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoStdLibInlineFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoStdLibInlineFun.out index 1496a8e3f05..cb54edc0fcb 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoStdLibInlineFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoStdLibInlineFun.out @@ -2,7 +2,7 @@ LineBreakpoint created at stepIntoStdLibInlineFun.kt:6 Run Java Connected to the target VM stepIntoStdLibInlineFun.kt:6 -stepIntoStdLibInlineFun.kt:1 +_Collections.!EXT! resuming stepIntoStdLibInlineFun.kt:6 Disconnected from the target VM diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.kt index 2b0886c010f..09854acc88d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stepIntoSuspendFunctionSimple import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.out index 0c3e6012dcb..6cb7bef934c 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepInto/stepIntoSuspendFunctionSimple.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stepIntoSuspendFunctionSimple.kt:18 +LineBreakpoint created at stepIntoSuspendFunctionSimple.kt:20 Run Java Connected to the target VM -stepIntoSuspendFunctionSimple.kt:18 -stepIntoSuspendFunctionSimple.kt:10 +stepIntoSuspendFunctionSimple.kt:20 +stepIntoSuspendFunctionSimple.kt:12 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt index bd8d722a220..fa9f96a5606 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.kt @@ -1,3 +1,4 @@ +// FILE: javaFun.kt package javaFun import forTests.MyJavaClass @@ -7,3 +8,17 @@ fun main(args: Array) { //Breakpoint! klass.testFun() } + +// FILE: forTests/MyJavaClass.java +package forTests; + +import org.jetbrains.annotations.NotNull; +import java.util.List; + +public class MyJavaClass { + public void testFun() { + int i = 1; + } + + public MyJavaClass() {} +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.out index ef83f61b22e..9aa58643d2b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaFun.out @@ -1,8 +1,8 @@ -LineBreakpoint created at javaFun.kt:8 +LineBreakpoint created at javaFun.kt:9 Run Java Connected to the target VM -javaFun.kt:8 -MyJavaClass.java:8 +javaFun.kt:9 +MyJavaClass.java:9 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt index ddbcfbc57c2..664ca84cf97 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.kt @@ -1,3 +1,4 @@ +// FILE: javaSamConstructor.kt package javaSamConstructor import forTests.MyJavaClass @@ -5,4 +6,12 @@ import forTests.MyJavaClass fun main(args: Array) { //Breakpoint! MyJavaClass { /* do nothing*/ } +} + +// FILE: forTests/MyJavaClass.java +package forTests; + +public class MyJavaClass { + public MyJavaClass() {} + public MyJavaClass(Runnable runnable) {} } \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.out index 702a9f22823..53da14768ff 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamConstructor.out @@ -1,8 +1,8 @@ -LineBreakpoint created at javaSamConstructor.kt:7 +LineBreakpoint created at javaSamConstructor.kt:8 Run Java Connected to the target VM -javaSamConstructor.kt:7 -MyJavaClass.java:61 +javaSamConstructor.kt:8 +MyJavaClass.java:6 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt index 8d41903964b..7c2d5e5dbbc 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.kt @@ -1,3 +1,4 @@ +// FILE: javaSamFunction.kt package javaSamFunction import forTests.MyJavaClass @@ -6,4 +7,15 @@ fun main(args: Array) { val klass = MyJavaClass() //Breakpoint! klass.other { /* do nothing*/ } +} + +// FILE: forTests/MyJavaClass.java +package forTests; + +public class MyJavaClass { + public void other(Runnable runnable) { + runnable.run(); + } + + public MyJavaClass() {} } \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.out index 14841bb9f2e..b445225d4e2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/javaSamFunction.out @@ -1,9 +1,9 @@ -LineBreakpoint created at javaSamFunction.kt:8 +LineBreakpoint created at javaSamFunction.kt:9 Run Java Connected to the target VM -javaSamFunction.kt:8 -MyJavaClass.java:55 -resuming javaSamFunction.kt:8 +javaSamFunction.kt:9 +MyJavaClass.java:6 +resuming javaSamFunction.kt:9 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt index 012fcd3ba65..c297e957e7e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.kt @@ -1,3 +1,4 @@ +// FILE: kotlinSamFunction.kt package kotlinSamFunction import forTests.MyJavaClass @@ -12,4 +13,13 @@ fun main(args: Array) { val klass = KotlinSubclass() //Breakpoint! klass.other { /* do nothing*/ } -} \ No newline at end of file +} + +// FILE: forTests/MyJavaClass.java +package forTests; + +public class MyJavaClass { + public void other(Runnable runnable) { + runnable.run(); + } +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.out index cd5834665e9..4900cfe13ea 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepIntoAndSmartStepInto/kotlinSamFunction.out @@ -1,9 +1,9 @@ -LineBreakpoint created at kotlinSamFunction.kt:14 +LineBreakpoint created at kotlinSamFunction.kt:15 Run Java Connected to the target VM -kotlinSamFunction.kt:14 -kotlinSamFunction.kt:7 -resuming kotlinSamFunction.kt:14 +kotlinSamFunction.kt:15 +kotlinSamFunction.kt:8 +resuming kotlinSamFunction.kt:15 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.kt index f0a67234821..a77ee68f95f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package souSuspendFun import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.out index 246f6af23aa..1c16602a9db 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOut/souSuspendFun.out @@ -1,12 +1,12 @@ -LineBreakpoint created at souSuspendFun.kt:7 +LineBreakpoint created at souSuspendFun.kt:9 Run Java Connected to the target VM -souSuspendFun.kt:7 -souSuspendFun.kt:11 -souSuspendFun.kt:15 -souSuspendFun.kt:19 -souSuspendFun.kt:23 -souSuspendFun.kt:29 +souSuspendFun.kt:9 +souSuspendFun.kt:13 +souSuspendFun.kt:17 +souSuspendFun.kt:21 +souSuspendFun.kt:25 +souSuspendFun.kt:31 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.kt index 2b83e67d79c..8f2ded0ab8b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.kt @@ -1,3 +1,4 @@ +// FILE: inlineFunctionSameLines.kt package inlineFunctionSameLines fun main(args: Array) { @@ -11,4 +12,15 @@ fun main(args: Array) { //Breakpoint! myFun(1) val a = 1 +} + +// FILE: inlineFunctionSameLinesDependent.kt +package inlineFunctionSameLines + +inline fun myFun(t: T): Int { + val a = 1 + val b = 2 + val c = 3 + val d = 4 + return 1 } \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.out index 2ae6771b10d..f9bba32d551 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineFunctionSameLines.out @@ -1,8 +1,8 @@ -LineBreakpoint created at inlineFunctionSameLines.kt:12 +LineBreakpoint created at inlineFunctionSameLines.kt:13 Run Java Connected to the target VM -inlineFunctionSameLines.kt:12 inlineFunctionSameLines.kt:13 +inlineFunctionSameLines.kt:14 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.Other.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.Other.kt deleted file mode 100644 index bb98262bc1e..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.Other.kt +++ /dev/null @@ -1,11 +0,0 @@ -package inlineInClassDex.other - -class TestDexInlineInClass { - inline fun inlineFun() { - // Breakpoint 1 - some() - some() - } - - fun some() {} -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.kt index 220a854ee03..5ac0eb3af40 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.kt @@ -1,7 +1,23 @@ +// FILE: inlineInClassDex.kt +// EMULATE_DEX: true + package inlineInClassDex fun main(args: Array) { inlineInClassDex.other.TestDexInlineInClass().inlineFun() } -// ADDITIONAL_BREAKPOINT: inlineInClassDex.Other.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: inlineInClassDex.Other.kt: Breakpoint 1 + +// FILE: inlineInClassDex.Other.kt +package inlineInClassDex.other + +class TestDexInlineInClass { + inline fun inlineFun() { + // Breakpoint 1 + some() + some() + } + + fun some() {} +} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.out index 6aa50e0bc2a..d387cab5b92 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInClassDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at inlineInClassDex.Other.kt:6 +LineBreakpoint created at inlineInClassDex.Other.kt:7 Run Java Connected to the target VM -inlineInClassDex.Other.kt:6 inlineInClassDex.Other.kt:7 +inlineInClassDex.Other.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.kt index 4672db09ac8..75d09848b5e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.kt @@ -1,3 +1,6 @@ +// FILE: inlineInIfFalseDex.kt +// EMULATE_DEX: true + package inlineInIfFalseDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.out index bb1e59cc6df..e3e0489632b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfFalseDex.out @@ -1,9 +1,9 @@ -LineBreakpoint created at inlineInIfFalseDex.kt:6 +LineBreakpoint created at inlineInIfFalseDex.kt:9 Run Java Connected to the target VM -inlineInIfFalseDex.kt:6 inlineInIfFalseDex.kt:9 -inlineInIfFalseDex.kt:10 +inlineInIfFalseDex.kt:12 +inlineInIfFalseDex.kt:13 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.kt index 1bdbb579941..ebe8d9d516a 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.kt @@ -1,3 +1,6 @@ +// FILE: inlineInIfTrueDex.kt +// EMULATE_DEX: true + package inlineInIfTrueDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.out index 9f357b73742..a94e50329f7 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInIfTrueDex.out @@ -1,9 +1,9 @@ -LineBreakpoint created at inlineInIfTrueDex.kt:6 +LineBreakpoint created at inlineInIfTrueDex.kt:9 Run Java Connected to the target VM -inlineInIfTrueDex.kt:6 -inlineInIfTrueDex.kt:7 inlineInIfTrueDex.kt:9 +inlineInIfTrueDex.kt:10 +inlineInIfTrueDex.kt:12 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.Other.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.Other.kt deleted file mode 100644 index 9969a6708da..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.Other.kt +++ /dev/null @@ -1,11 +0,0 @@ -package inlineInObjectDex.other - -object TestDexInlineInObject { - inline fun inlineFun() { - // Breakpoint 1 - some() - some() - } - - fun some() {} -} diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.kt index 89fbe65e15e..1212039dbaf 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.kt @@ -1,7 +1,23 @@ +// FILE: inlineInObjectDex.kt +// EMULATE_DEX: true + package inlineInObjectDex fun main(args: Array) { inlineInObjectDex.other.TestDexInlineInObject.inlineFun() } -// ADDITIONAL_BREAKPOINT: inlineInObjectDex.Other.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: inlineInObjectDex.Other.kt: Breakpoint 1 + +// FILE: inlineInObjectDex.Other.kt +package inlineInObjectDex.other + +object TestDexInlineInObject { + inline fun inlineFun() { + // Breakpoint 1 + some() + some() + } + + fun some() {} +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.out index a1ac11e076a..379fba0b682 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/inlineInObjectDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at inlineInObjectDex.Other.kt:6 +LineBreakpoint created at inlineInObjectDex.Other.kt:7 Run Java Connected to the target VM -inlineInObjectDex.Other.kt:6 inlineInObjectDex.Other.kt:7 +inlineInObjectDex.Other.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt index f1c59e07941..527493a12d2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineAnonymousFunctionArgumentDex.kt +// EMULATE_DEX: true + package soInlineAnonymousFunctionArgumentDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.out index a17bbbdc68a..24d9599b61e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineAnonymousFunctionArgumentDex.out @@ -1,10 +1,10 @@ -LineBreakpoint created at soInlineAnonymousFunctionArgumentDex.kt:5 +LineBreakpoint created at soInlineAnonymousFunctionArgumentDex.kt:8 Run Java Connected to the target VM -soInlineAnonymousFunctionArgumentDex.kt:5 -soInlineAnonymousFunctionArgumentDex.kt:7 -soInlineAnonymousFunctionArgumentDex.kt:11 -soInlineAnonymousFunctionArgumentDex.kt:12 +soInlineAnonymousFunctionArgumentDex.kt:8 +soInlineAnonymousFunctionArgumentDex.kt:10 +soInlineAnonymousFunctionArgumentDex.kt:14 +soInlineAnonymousFunctionArgumentDex.kt:15 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt index 1d87ea567e2..756beabce16 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineCallInLastStatementInInlineDex.kt +// EMULATE_DEX: true + package soInlineCallInLastStatementInInlineDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.out index 832eb249374..7b22f06e9e1 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineDex.out @@ -1,11 +1,11 @@ -LineBreakpoint created at soInlineCallInLastStatementInInlineDex.kt:10 +LineBreakpoint created at soInlineCallInLastStatementInInlineDex.kt:13 Run Java Connected to the target VM -soInlineCallInLastStatementInInlineDex.kt:10 -soInlineCallInLastStatementInInlineDex.kt:11 -soInlineCallInLastStatementInInlineDex.kt:12 -soInlineCallInLastStatementInInlineDex.kt:5 -soInlineCallInLastStatementInInlineDex.kt:6 +soInlineCallInLastStatementInInlineDex.kt:13 +soInlineCallInLastStatementInInlineDex.kt:14 +soInlineCallInLastStatementInInlineDex.kt:15 +soInlineCallInLastStatementInInlineDex.kt:8 +soInlineCallInLastStatementInInlineDex.kt:9 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt index 0abd108a9ae..79c3eb87061 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineCallInLastStatementInInlineFunctionArgumentDex.kt +// EMULATE_DEX: true + package soInlineCallInLastStatementInInlineFunctionArgumentDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.out index c1599ff8e1d..d6c7fb21efd 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineCallInLastStatementInInlineFunctionArgumentDex.out @@ -1,9 +1,9 @@ -LineBreakpoint created at soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:7 +LineBreakpoint created at soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:10 Run Java Connected to the target VM -soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:7 -soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:8 -soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:9 +soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:10 +soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:11 +soInlineCallInLastStatementInInlineFunctionArgumentDex.kt:12 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.kt index c2d28f9671b..f2a5827126f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineFunDex.kt +// EMULATE_DEX: true + package soInlineFunDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.out index 39c669decc2..b3645aa87cd 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunDex.out @@ -1,10 +1,10 @@ -LineBreakpoint created at soInlineFunDex.kt:7 +LineBreakpoint created at soInlineFunDex.kt:10 Run Java Connected to the target VM -soInlineFunDex.kt:7 -soInlineFunDex.kt:9 -soInlineFunDex.kt:11 +soInlineFunDex.kt:10 soInlineFunDex.kt:12 +soInlineFunDex.kt:14 +soInlineFunDex.kt:15 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.kt index 232bad5adc8..cc0e12d7639 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineFunOnOneLineForDex.kt +// EMULATE_DEX: true + package soInlineFunOnOneLineForDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.out index 81b499fe5aa..30f1d69d5c6 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineFunOnOneLineForDex.out @@ -1,10 +1,10 @@ -LineBreakpoint created at soInlineFunOnOneLineForDex.kt:17 +LineBreakpoint created at soInlineFunOnOneLineForDex.kt:20 Run Java Connected to the target VM -soInlineFunOnOneLineForDex.kt:17 -soInlineFunOnOneLineForDex.kt:18 -soInlineFunOnOneLineForDex.kt:8 -soInlineFunOnOneLineForDex.kt:9 +soInlineFunOnOneLineForDex.kt:20 +soInlineFunOnOneLineForDex.kt:21 +soInlineFunOnOneLineForDex.kt:11 +soInlineFunOnOneLineForDex.kt:12 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.kt index 04622b23bb5..19b4693cdfe 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineIterableFunDex.kt +// EMULATE_DEX: true + package soInlineIterableFunDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.out index 7920ac09aa8..98ae49bd3a2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineIterableFunDex.out @@ -1,10 +1,10 @@ -LineBreakpoint created at soInlineIterableFunDex.kt:5 +LineBreakpoint created at soInlineIterableFunDex.kt:8 Run Java Connected to the target VM -soInlineIterableFunDex.kt:5 -soInlineIterableFunDex.kt:7 -soInlineIterableFunDex.kt:9 +soInlineIterableFunDex.kt:8 soInlineIterableFunDex.kt:10 +soInlineIterableFunDex.kt:12 +soInlineIterableFunDex.kt:13 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.kt index 06899b29402..930fc37f502 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineLibFunDex.kt +// EMULATE_DEX: true + package soInlineLibFunDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.out index 63412318129..061cf60f26e 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineLibFunDex.out @@ -1,11 +1,11 @@ -LineBreakpoint created at soInlineLibFunDex.kt:5 +LineBreakpoint created at soInlineLibFunDex.kt:8 Run Java Connected to the target VM -soInlineLibFunDex.kt:5 -soInlineLibFunDex.kt:7 -soInlineLibFunDex.kt:9 +soInlineLibFunDex.kt:8 soInlineLibFunDex.kt:10 soInlineLibFunDex.kt:12 +soInlineLibFunDex.kt:13 +soInlineLibFunDex.kt:15 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.kt index 4aeda8a302e..a7dd49a5f23 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineUnitFunDex.kt +// EMULATE_DEX: true + package soInlineUnitFunDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.out index a4769af6fae..e1277630126 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineUnitFunDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at soInlineUnitFunDex.kt:10 +LineBreakpoint created at soInlineUnitFunDex.kt:13 Run Java Connected to the target VM -soInlineUnitFunDex.kt:10 -soInlineUnitFunDex.kt:4 +soInlineUnitFunDex.kt:13 +soInlineUnitFunDex.kt:7 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.kt index a97cbfc2dda..677c22b14c8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.kt @@ -1,3 +1,6 @@ +// FILE: soInlineWhileConditionDex.kt +// EMULATE_DEX: true + package soInlineWhileConditionDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.out index 823cd63a7f1..888dc6ba7fb 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soInlineWhileConditionDex.out @@ -1,12 +1,12 @@ -LineBreakpoint created at soInlineWhileConditionDex.kt:5 +LineBreakpoint created at soInlineWhileConditionDex.kt:8 Run Java Connected to the target VM -soInlineWhileConditionDex.kt:5 -soInlineWhileConditionDex.kt:7 soInlineWhileConditionDex.kt:8 -soInlineWhileConditionDex.kt:7 -soInlineWhileConditionDex.kt:12 +soInlineWhileConditionDex.kt:10 +soInlineWhileConditionDex.kt:11 +soInlineWhileConditionDex.kt:10 soInlineWhileConditionDex.kt:15 +soInlineWhileConditionDex.kt:18 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.kt index 79833042782..9f79f030456 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soNonSuspendableSuspendCall import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.out index bf026af3abf..3caecc4f6c8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soNonSuspendableSuspendCall.out @@ -1,8 +1,8 @@ -LineBreakpoint created at soNonSuspendableSuspendCall.kt:18 +LineBreakpoint created at soNonSuspendableSuspendCall.kt:20 Run Java Connected to the target VM -soNonSuspendableSuspendCall.kt:18 -soNonSuspendableSuspendCall.kt:19 +soNonSuspendableSuspendCall.kt:20 +soNonSuspendableSuspendCall.kt:21 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt index dc7f7b97e6c..39661305c18 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soSuspendableCallInEndOfFun import forTests.WaitFinish diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.out index 9995a356f91..19c5d0cb4a8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfFun.out @@ -1,11 +1,11 @@ -LineBreakpoint created at soSuspendableCallInEndOfFun.kt:27 +LineBreakpoint created at soSuspendableCallInEndOfFun.kt:29 Run Java Connected to the target VM -soSuspendableCallInEndOfFun.kt:27 -soSuspendableCallInEndOfFun.kt:15 -soSuspendableCallInEndOfFun.kt:14 +soSuspendableCallInEndOfFun.kt:29 +soSuspendableCallInEndOfFun.kt:17 soSuspendableCallInEndOfFun.kt:16 -soSuspendableCallInEndOfFun.kt:35 +soSuspendableCallInEndOfFun.kt:18 +soSuspendableCallInEndOfFun.kt:37 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.kt index 944368748b5..6af19bd37a4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soSuspendableCallInEndOfLambda import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.out index e99f6c5c0a6..f007d901737 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInEndOfLambda.out @@ -1,9 +1,9 @@ -LineBreakpoint created at soSuspendableCallInEndOfLambda.kt:16 +LineBreakpoint created at soSuspendableCallInEndOfLambda.kt:18 Run Java Connected to the target VM -soSuspendableCallInEndOfLambda.kt:16 -soSuspendableCallInEndOfLambda.kt:13 -soSuspendableCallInEndOfLambda.kt:17 +soSuspendableCallInEndOfLambda.kt:18 +soSuspendableCallInEndOfLambda.kt:15 +soSuspendableCallInEndOfLambda.kt:19 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.kt index 6fd3bb8efef..abe3961913b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soSuspendableCallInFun import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.out index 8565e6a5f51..5109baa482b 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFun.out @@ -1,9 +1,9 @@ -LineBreakpoint created at soSuspendableCallInFun.kt:23 +LineBreakpoint created at soSuspendableCallInFun.kt:25 Run Java Connected to the target VM +soSuspendableCallInFun.kt:25 soSuspendableCallInFun.kt:23 -soSuspendableCallInFun.kt:21 -soSuspendableCallInFun.kt:24 +soSuspendableCallInFun.kt:26 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt index 4a9ddd423a4..916e01fe11f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soSuspendableCallInFunFromOtherStepping import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.out index e875ff0d4fe..291815a88b4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInFunFromOtherStepping.out @@ -1,10 +1,10 @@ -LineBreakpoint created at soSuspendableCallInFunFromOtherStepping.kt:23 +LineBreakpoint created at soSuspendableCallInFunFromOtherStepping.kt:25 Run Java Connected to the target VM -soSuspendableCallInFunFromOtherStepping.kt:23 -soSuspendableCallInFunFromOtherStepping.kt:24 -soSuspendableCallInFunFromOtherStepping.kt:21 soSuspendableCallInFunFromOtherStepping.kt:25 +soSuspendableCallInFunFromOtherStepping.kt:26 +soSuspendableCallInFunFromOtherStepping.kt:23 +soSuspendableCallInFunFromOtherStepping.kt:27 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.kt index 41b6301f5bd..ae74908ced2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package soSuspendableCallInLambda import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.out index 2ff3fc28948..eca445d3692 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/soSuspendableCallInLambda.out @@ -1,9 +1,9 @@ -LineBreakpoint created at soSuspendableCallInLambda.kt:15 +LineBreakpoint created at soSuspendableCallInLambda.kt:17 Run Java Connected to the target VM +soSuspendableCallInLambda.kt:17 soSuspendableCallInLambda.kt:15 -soSuspendableCallInLambda.kt:13 -soSuspendableCallInLambda.kt:16 +soSuspendableCallInLambda.kt:18 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt index 68553126c99..f652979accb 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt @@ -1,3 +1,6 @@ +// FILE: stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt +// EMULATE_DEX: true + package stopInAnonymousFunctionInInlinedCallWithCrossInlineDex // KT-15282 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.out index 89b9acee5f7..5ff115ed249 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:8 +LineBreakpoint created at stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:11 Run Java Connected to the target VM -stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:8 -stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:19 +stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:11 +stopInAnonymousFunctionInInlinedCallWithCrossInlineDex.kt:22 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.kt index cf93f3050a2..2847d889ea7 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInCrossinlineInSuspend import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.out index 268013facde..b022522afb8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInCrossinlineInSuspend.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInCrossinlineInSuspend.kt:12 +LineBreakpoint created at stopInCrossinlineInSuspend.kt:14 Run Java Connected to the target VM -stopInCrossinlineInSuspend.kt:12 -stopInCrossinlineInSuspend.kt:13 +stopInCrossinlineInSuspend.kt:14 +stopInCrossinlineInSuspend.kt:15 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.kt index 99601d14df1..62b37001dd9 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.kt @@ -1,3 +1,6 @@ +// FILE: stopInInlineFunDex.kt +// EMULATE_DEX: true + package stopInInlineFunDex fun main(args: Array) { diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.out index 1c831936127..b086ad05ae4 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineFunDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInInlineFunDex.kt:10 +LineBreakpoint created at stopInInlineFunDex.kt:13 Run Java Connected to the target VM -stopInInlineFunDex.kt:10 -stopInInlineFunDex.kt:11 +stopInInlineFunDex.kt:13 +stopInInlineFunDex.kt:14 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.Other.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.Other.kt deleted file mode 100644 index 984135277fd..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.Other.kt +++ /dev/null @@ -1,8 +0,0 @@ -package stopInInlineInOtherFileDex - -inline fun inlineFun() { - var i = 1 - // Breakpoint 1 - i++ - i++ -} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.kt index c149195afbf..98c57c6e8df 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.kt @@ -1,7 +1,20 @@ +// FILE: stopInInlineInOtherFileDex.kt +// EMULATE_DEX: true + package stopInInlineInOtherFileDex fun main(args: Array) { inlineFun() } -// ADDITIONAL_BREAKPOINT: stopInInlineInOtherFileDex.Other.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: stopInInlineInOtherFileDex.Other.kt: Breakpoint 1 + +// FILE: stopInInlineInOtherFileDex.Other.kt +package stopInInlineInOtherFileDex + +inline fun inlineFun() { + var i = 1 + // Breakpoint 1 + i++ + i++ +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.out index e359f57e4de..a3b9ad9494d 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInInlineInOtherFileDex.Other.kt:6 +LineBreakpoint created at stopInInlineInOtherFileDex.Other.kt:7 Run Java Connected to the target VM -stopInInlineInOtherFileDex.Other.kt:6 stopInInlineInOtherFileDex.Other.kt:7 +stopInInlineInOtherFileDex.Other.kt:8 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt deleted file mode 100644 index 4e03fc5302e..00000000000 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt +++ /dev/null @@ -1,8 +0,0 @@ -package stopInInlineInOtherFileWithLambdaArgumentDex - -inline fun inlineFun(a: () -> Unit) { - a() - // Breakpoint 1 - a() - a() -} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt index 578fdb2ba20..71ac368a270 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.kt @@ -1,3 +1,6 @@ +// FILE: stopInInlineInOtherFileWithLambdaArgumentDex.kt +// EMULATE_DEX: true + package stopInInlineInOtherFileWithLambdaArgumentDex fun main(args: Array) { @@ -5,4 +8,14 @@ fun main(args: Array) { val i = 1 } -// ADDITIONAL_BREAKPOINT: stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt: Breakpoint 1 + +// FILE: stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt +package stopInInlineInOtherFileWithLambdaArgumentDex + +inline fun inlineFun(a: () -> Unit) { + a() + // Breakpoint 1 + a() + a() +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.out index 5028ccaa3bf..73b843df6e2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineInOtherFileWithLambdaArgumentDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt:6 +LineBreakpoint created at stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt:7 Run Java Connected to the target VM -stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt:6 stopInInlineInOtherFileWithLambdaArgumentDex.Other.kt:7 +stopInInlineInOtherFileWithLambdaArgumentDex.kt:7 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.kt index d9d70654d15..26409fcedbc 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.kt @@ -1,3 +1,4 @@ +// FILE: stopInInlineUnderSamConversion.kt package stopInInlineUnderSamConversion import forTests.SamConversion @@ -19,4 +20,17 @@ fun foo(a: Any) {} inline fun inlineCall(f: () -> Unit) { f() +} + +// FILE: forTests/SamConversion.java +package forTests; + +public class SamConversion { + public interface Runnable { + public abstract void run(); + } + + public static void doAction(Runnable runnable) { + runnable.run(); + } } \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.out index da3ce7d9044..a96539edfa7 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlineUnderSamConversion.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInInlineUnderSamConversion.kt:12 +LineBreakpoint created at stopInInlineUnderSamConversion.kt:13 Run Java Connected to the target VM -stopInInlineUnderSamConversion.kt:12 stopInInlineUnderSamConversion.kt:13 +stopInInlineUnderSamConversion.kt:14 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt index cfcab1a480b..b73865e993c 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.out index 9ea6fcda0f4..732f0033729 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:26 +LineBreakpoint created at stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:28 Run Java Connected to the target VM -stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:26 -stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:27 +stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:28 +stopInInlinedLambdaInSuspendFunctionWithSuspendPointsInObjectLiteral.kt:29 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt index 7737997599c..c2bba7042ec 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.kt @@ -1,7 +1,9 @@ -package stopInLambdaInInlinedCallWithCrossInlineDex - +// FILE: stopInLambdaInInlinedCallWithCrossInlineDex.kt +// EMULATE_DEX: true // KT-15282 +package stopInLambdaInInlinedCallWithCrossInlineDex + fun main(args: Array) { foo { //Breakpoint! diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.out index 8aec031524a..090fdbec0bf 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInLambdaInInlinedCallWithCrossInlineDex.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInLambdaInInlinedCallWithCrossInlineDex.kt:8 +LineBreakpoint created at stopInLambdaInInlinedCallWithCrossInlineDex.kt:10 Run Java Connected to the target VM -stopInLambdaInInlinedCallWithCrossInlineDex.kt:8 -stopInLambdaInInlinedCallWithCrossInlineDex.kt:19 +stopInLambdaInInlinedCallWithCrossInlineDex.kt:10 +stopInLambdaInInlinedCallWithCrossInlineDex.kt:21 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt index 4c9e715b8be..5dd2ac63137 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInSuspendFunctionWithSuspendPoints import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.out index edde9ced88e..73d695180b1 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPoints.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInSuspendFunctionWithSuspendPoints.kt:16 +LineBreakpoint created at stopInSuspendFunctionWithSuspendPoints.kt:18 Run Java Connected to the target VM -stopInSuspendFunctionWithSuspendPoints.kt:16 -stopInSuspendFunctionWithSuspendPoints.kt:17 +stopInSuspendFunctionWithSuspendPoints.kt:18 +stopInSuspendFunctionWithSuspendPoints.kt:19 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt index a838ac86383..28eb13827df 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInSuspendFunctionWithSuspendPointsInAnonymousObject import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.out index bbb1ec9ef39..9ec3a2631e9 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInAnonymousObject.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:20 +LineBreakpoint created at stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:22 Run Java Connected to the target VM -stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:20 -stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:21 +stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:22 +stopInSuspendFunctionWithSuspendPointsInAnonymousObject.kt:23 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt index 38331ab97c1..0428db9f994 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.out index 791246d5e2c..a8b6a859202 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:28 +LineBreakpoint created at stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:30 Run Java Connected to the target VM -stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:28 -stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:29 +stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:30 +stopInSuspendFunctionWithSuspendPointsInObjectLiteralInInlineCallWithClosure.kt:31 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt index d28f6a1129e..97ad3501ec8 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package stopInSuspendFunctionWithoutSuspendPoints import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.out index 6db9605a748..9fa13a06456 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInSuspendFunctionWithoutSuspendPoints.out @@ -1,8 +1,8 @@ -LineBreakpoint created at stopInSuspendFunctionWithoutSuspendPoints.kt:11 +LineBreakpoint created at stopInSuspendFunctionWithoutSuspendPoints.kt:13 Run Java Connected to the target VM -stopInSuspendFunctionWithoutSuspendPoints.kt:11 -stopInSuspendFunctionWithoutSuspendPoints.kt:12 +stopInSuspendFunctionWithoutSuspendPoints.kt:13 +stopInSuspendFunctionWithoutSuspendPoints.kt:14 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.kt index c93aba7d28d..cb5ff285c18 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.kt @@ -1,3 +1,4 @@ +// FILE: stopInWrongClass.kt package stopInWrongClass class AA { @@ -18,4 +19,17 @@ fun main(args: Array) { AA().other() } -// ADDITIONAL_BREAKPOINT: stopInWrongClass.Other.kt: Breakpoint 1 \ No newline at end of file +// ADDITIONAL_BREAKPOINT: stopInWrongClass.Other.kt: Breakpoint 1 + +// FILE: stopInWrongClass.Other.kt +package stopInWrongClass + +class A { + fun test() { + // Breakpoint 1 + foo() + } +} + +fun foo() { +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.out index 68f6503700d..e59c94f3e84 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/stopInWrongClass.out @@ -1,9 +1,9 @@ -LineBreakpoint created at stopInWrongClass.Other.kt:6 -LineBreakpoint created at stopInWrongClass.kt:11 +LineBreakpoint created at stopInWrongClass.Other.kt:7 +LineBreakpoint created at stopInWrongClass.kt:12 Run Java Connected to the target VM -stopInWrongClass.kt:11 stopInWrongClass.kt:12 +stopInWrongClass.kt:13 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.kt index 06a8d08c057..258725cf6ea 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.kt +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.kt @@ -1,3 +1,5 @@ +// ATTACH_LIBRARY: coroutines + package sofSuspendableCallInFun import forTests.builder diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.out index 4cbabbf962d..99a1384b026 100644 --- a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.out +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOverForce/sofSuspendableCallInFun.out @@ -1,10 +1,10 @@ -LineBreakpoint created at sofSuspendableCallInFun.kt:23 -LineBreakpoint created at sofSuspendableCallInFun.kt:29 +LineBreakpoint created at sofSuspendableCallInFun.kt:25 +LineBreakpoint created at sofSuspendableCallInFun.kt:31 Run Java Connected to the target VM +sofSuspendableCallInFun.kt:25 sofSuspendableCallInFun.kt:23 -sofSuspendableCallInFun.kt:21 -sofSuspendableCallInFun.kt:24 +sofSuspendableCallInFun.kt:26 Disconnected from the target VM Process finished with exit code 0 diff --git a/idea/jvm-debugger/jvm-debugger-util/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinDebuggerCaches.kt b/idea/jvm-debugger/jvm-debugger-util/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinDebuggerCaches.kt index dfdbdc847e1..65e0fb1fbc2 100644 --- a/idea/jvm-debugger/jvm-debugger-util/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinDebuggerCaches.kt +++ b/idea/jvm-debugger/jvm-debugger-util/src/org/jetbrains/kotlin/idea/debugger/evaluate/KotlinDebuggerCaches.kt @@ -91,6 +91,9 @@ class KotlinDebuggerCaches(project: Project) { companion object { private val LOG = Logger.getLogger(KotlinDebuggerCaches::class.java)!! + @get:TestOnly + var LOG_COMPILATIONS: Boolean = false + fun getInstance(project: Project) = ServiceManager.getService(project, KotlinDebuggerCaches::class.java)!! fun compileCodeFragmentCacheAware( @@ -123,7 +126,10 @@ class KotlinDebuggerCaches(project: Project) { } val newCompiledData = compileCode() - LOG.debug("Compile bytecode for ${codeFragment.text}") + + if (LOG_COMPILATIONS) { + LOG.debug("Compile bytecode for ${codeFragment.text}") + } synchronized(evaluateExpressionCache.cachedCompiledData) { evaluateExpressionCache.cachedCompiledData.value.putValue(text, newCompiledData) diff --git a/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/1/a1.kt b/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/1/a1.kt deleted file mode 100644 index 3bc3474b2e4..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/1/a1.kt +++ /dev/null @@ -1,8 +0,0 @@ -@file:JvmName("SameNameBreakpointOnLocalProperty") -@file:JvmMultifileClass -package customLib.breakpointOnLocalProperty - -public fun breakpointOnLocalPropertyFun(): Int { - val a = 1 - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/2/a2.kt b/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/2/a2.kt deleted file mode 100644 index 26e006d8774..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/2/a2.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameBreakpointOnLocalProperty") -@file:JvmMultifileClass -package customLib.breakpointOnLocalProperty - -public fun breakpointOnLocalPropertyFun2(): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/delegatedPropertyInOtherFile/delegatedPropertyInOtherFile2.kt b/idea/testData/debugger/customLibraryForTinyApp/delegatedPropertyInOtherFile/delegatedPropertyInOtherFile2.kt deleted file mode 100644 index 86850df9a07..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/delegatedPropertyInOtherFile/delegatedPropertyInOtherFile2.kt +++ /dev/null @@ -1,11 +0,0 @@ -package delegatedPropertyInOtherFileOther - -import kotlin.reflect.KProperty - -class WithDelegate { - val a: Int by Id(12) -} - -class Id(val v: Int) { - operator fun getValue(o: Any, property: KProperty<*>): Int = v -} diff --git a/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal.kt b/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal.kt deleted file mode 100644 index a31184c5053..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal.kt +++ /dev/null @@ -1,6 +0,0 @@ -package fileWithInternal - -fun test() { - // Breakpoint - val a = fileWithInternal2.MyInternal() -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal2.kt b/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal2.kt deleted file mode 100644 index 4f6d5943257..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/fileWithInternal2.kt +++ /dev/null @@ -1,3 +0,0 @@ -package fileWithInternal2 - -internal class MyInternal \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/1/functionInLibrary2.kt b/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/1/functionInLibrary2.kt deleted file mode 100644 index 1754d952e98..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/1/functionInLibrary2.kt +++ /dev/null @@ -1,5 +0,0 @@ -package customLib.functionInLibrary - -public inline fun simpleFun2() { - val a = 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/functionInLibrary.kt b/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/functionInLibrary.kt deleted file mode 100644 index be222382c15..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/functionInLibrary/functionInLibrary.kt +++ /dev/null @@ -1,9 +0,0 @@ -package customLib.functionInLibrary - -public inline fun simpleFun() { - nextFun() -} - -public inline fun nextFun() { - val a = 1 -} diff --git a/idea/testData/debugger/customLibraryForTinyApp/inlineFunInLibrary/inlineFunInLibrary.kt b/idea/testData/debugger/customLibraryForTinyApp/inlineFunInLibrary/inlineFunInLibrary.kt deleted file mode 100644 index cc756012e1b..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/inlineFunInLibrary/inlineFunInLibrary.kt +++ /dev/null @@ -1,13 +0,0 @@ -package customLib.inlineFunInLibrary - -public inline fun inlineFun(f: () -> Unit) { - 1 + 1 - inlineFunInner { - 1 + 1 - } -} - -public inline fun inlineFunInner(f: () -> Unit) { - // Breakpoint 2 - 1 + 1 -} diff --git a/idea/testData/debugger/customLibraryForTinyApp/isInsideInlineLambdaInLibrary.kt b/idea/testData/debugger/customLibraryForTinyApp/isInsideInlineLambdaInLibrary.kt deleted file mode 100644 index da24655ed05..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/isInsideInlineLambdaInLibrary.kt +++ /dev/null @@ -1,41 +0,0 @@ -package isInsideInlineLambdaInLibrary - -public fun test() { - val a = A() - //Breakpoint1 - a.foo(1) { 1 } - - // inside other lambda - a.foo(100) { - //Breakpoint2 - a.foo(2) { 1 } - 1 - } - - // inside variable declaration - //Breakpoint3 - val x = a.foo(3) { 1 } - - // inside object declaration - val y = object { - fun foo() { - //Breakpoint4 - a.foo(4) { 1 } - } - } - y.foo() - - // inside local function - fun local() { - //Breakpoint5 - a.foo(5) { 1 } - } - local() -} - -class A { - inline fun foo(i: Int, f: (i: Int) -> Int): A { - f(i) - return this - } -} diff --git a/idea/testData/debugger/customLibraryForTinyApp/localFunCustomLib/localFunCustomLib.kt b/idea/testData/debugger/customLibraryForTinyApp/localFunCustomLib/localFunCustomLib.kt deleted file mode 100644 index 472a1b28568..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/localFunCustomLib/localFunCustomLib.kt +++ /dev/null @@ -1,6 +0,0 @@ -package customLib.localFunInLibraryCustomLib - -public fun localFunInLibraryCustomLibMainFun() { - fun localFun() = 1 - val localFunInLibraryCustomLibProperty = 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/1/a1.kt b/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/1/a1.kt deleted file mode 100644 index c8f530370d1..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/1/a1.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameOneFunSameFileName") -@file:JvmMultifileClass -package customLib.oneFunSameClassName - -public fun oneFunSameFileNameFun(): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/2/a2.kt b/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/2/a2.kt deleted file mode 100644 index 7bfb295cfb2..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/oneFunSameClassName/2/a2.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameOneFunSameFileName") -@file:JvmMultifileClass -package customLib.oneFunSameClassName - -public fun oneFunSameFileNameFun2(): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/property/1/a1.kt b/idea/testData/debugger/customLibraryForTinyApp/property/1/a1.kt deleted file mode 100644 index 5277d7fb203..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/property/1/a1.kt +++ /dev/null @@ -1,6 +0,0 @@ -@file:JvmName("SameNameProperty") -@file:JvmMultifileClass -package customLib.property - -public val foo: Int = - 1 diff --git a/idea/testData/debugger/customLibraryForTinyApp/property/2/a2.kt b/idea/testData/debugger/customLibraryForTinyApp/property/2/a2.kt deleted file mode 100644 index 410596e9568..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/property/2/a2.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameProperty") -@file:JvmMultifileClass -package customLib.property - -public fun someFun(): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/simpleLibFile/simpleLibFile.kt b/idea/testData/debugger/customLibraryForTinyApp/simpleLibFile/simpleLibFile.kt deleted file mode 100644 index dc299322546..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/simpleLibFile/simpleLibFile.kt +++ /dev/null @@ -1,9 +0,0 @@ -package customLib.simpleLibFile - -public fun foo() { - 1 + 1 -} - -class B { - public var prop: Int = 1 -} diff --git a/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/1/a1.kt b/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/1/a1.kt deleted file mode 100644 index a0dcfc14fe4..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/1/a1.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameTwoFunDifferentSignature") -@file:JvmMultifileClass -package customLib.twoFunDifferentSignature - -public fun twoFunDifferentSignatureFun(): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/2/a2.kt b/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/2/a2.kt deleted file mode 100644 index 074d2f30b3f..00000000000 --- a/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/2/a2.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:JvmName("SameNameTwoFunDifferentSignature") -@file:JvmMultifileClass -package customLib.twoFunDifferentSignature - -public fun twoFunDifferentSignatureFun(i: Int): Int { - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/Computable.java b/idea/testData/debugger/tinyApp/src/forTests/Computable.java deleted file mode 100644 index c053d0ef357..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/Computable.java +++ /dev/null @@ -1,5 +0,0 @@ -package forTests; - -public interface Computable { - T compute(); -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/FieldsGetters.java b/idea/testData/debugger/tinyApp/src/forTests/FieldsGetters.java deleted file mode 100644 index b7f9eefefb5..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/FieldsGetters.java +++ /dev/null @@ -1,76 +0,0 @@ -package forTests; - -public class FieldsGetters { - public static class PublicField { - public String foo = "a"; - } - - public static class PackagePrivateField { - String foo = "b"; - } - - public static class ProtectedField { - protected String foo = "c"; - } - - public static class PrivateField { - private String foo = "d"; - } - - public static class PublicFieldGetter { - public final String foo = "a"; - - public String getFoo() { - return "b"; - } - } - - public static class PrivateFieldPublicGetter { - private final String foo = "c"; - - public String getFoo() { - return "d"; - } - } - - public static class PrivateFieldPrivateGetter { - private final String foo = "e"; - - public String getFoo() { - return "f"; - } - } - - public static class PublicGetter1 extends PublicField { - public String getFoo() { - return "g"; - } - } - - public static class PublicGetter2 extends PackagePrivateField { - public String getFoo() { - return "h"; - } - } - - public static class PrivateGetter1 extends PrivateField { - private String getFoo() { - return "g"; - } - } - - public static class PublicGetterOnly { - public String getFoo() { - return "a"; - } - } - - public static class PublicFieldAndGetterInParent extends PublicGetterOnly { - public String foo = "b"; - } - - public abstract class AbstractGetter { - public String foo = "c"; - public abstract String getFoo(); - } -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/MyJavaClass.java b/idea/testData/debugger/tinyApp/src/forTests/MyJavaClass.java deleted file mode 100644 index 8134254faf9..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/MyJavaClass.java +++ /dev/null @@ -1,62 +0,0 @@ -package forTests; - -import org.jetbrains.annotations.NotNull; -import java.util.List; - -public class MyJavaClass { - public void testFun() { - int i = 1; - } - - @NotNull - public String testNotNullFun() { - return "a"; - } - - public static int staticFun(Object s) { - return 1; - } - - public static T runReadAction(@NotNull Computable computation) { - return computation.compute(); - } - - private static class PrivateJavaClass { - public final int prop = 1; - } - - public static class BaseClass { - public final int i2 = 1; - } - - public BaseClass getBaseClassValue() { - return new BaseClass(); - } - public BaseClass getInnerClassValue() { - return new InnerClass(); - } - - public static class InnerClass extends BaseClass { - public final int i = 1; - } - - public static class RawA { - public int foo(List p) { - return 1; - } - } - - public static class RawADerived extends RawA { - - } - - // Method with sam conversion for step into test - public void other(Runnable runnable) { - runnable.run(); - } - - public MyJavaClass() {} - - // Constructor with sam conversion for step into test - public MyJavaClass(Runnable runnable) {} -} diff --git a/idea/testData/debugger/tinyApp/src/forTests/SamConversion.java b/idea/testData/debugger/tinyApp/src/forTests/SamConversion.java deleted file mode 100644 index 2080be6f74a..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/SamConversion.java +++ /dev/null @@ -1,11 +0,0 @@ -package forTests; - -public class SamConversion { - public interface Runnable { - public abstract void run(); - } - - public static void doAction(Runnable runnable) { - runnable.run(); - } -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/inlineFunction2.kt b/idea/testData/debugger/tinyApp/src/forTests/inlineFunction2.kt deleted file mode 100644 index a8f5fb3d6e2..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/inlineFunction2.kt +++ /dev/null @@ -1,8 +0,0 @@ -package inlineFunctionOtherPackage - -inline fun myFun(f: () -> Int): Int = f() - -val String.prop: String - get() { - return "a" - } \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionSameLinesDependent.kt b/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionSameLinesDependent.kt deleted file mode 100644 index 41e7925080c..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionSameLinesDependent.kt +++ /dev/null @@ -1,9 +0,0 @@ -package inlineFunctionSameLines - -inline fun myFun(t: T): Int { - val a = 1 - val b = 2 - val c = 3 - val d = 4 - return 1 -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionWithBreakpoint.kt b/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionWithBreakpoint.kt deleted file mode 100644 index 3610fc8a761..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/inlineFunctionWithBreakpoint.kt +++ /dev/null @@ -1,5 +0,0 @@ -package inlineFunctionWithBreakpoint - -inline fun myFun(f: (Int) -> Unit) { - f(1) -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/javaContext/JavaClass.java b/idea/testData/debugger/tinyApp/src/forTests/javaContext/JavaClass.java deleted file mode 100644 index 63bb9e0618f..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/javaContext/JavaClass.java +++ /dev/null @@ -1,53 +0,0 @@ -package forTests.javaContext; - -import java.util.ArrayList; - -public class JavaClass { - public void simple() { - int breakpoint = 1; - } - - public void localVariable() { - int i = 1; - int breakpoint = 1; - } - - public void block() { - int bodyVal = 1; - if (true) { - int thenVal = 1; - int breakpoint = 1; - } - else { - int elseVal = 1; - } - } - - public void imports() { - ArrayList list = createList(); - int breakpoint = 1; - } - - private ArrayList createList() { - ArrayList list = new ArrayList(); - list.add(1); - list.add(2); - return list; - } - - public void markObject() { - Integer i = 1; - int breakpoint = 1; - } - - public int javaProperty = 1; - private int javaPrivateProperty = 1; - - public void property() { - int breakpoint = 1; - } - - public interface JavaStatic { - static int state() { return 1; } - } -} \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/multiFilePackage.kt b/idea/testData/debugger/tinyApp/src/forTests/multiFilePackage.kt deleted file mode 100644 index 43d1a6bca3b..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/multiFilePackage.kt +++ /dev/null @@ -1,5 +0,0 @@ -@file:JvmMultifileClass -@file:JvmName("NewName") -package multiFilePackage - -inline fun foo(f: () -> Int) = f() \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/forTests/simpleKt.kt b/idea/testData/debugger/tinyApp/src/forTests/simpleKt.kt deleted file mode 100644 index 018a9cca258..00000000000 --- a/idea/testData/debugger/tinyApp/src/forTests/simpleKt.kt +++ /dev/null @@ -1,5 +0,0 @@ -package simple - -// test more than one file for package in JetPositionManager:prepareTypeMapper. the second file in this package is singleBreakpoint/simple.kt -fun foo() { -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractKotlinSteppingTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractKotlinSteppingTest.kt deleted file mode 100644 index 721a19e34ff..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/AbstractKotlinSteppingTest.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger - -import com.intellij.openapi.util.io.FileUtil -import org.jetbrains.kotlin.test.InTextDirectivesUtils -import java.io.File - -abstract class AbstractKotlinSteppingTest : KotlinDebuggerTestBase() { - protected fun doStepIntoTest(path: String) { - doTest(path, "STEP_INTO") - } - - protected fun doStepOutTest(path: String) { - doTest(path, "STEP_OUT") - } - - protected fun doStepOverTest(path: String) { - doTest(path, "STEP_OVER") - } - - protected fun doStepOverForceTest(path: String) { - doTest(path, "STEP_OVER_FORCE") - } - - protected fun doSmartStepIntoTest(path: String) { - doTest(path, "SMART_STEP_INTO") - } - - protected fun doCustomTest(path: String) { - val fileText = FileUtil.loadFile(File(path)) - configureSettings(fileText) - createAdditionalBreakpoints(fileText) - createDebugProcess(path) - - doStepping(path) - - finish() - } - - private fun doTest(path: String, command: String) { - val fileText = FileUtil.loadFile(File(path)) - - configureSettings(fileText) - createAdditionalBreakpoints(fileText) - createDebugProcess(path) - - val prefix = "// $command: " - val count = InTextDirectivesUtils.getPrefixedInt(fileText, prefix) ?: "1" - processSteppingInstruction("$prefix$count") - - finish() - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt deleted file mode 100644 index 2697615a726..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestBase.kt +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger - -import com.intellij.debugger.DebuggerInvocationUtil -import com.intellij.debugger.SourcePosition -import com.intellij.debugger.actions.MethodSmartStepTarget -import com.intellij.debugger.actions.SmartStepTarget -import com.intellij.debugger.engine.BasicStepMethodFilter -import com.intellij.debugger.engine.DebugProcessImpl -import com.intellij.debugger.engine.MethodFilter -import com.intellij.debugger.engine.SuspendContextImpl -import com.intellij.debugger.engine.evaluation.CodeFragmentKind -import com.intellij.debugger.engine.evaluation.EvaluationContextImpl -import com.intellij.debugger.engine.evaluation.TextWithImportsImpl -import com.intellij.debugger.impl.DebuggerContextImpl -import com.intellij.debugger.impl.JvmSteppingCommandProvider -import com.intellij.debugger.impl.PositionUtil -import com.intellij.debugger.settings.DebuggerSettings -import com.intellij.debugger.ui.breakpoints.Breakpoint -import com.intellij.debugger.ui.breakpoints.BreakpointManager -import com.intellij.debugger.ui.breakpoints.LineBreakpoint -import com.intellij.execution.process.ProcessOutputTypes -import com.intellij.openapi.application.ModalityState -import com.intellij.openapi.roots.JdkOrderEntry -import com.intellij.openapi.roots.libraries.LibraryUtil -import com.intellij.openapi.util.io.FileUtil -import com.intellij.openapi.vfs.VirtualFile -import com.intellij.psi.PsiDocumentManager -import com.intellij.psi.PsiFile -import com.intellij.psi.PsiManager -import com.intellij.psi.search.FilenameIndex -import com.intellij.xdebugger.XDebuggerManager -import com.intellij.xdebugger.XDebuggerUtil -import com.intellij.xdebugger.breakpoints.XBreakpointManager -import com.intellij.xdebugger.breakpoints.XBreakpointProperties -import com.intellij.xdebugger.breakpoints.XBreakpointType -import com.intellij.xdebugger.breakpoints.XLineBreakpointType -import com.sun.jdi.request.StepRequest -import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties -import org.jetbrains.java.debugger.breakpoints.properties.JavaLineBreakpointProperties -import org.jetbrains.kotlin.idea.debugger.breakpoints.* -import org.jetbrains.kotlin.idea.debugger.stepping.* -import org.jetbrains.kotlin.idea.util.application.runReadAction -import org.jetbrains.kotlin.idea.util.application.runWriteAction -import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer -import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext -import org.jetbrains.kotlin.test.InTextDirectivesUtils -import org.jetbrains.kotlin.test.InTextDirectivesUtils.findStringWithPrefixes -import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance -import java.io.File -import javax.swing.SwingUtilities - -abstract class KotlinDebuggerTestBase : KotlinDebuggerTestCase() { - private var oldSettings: DebuggerSettings? = null - private var oldIsFilterForStdlibAlreadyAdded = false - private var oldDisableKotlinInternalClasses = false - private var oldRenderDelegatedProperties = false - - @Volatile - protected var _evaluationContext: EvaluationContextImpl? = null - protected val evaluationContext get() = _evaluationContext!! - - @Volatile - protected var _debuggerContext: DebuggerContextImpl? = null - protected val debuggerContext get() = _debuggerContext!! - - @Volatile - protected var _commandProvider: KotlinSteppingCommandProvider? = null - protected val commandProvider get() = _commandProvider!! - - override fun initApplication() { - super.initApplication() - saveDefaultSettings() - } - - override fun tearDown() { - super.tearDown() - - restoreDefaultSettings() - - _evaluationContext = null - _debuggerContext = null - _commandProvider = null - } - - protected fun configureSettings(fileText: String) { - val kotlinSettings = KotlinDebuggerSettings.getInstance() - kotlinSettings.DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED = false - kotlinSettings.DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES = fileText.getValueForSetting("DISABLE_KOTLIN_INTERNAL_CLASSES", oldDisableKotlinInternalClasses) - kotlinSettings.DEBUG_RENDER_DELEGATED_PROPERTIES = fileText.getValueForSetting("RENDER_DELEGATED_PROPERTIES", oldRenderDelegatedProperties) - - val debuggerSettings = DebuggerSettings.getInstance()!! - debuggerSettings.SKIP_SYNTHETIC_METHODS = fileText.getValueForSetting("SKIP_SYNTHETIC_METHODS", oldSettings!!.SKIP_SYNTHETIC_METHODS) - debuggerSettings.SKIP_CONSTRUCTORS = fileText.getValueForSetting("SKIP_CONSTRUCTORS", oldSettings!!.SKIP_CONSTRUCTORS) - debuggerSettings.SKIP_CLASSLOADERS = fileText.getValueForSetting("SKIP_CLASSLOADERS", oldSettings!!.SKIP_CLASSLOADERS) - debuggerSettings.TRACING_FILTERS_ENABLED = fileText.getValueForSetting("TRACING_FILTERS_ENABLED", oldSettings!!.TRACING_FILTERS_ENABLED) - debuggerSettings.SKIP_GETTERS = fileText.getValueForSetting("SKIP_GETTERS", oldSettings!!.SKIP_GETTERS) - - DebuggerUtils.forceRanking = InTextDirectivesUtils.isDirectiveDefined(fileText, "FORCE_RANKING") - } - - private fun String.getValueForSetting(name: String, defaultValue: Boolean): Boolean { - return findStringWithPrefixes(this, "// $name: ")?.toBoolean() ?: defaultValue - } - - private fun saveDefaultSettings() { - oldIsFilterForStdlibAlreadyAdded = KotlinDebuggerSettings.getInstance().DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED - oldDisableKotlinInternalClasses = KotlinDebuggerSettings.getInstance().DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES - oldRenderDelegatedProperties = KotlinDebuggerSettings.getInstance().DEBUG_RENDER_DELEGATED_PROPERTIES - oldSettings = DebuggerSettings.getInstance()!!.clone() - } - - private fun restoreDefaultSettings() { - KotlinDebuggerSettings.getInstance().DEBUG_IS_FILTER_FOR_STDLIB_ALREADY_ADDED = oldIsFilterForStdlibAlreadyAdded - KotlinDebuggerSettings.getInstance().DEBUG_DISABLE_KOTLIN_INTERNAL_CLASSES = oldDisableKotlinInternalClasses - KotlinDebuggerSettings.getInstance().DEBUG_RENDER_DELEGATED_PROPERTIES = oldRenderDelegatedProperties - - val debuggerSettings = DebuggerSettings.getInstance()!! - debuggerSettings.SKIP_SYNTHETIC_METHODS = oldSettings!!.SKIP_SYNTHETIC_METHODS - debuggerSettings.SKIP_CONSTRUCTORS = oldSettings!!.SKIP_CONSTRUCTORS - debuggerSettings.SKIP_CLASSLOADERS = oldSettings!!.SKIP_CLASSLOADERS - debuggerSettings.TRACING_FILTERS_ENABLED = oldSettings!!.TRACING_FILTERS_ENABLED - debuggerSettings.SKIP_GETTERS = oldSettings!!.SKIP_GETTERS - - DebuggerUtils.forceRanking = false - } - - protected val dp: DebugProcessImpl - get() = debugProcess ?: throw AssertionError("createLocalProcess() should be called before getDebugProcess()") - - fun doOnBreakpoint(action: SuspendContextImpl.() -> Unit) { - super.onBreakpoint({ - try { - initContexts(it) - it.printContext() - it.action() - } - catch(e: AssertionError) { - throw e - } - catch(e: Throwable) { - e.printStackTrace() - resume(it) - } - }) - } - - protected fun initContexts(suspendContext: SuspendContextImpl) { - _evaluationContext = createEvaluationContext(suspendContext) - _debuggerContext = createDebuggerContext(suspendContext) - _commandProvider = JvmSteppingCommandProvider.EP_NAME.extensions.firstIsInstance() - } - - protected fun SuspendContextImpl.doStepInto(ignoreFilters: Boolean, smartStepFilter: MethodFilter?) { - val stepIntoCommand = runReadAction { - commandProvider.getStepIntoCommand(this, ignoreFilters, smartStepFilter, StepRequest.STEP_LINE) - } ?: dp.createStepIntoCommand(this, ignoreFilters, smartStepFilter) - dp.managerThread.schedule(stepIntoCommand) - } - - protected fun SuspendContextImpl.doStepOut() { - val stepOutCommand = runReadAction { commandProvider.getStepOutCommand(this, debuggerContext) } - ?: dp.createStepOutCommand(this) - dp.managerThread.schedule(stepOutCommand) - } - - protected fun SuspendContextImpl.doStepOver(ignoreBreakpoints: Boolean = false) { - val stepOverCommand = - runReadAction { commandProvider.getStepOverCommand(this, ignoreBreakpoints, debuggerContext) } ?: - dp.createStepOverCommand(this, ignoreBreakpoints) - dp.managerThread.schedule(stepOverCommand) - } - - protected fun doStepping(path: String) { - val file = File(path) - file.readLines().forEach { - val line = it.trim() - processSteppingInstruction(line) - } - } - - protected fun processSteppingInstruction(line: String) { - fun repeat(indexPrefix: String, f: SuspendContextImpl.() -> Unit) { - for (i in 1..(InTextDirectivesUtils.getPrefixedInt(line, indexPrefix) ?: 1)) { - doOnBreakpoint(f) - } - } - - when { - !line.startsWith("//") -> return - line.startsWith("// STEP_INTO: ") -> repeat("// STEP_INTO: ") { doStepInto(false, null) } - line.startsWith("// STEP_OUT: ") -> repeat("// STEP_OUT: ") { doStepOut() } - line.startsWith("// STEP_OVER: ") -> repeat("// STEP_OVER: ") { doStepOver() } - line.startsWith("// STEP_OVER_FORCE: ") -> repeat("// STEP_OVER_FORCE: ") { doStepOver(true) } - line.startsWith("// SMART_STEP_INTO_BY_INDEX: ") -> doOnBreakpoint { doSmartStepInto(InTextDirectivesUtils.getPrefixedInt(line, "// SMART_STEP_INTO_BY_INDEX: ")!!) } - line.startsWith("// SMART_STEP_INTO: ") -> repeat("// SMART_STEP_INTO: ") { doSmartStepInto() } - line.startsWith("// RESUME: ") -> repeat("// RESUME: ") { resume(this) } - } - } - - protected fun SuspendContextImpl.doSmartStepInto(chooseFromList: Int = 0) { - this.doSmartStepInto(chooseFromList, false) - } - - private fun SuspendContextImpl.doSmartStepInto(chooseFromList: Int, ignoreFilters: Boolean) { - val filters = createSmartStepIntoFilters() - if (chooseFromList == 0) { - filters.forEach { - dp.managerThread!!.schedule(dp.createStepIntoCommand(this, ignoreFilters, it)) - } - } - else { - try { - dp.managerThread!!.schedule(dp.createStepIntoCommand(this, ignoreFilters, filters[chooseFromList - 1])) - } - catch(e: IndexOutOfBoundsException) { - throw AssertionError("Couldn't find smart step into command at: \n" + - runReadAction { debuggerContext.sourcePosition.elementAt.getElementTextWithContext() }, - e) - } - } - } - - private fun createSmartStepIntoFilters(): List { - return runReadAction { - val position = debuggerContext.sourcePosition - - val stepTargets = KotlinSmartStepIntoHandler().findSmartStepTargets(position) - stepTargets.filterIsInstance().mapNotNull { - stepTarget -> - when (stepTarget) { - is KotlinLambdaSmartStepTarget -> - KotlinLambdaMethodFilter( - stepTarget.getLambda(), stepTarget.getCallingExpressionLines()!!, stepTarget.isInline, stepTarget.isSuspend) - is KotlinMethodSmartStepTarget -> - KotlinBasicStepMethodFilter( - stepTarget.declaration?.createSmartPointer(), - stepTarget.isInvoke, - stepTarget.targetMethodName, - stepTarget.getCallingExpressionLines()!!) - is MethodSmartStepTarget -> BasicStepMethodFilter(stepTarget.method, stepTarget.getCallingExpressionLines()) - else -> null - } - } - } - } - - protected fun SuspendContextImpl.printContext() { - runReadAction { - if (this.frameProxy == null) { - return@runReadAction println("Context thread is null", ProcessOutputTypes.SYSTEM) - } - - val sourcePosition = PositionUtil.getSourcePosition(this) - println(renderSourcePosition(sourcePosition), ProcessOutputTypes.SYSTEM) - } - } - - protected fun renderSourcePosition(sourcePosition: SourcePosition?): String { - if (sourcePosition == null) { - return "null" - } - - val virtualFile = sourcePosition.file.originalFile.virtualFile ?: sourcePosition.file.viewProvider.virtualFile ?: - return "VirtualFile for position is null" - - val libraryEntry = LibraryUtil.findLibraryEntry(virtualFile, project) - if (libraryEntry != null && (libraryEntry is JdkOrderEntry || libraryEntry.presentableName == KOTLIN_LIBRARY_NAME)) { - return FileUtil.getNameWithoutExtension(virtualFile.name) + ".!EXT!" - } - - return virtualFile.name + ":" + (sourcePosition.line + 1) - } - - protected fun finish() { - doOnBreakpoint { - resume(this) - } - } - - override fun createBreakpoints(file: PsiFile?) { - if (file == null) return - - val document = runReadAction { PsiDocumentManager.getInstance(myProject).getDocument(file) } ?: return - val breakpointManager = XDebuggerManager.getInstance(myProject).breakpointManager - val kotlinFieldBreakpointType = findBreakpointType(KotlinFieldBreakpointType::class.java) - val virtualFile = file.virtualFile - - val runnable = { - var offset = -1 - while (true) { - val fileText = document.text - offset = fileText.indexOf("point!", offset + 1) - if (offset == -1) break - - val commentLine = document.getLineNumber(offset) - - val comment = fileText.substring(document.getLineStartOffset(commentLine), document.getLineEndOffset(commentLine)).trim() - - val lineIndex = commentLine + 1 - - if (comment.startsWith("//FieldWatchpoint!")) { - val javaBreakpoint = createBreakpointOfType( - breakpointManager, - kotlinFieldBreakpointType, - lineIndex, - virtualFile) - if (javaBreakpoint is KotlinFieldBreakpoint) { - val fieldName = comment.substringAfter("//FieldWatchpoint! (").substringBefore(")") - javaBreakpoint.setFieldName(fieldName) - javaBreakpoint.setWatchAccess(fileText.getValueForSetting("WATCH_FIELD_ACCESS", true)) - javaBreakpoint.setWatchModification(fileText.getValueForSetting("WATCH_FIELD_MODIFICATION", true)) - javaBreakpoint.setWatchInitialization(fileText.getValueForSetting("WATCH_FIELD_INITIALISATION", false)) - BreakpointManager.addBreakpoint(javaBreakpoint) - println("KotlinFieldBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}", ProcessOutputTypes.SYSTEM) - } - } - else if (comment.startsWith("//Breakpoint!")) { - val ordinal = getPropertyFromComment(comment, "lambdaOrdinal")?.toInt() - val condition = getPropertyFromComment(comment, "condition") - createLineBreakpoint(breakpointManager, file, lineIndex, ordinal, condition) - } - else if (comment.startsWith("//FunctionBreakpoint!")) { - createFunctionBreakpoint(breakpointManager, file, lineIndex) - } - else { - throw AssertionError("Cannot create breakpoint at line ${lineIndex + 1}") - } - } - } - - if (!SwingUtilities.isEventDispatchThread()) { - DebuggerInvocationUtil.invokeAndWait(myProject, runnable, ModalityState.defaultModalityState()) - } - else { - runnable.invoke() - } - } - - private fun getPropertyFromComment(comment: String, propertyName: String): String? { - if (comment.contains("$propertyName = ")) { - val result = comment.substringAfter("$propertyName = ") - if (result.contains(", ")) { - return result.substringBefore(", ") - } - if (result.contains(")")) { - return result.substringBefore(")") - } - } - return null - } - - private fun createFunctionBreakpoint(breakpointManager: XBreakpointManager, file: PsiFile, lineIndex: Int) { - val breakpointType = findBreakpointType(KotlinFunctionBreakpointType::class.java) - val breakpoint = createBreakpointOfType(breakpointManager, breakpointType, lineIndex, file.virtualFile) - if (breakpoint is KotlinFunctionBreakpoint) { - println("FunctionBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}", ProcessOutputTypes.SYSTEM) - } - } - - private fun createLineBreakpoint( - breakpointManager: XBreakpointManager, - file: PsiFile, - lineIndex: Int, - lambdaOrdinal: Int?, - condition: String? - ) { - val kotlinLineBreakpointType = findBreakpointType(KotlinLineBreakpointType::class.java) - val javaBreakpoint = createBreakpointOfType( - breakpointManager, - kotlinLineBreakpointType, - lineIndex, - file.virtualFile) - if (javaBreakpoint is LineBreakpoint<*>) { - val properties = javaBreakpoint.xBreakpoint.properties as? JavaLineBreakpointProperties ?: return - var suffix = "" - if (lambdaOrdinal != null) { - if (lambdaOrdinal != -1) { - properties.lambdaOrdinal = lambdaOrdinal - 1 - } - else { - properties.lambdaOrdinal = lambdaOrdinal - } - suffix += " lambdaOrdinal = $lambdaOrdinal" - } - if (condition != null) { - javaBreakpoint.setCondition(TextWithImportsImpl(CodeFragmentKind.EXPRESSION, condition)) - suffix += " condition = $condition" - } - - BreakpointManager.addBreakpoint(javaBreakpoint) - println("LineBreakpoint created at ${file.virtualFile.name}:${lineIndex + 1}$suffix", ProcessOutputTypes.SYSTEM) - } - } - - private fun createBreakpointOfType( - breakpointManager: XBreakpointManager, - breakpointType: XLineBreakpointType>, - lineIndex: Int, - virtualFile: VirtualFile - ): Breakpoint>? { - if (!breakpointType.canPutAt(virtualFile, lineIndex, myProject)) return null - val xBreakpoint = runWriteAction { - breakpointManager.addLineBreakpoint( - breakpointType, - virtualFile.url, - lineIndex, - breakpointType.createBreakpointProperties(virtualFile, lineIndex) - ) - } - return BreakpointManager.getJavaBreakpoint(xBreakpoint) - } - - @Suppress("UNCHECKED_CAST") - private inline fun > findBreakpointType(javaClass: Class): XLineBreakpointType> { - return XDebuggerUtil.getInstance().findBreakpointType(javaClass) as XLineBreakpointType> - } - - protected fun createAdditionalBreakpoints(fileText: String) { - val breakpoints = InTextDirectivesUtils.findLinesWithPrefixesRemoved(fileText, "// ADDITIONAL_BREAKPOINT: ") - for (breakpoint in breakpoints) { - val position = breakpoint.split(".kt:") - assert(position.size == 2) { "Couldn't parse position from test directive: directive = $breakpoint" } - var lineMarker = position[1] - var ordinal: Int? = null - if (lineMarker.contains(":(") && lineMarker.endsWith(")")) { - val lineMarkerAndOrdinal = lineMarker.split(":(") - lineMarker = lineMarkerAndOrdinal[0] - ordinal = lineMarkerAndOrdinal[1].substringBefore(")").toInt() - } - createBreakpoint(position[0], lineMarker, ordinal) - } - } - - private fun createBreakpoint(fileName: String, lineMarker: String, ordinal: Int?) { - val project = project!! - val sourceFiles = runReadAction { - FilenameIndex.getAllFilesByExt(project, "kt").filter { - it.name.contains(fileName) && - it.contentsToByteArray().toString(Charsets.UTF_8).contains(lineMarker) - } - } - - assert(sourceFiles.size == 1) { "One source file should be found: name = $fileName, sourceFiles = $sourceFiles" } - - val runnable = Runnable { - val psiSourceFile = PsiManager.getInstance(project).findFile(sourceFiles.first())!! - - val breakpointManager = XDebuggerManager.getInstance(myProject).breakpointManager - val document = PsiDocumentManager.getInstance(project).getDocument(psiSourceFile)!! - - val index = psiSourceFile.text!!.indexOf(lineMarker) - val lineNumber = document.getLineNumber(index) + 1 // lineMarker is for previous line - - createLineBreakpoint(breakpointManager, psiSourceFile, lineNumber, ordinal, null) - } - - DebuggerInvocationUtil.invokeAndWait(project, runnable, ModalityState.defaultModalityState()) - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java deleted file mode 100644 index fc5872b17ef..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/KotlinDebuggerTestCase.java +++ /dev/null @@ -1,389 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger; - -import com.google.common.collect.Lists; -import com.intellij.compiler.impl.CompilerUtil; -import com.intellij.debugger.impl.DescriptorTestCase; -import com.intellij.debugger.impl.OutputChecker; -import com.intellij.execution.ExecutionTestCase; -import com.intellij.execution.configurations.JavaParameters; -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.ModifiableRootModel; -import com.intellij.openapi.roots.ModuleRootManager; -import com.intellij.openapi.roots.OrderRootType; -import com.intellij.openapi.roots.ui.configuration.libraryEditor.NewLibraryEditor; -import com.intellij.openapi.util.Computable; -import com.intellij.openapi.util.io.FileUtil; -import com.intellij.openapi.vfs.VfsUtil; -import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; -import com.intellij.pom.java.LanguageLevel; -import com.intellij.psi.JavaPsiFacade; -import com.intellij.psi.PsiClass; -import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.testFramework.EdtTestUtil; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.util.indexing.FileBasedIndex; -import com.intellij.xdebugger.XDebugSession; -import kotlin.Unit; -import kotlin.collections.CollectionsKt; -import kotlin.io.FilesKt; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.asJava.classes.FakeLightClassForFileOfPackage; -import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade; -import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; -import org.jetbrains.kotlin.idea.compiler.configuration.Kotlin2JvmCompilerArgumentsHolder; -import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil; -import org.jetbrains.kotlin.idea.test.PluginTestCaseBase; -import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils; -import org.jetbrains.kotlin.name.FqName; -import org.jetbrains.kotlin.psi.KtFile; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.MockLibraryUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.jetbrains.kotlin.test.util.JetTestUtilsKt; -import org.jetbrains.kotlin.utils.ExceptionUtilsKt; -import org.jetbrains.kotlin.utils.PathUtil; -import org.junit.Assert; -import org.junit.ComparisonFailure; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { - private static final String TINY_APP = PluginTestCaseBase.getTestDataPathBase() + "/debugger/tinyApp"; - private static final File TINY_APP_SRC = new File(TINY_APP, "src"); - private static boolean IS_TINY_APP_COMPILED = false; - - // Caches are auto-invalidated when file modification in TINY_APP_SRC detected (through File.lastModified()). - // LOCAL_CACHE_DIR removing can be used to force caches invalidating as well. - private static final boolean LOCAL_CACHE_REUSE = true; - - private static final File LOCAL_CACHE_DIR; - - static { - try { - LOCAL_CACHE_DIR = KotlinTestUtils.tmpDir("debuggerTinyApp"); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - private static final File LOCAL_CACHE_JAR_DIR = new File(LOCAL_CACHE_DIR, "jar"); - private static final File LOCAL_CACHE_APP_DIR = new File(LOCAL_CACHE_DIR, "app"); - private static final File LOCAL_CACHE_LAST_MODIFIED_FILE = new File(LOCAL_CACHE_DIR, "lastModified.txt"); - - private static File CUSTOM_LIBRARY_JAR; - private static final File CUSTOM_LIBRARY_SOURCES = - new File(PluginTestCaseBase.getTestDataPathBase() + "/debugger/customLibraryForTinyApp"); - - protected static final String KOTLIN_LIBRARY_NAME = "KotlinLibrary"; - private static final String CUSTOM_LIBRARY_NAME = "CustomLibrary"; - - @Nullable - private String oldJvmTarget = null; - - @Override - protected OutputChecker initOutputChecker() { - return new KotlinOutputChecker( - this.getClass().getAnnotation(TestMetadata.class).value(), getTestAppPath(), getAppOutputPath()); - } - - @NotNull - @Override - protected String getTestAppPath() { - return TINY_APP; - } - - @SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod") - @Override - protected void setUp() throws Exception { - if (LOCAL_CACHE_REUSE) { - boolean localCacheRebuild = false; - - if (LOCAL_CACHE_DIR.exists()) { - if (isLocalCacheOutdated()) { - System.out.println("-- Local caches outdated --"); - deleteLocalCacheDirectory(true); - localCacheRebuild = true; - } - } - else { - localCacheRebuild = true; - } - - overrideTempOutputDirectory(); - CUSTOM_LIBRARY_JAR = new File(LOCAL_CACHE_DIR, "debuggerCustomLibrary.jar"); - IS_TINY_APP_COMPILED = !localCacheRebuild; - } - - VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()); - if (DexLikeBytecodePatchKt.needDexPatch(getTestName(true))) { - NoStrataPositionManagerHelperKt.setEmulateDexDebugInTests(true); - } - super.setUp(); - - Kotlin2JvmCompilerArgumentsHolder.Companion.getInstance(myProject).update(s -> { - oldJvmTarget = s.getJvmTarget(); - s.setJvmTarget("1.8"); - return Unit.INSTANCE; - }); - } - - private static void deleteLocalCacheDirectory(boolean assertDeleteSuccess) { - System.out.println("-- Remove local cache directory --"); - boolean deleteResult = FilesKt.deleteRecursively(LOCAL_CACHE_DIR); - if (assertDeleteSuccess) { - Assert.assertTrue("Failed to delete local cache!", deleteResult); - } - } - - private static long cachedDataTimeStamp() { - File testDataLastModifiedFile = JetTestUtilsKt.findLastModifiedFile( - TINY_APP_SRC, - file -> FilesKt.getExtension(file).equals("out") || file.isDirectory() - ); - - File distLibLastModifiedFile = JetTestUtilsKt.findLastModifiedFile( - PathUtil.getKotlinPathsForDistDirectory().getLibPath(), file -> false); - - return Math.max(testDataLastModifiedFile.lastModified(), distLibLastModifiedFile.lastModified()); - } - - private static boolean isLocalCacheOutdated() { - if (!LOCAL_CACHE_LAST_MODIFIED_FILE.exists()) return true; - - String text; - try { - text = FileUtil.loadFile(LOCAL_CACHE_LAST_MODIFIED_FILE); - } - catch (IOException e) { - throw ExceptionUtilsKt.rethrow(e); - } - - long cachedFor = Long.parseLong(text); - long currentLastDate = cachedDataTimeStamp(); - - return currentLastDate != cachedFor; - } - - private static void overrideTempOutputDirectory() { - try { - Field ourOutputRootField = ExecutionTestCase.class.getDeclaredField("ourOutputRoot"); - ourOutputRootField.setAccessible(true); - - if (!LOCAL_CACHE_DIR.exists()) { - - LOCAL_CACHE_JAR_DIR.mkdirs(); - LOCAL_CACHE_APP_DIR.mkdirs(); - - boolean result = - LOCAL_CACHE_DIR.exists() && - LOCAL_CACHE_JAR_DIR.exists() && - LOCAL_CACHE_APP_DIR.exists(); - - Assert.assertTrue("Failure on local cache directories creation", result); - - boolean createFileResult = LOCAL_CACHE_LAST_MODIFIED_FILE.createNewFile(); - Assert.assertTrue("Failure on " + LOCAL_CACHE_LAST_MODIFIED_FILE.getName() + " creation", createFileResult); - - long lastModificationDate = cachedDataTimeStamp(); - FileUtil.writeToFile(LOCAL_CACHE_LAST_MODIFIED_FILE, Long.toString(lastModificationDate)); - } - - ourOutputRootField.set(null, LOCAL_CACHE_APP_DIR); - } - catch (NoSuchFieldException | IOException | IllegalAccessException e) { - throw ExceptionUtilsKt.rethrow(e); - } - } - - private static void configureLibrary( - @NotNull ModifiableRootModel model, - @NotNull String libraryName, - @NotNull File classes, - @NotNull File sources - ) { - NewLibraryEditor customLibEditor = new NewLibraryEditor(); - customLibEditor.setName(libraryName); - - customLibEditor.addRoot(VfsUtil.getUrlForLibraryRoot(classes), OrderRootType.CLASSES); - customLibEditor.addRoot(VfsUtil.getUrlForLibraryRoot(sources), OrderRootType.SOURCES); - - ConfigLibraryUtil.INSTANCE.addLibrary(customLibEditor, model, null); - } - - @Override - protected void tearDown() throws Exception { - Kotlin2JvmCompilerArgumentsHolder.Companion.getInstance(myProject).update(s -> { - s.setJvmTarget(oldJvmTarget); - return Unit.INSTANCE; - }); - - if (DexLikeBytecodePatchKt.needDexPatch(getTestName(true))) { - NoStrataPositionManagerHelperKt.setEmulateDexDebugInTests(false); - } - - EdtTestUtil.runInEdtAndWait(() -> { - ConfigLibraryUtil.INSTANCE.removeLibrary(getModule(), CUSTOM_LIBRARY_NAME); - ConfigLibraryUtil.INSTANCE.removeLibrary(getModule(), KOTLIN_LIBRARY_NAME); - }); - - super.tearDown(); - VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()); - } - - @SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod") - @Override - protected void setUpModule() { - super.setUpModule(); - - IdeaTestUtil.setModuleLanguageLevel(myModule, LanguageLevel.JDK_1_8); - - String outputDirPath = getAppOutputPath(); - File outDir = new File(outputDirPath); - - if (!IS_TINY_APP_COMPILED) { - try { - String modulePath = getTestAppPath(); - - //noinspection ConstantConditions - File jarDir = LOCAL_CACHE_REUSE ? LOCAL_CACHE_DIR : KotlinTestUtils.tmpDir("debuggerCustomLibrary"); - - CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), jarDir, "debuggerCustomLibrary"); - - String sourcesDir = modulePath + File.separator + "src"; - - MockLibraryUtil.compileKotlin(sourcesDir, outDir, CollectionsKt.listOf("-jvm-target", "1.8"), CUSTOM_LIBRARY_JAR.getPath()); - - List options = - Arrays.asList("-d", outputDirPath, "-classpath", - ForTestCompileRuntime.runtimeJarForTests().getPath() + File.pathSeparator + - ForTestCompileRuntime.jetbrainsAnnotationsForTests().getPath(), - "-g"); - KotlinTestUtils.compileJavaFiles(findJavaFiles(new File(sourcesDir)), options); - - DexLikeBytecodePatchKt.patchDexTests(outDir); - - IS_TINY_APP_COMPILED = true; - } - catch (Throwable e) { - deleteLocalCacheDirectory(false); - throw new RuntimeException(e); - } - } - - CompilerUtil.refreshOutputRoots(Lists.newArrayList(outputDirPath)); - - ApplicationManager.getApplication().runWriteAction(() -> { - ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel(); - configureLibrary(model, CUSTOM_LIBRARY_NAME, CUSTOM_LIBRARY_JAR, CUSTOM_LIBRARY_SOURCES); - configureLibrary(model, KOTLIN_LIBRARY_NAME, ForTestCompileRuntime.runtimeJarForTests(), new File("libraries/stdlib/src")); - model.commit(); - }); - - if (!outDir.exists()) { - deleteLocalCacheDirectory(false); - Assert.fail("Output directory for module wasn't created: " + outDir.getAbsolutePath()); - } - } - - private static List findJavaFiles(@NotNull File directory) { - List result = new ArrayList<>(); - if (directory.isDirectory()) { - File[] files = directory.listFiles(); - if (files != null) { - for (File file : files) { - if (file.isDirectory()) { - result.addAll(findJavaFiles(file)); - } - else if (file.getName().endsWith(".java")) { - result.add(file); - } - } - } - } - return result; - } - - @Override - protected JavaParameters createJavaParameters(String mainClass) { - JavaParameters parameters = super.createJavaParameters(mainClass); - parameters.getClassPath().add(ForTestCompileRuntime.runtimeJarForTests()); - parameters.getClassPath().add(CUSTOM_LIBRARY_JAR); - return parameters; - } - - @Override - protected void createBreakpoints(String className) { - PsiClass[] psiClasses = ApplicationManager.getApplication().runReadAction( - (Computable) () -> JavaPsiFacade.getInstance(myProject) - .findClasses(className, GlobalSearchScope.allScope(myProject))); - - for (PsiClass psiClass : psiClasses) { - if (psiClass instanceof KtLightClassForFacade) { - Collection files = ((KtLightClassForFacade) psiClass).getFiles(); - for (KtFile jetFile : files) { - createBreakpoints(jetFile); - } - } - else if (psiClass instanceof FakeLightClassForFileOfPackage) { - // skip, because we already create breakpoints using KotlinLightClassForPackage - } - else { - createBreakpoints(psiClass.getContainingFile()); - } - } - } - - @SuppressWarnings("MethodMayBeStatic") - protected void createDebugProcess(@NotNull String path) throws Exception { - File file = new File(path); - //noinspection ConstantConditions - FileBasedIndex.getInstance().requestReindex(VfsUtil.findFileByIoFile(file, true)); - String packageName = file.getName().replace(".kt", ""); - FqName packageFQN = new FqName(packageName); - String mainClassName = PackagePartClassUtils.getPackagePartFqName(packageFQN, file.getName()).asString(); - createLocalProcess(mainClassName); - } - - @Override - protected Sdk getTestProjectJdk() { - return PluginTestCaseBase.fullJdk(); - } - - @Override - protected void checkTestOutput() throws Exception { - if (KotlinTestUtils.isAllFilesPresentTest(getTestName(false))) { - return; - } - - try { - super.checkTestOutput(); - } - catch (ComparisonFailure e) { - KotlinTestUtils.assertEqualsToFile( - new File(this.getClass().getAnnotation(TestMetadata.class).value(), getTestName(true) + ".out"), - e.getActual()); - } - } - - @Override - public Object getData(String dataId) { - if (XDebugSession.DATA_KEY.is(dataId)) { - return myDebuggerSession == null ? null : myDebuggerSession.getXDebugSession(); - } - return super.getData(dataId); - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockLocation.java b/idea/tests/org/jetbrains/kotlin/idea/debugger/MockLocation.java deleted file mode 100644 index a9ef12cdd6d..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockLocation.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger; - -import com.sun.jdi.*; -import org.jetbrains.annotations.NotNull; - -public class MockLocation implements Location { - @NotNull private final ReferenceType declaringType; - @NotNull private final String sourceName; - private final int lineNumber; - - public MockLocation(@NotNull ReferenceType declaringType, @NotNull String sourceName, int lineNumber) { - this.declaringType = declaringType; - this.sourceName = sourceName; - this.lineNumber = lineNumber; - } - - @Override - public ReferenceType declaringType() { - return declaringType; - } - - @Override - public String sourceName() { - return sourceName; - } - - @Override - public int lineNumber() { - return lineNumber; - } - - - @Override - public Method method() { - return new MockMethod(); - } - - @Override - public long codeIndex() { - throw new UnsupportedOperationException(); - } - - @Override - public String sourceName(String s) throws AbsentInformationException { - throw new UnsupportedOperationException(); - } - - @Override - public String sourcePath() throws AbsentInformationException { - throw new AbsentInformationException(); - } - - @Override - public String sourcePath(String s) throws AbsentInformationException { - throw new AbsentInformationException(); - } - - @Override - public int lineNumber(String s) { - throw new UnsupportedOperationException(); - } - - @Override - public int compareTo(Location o) { - throw new UnsupportedOperationException(); - } - - @Override - public VirtualMachine virtualMachine() { - throw new UnsupportedOperationException(); - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockSourcePosition.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/MockSourcePosition.kt deleted file mode 100644 index b6cad548720..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/MockSourcePosition.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger - -import com.intellij.debugger.SourcePosition -import com.intellij.openapi.editor.Editor -import com.intellij.psi.PsiElement -import com.intellij.psi.PsiFile - -class MockSourcePosition( - val _file: PsiFile? = null, - val _elementAt: PsiElement? = null, - val _line: Int? = null, - val _offset: Int? = null, - val _editor: Editor? = null -): SourcePosition() { - override fun getFile() = _file ?: throw UnsupportedOperationException("Parameter file isn't set for MockSourcePosition") - override fun getElementAt() = _elementAt ?: throw UnsupportedOperationException("Parameter elementAt isn't set for MockSourcePosition") - override fun getLine() = _line ?: throw UnsupportedOperationException("Parameter line isn't set for MockSourcePosition") - override fun getOffset() = _offset ?: throw UnsupportedOperationException("Parameter offset isn't set for MockSourcePosition") - override fun openEditor(requestFocus: Boolean) = _editor ?: throw UnsupportedOperationException("Parameter editor isn't set for MockSourcePosition") - - override fun navigate(requestFocus: Boolean) = throw UnsupportedOperationException("navigate() isn't supported for MockSourcePosition") - override fun canNavigate() = throw UnsupportedOperationException("canNavigate() isn't supported for MockSourcePosition") - override fun canNavigateToSource() = throw UnsupportedOperationException("canNavigateToSource() isn't supported for MockSourcePosition") -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentAutoImportTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentAutoImportTest.kt new file mode 100644 index 00000000000..516f9f93c53 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentAutoImportTest.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.evaluate + +import org.jetbrains.kotlin.checkers.AbstractPsiCheckerTest +import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor +import org.jetbrains.kotlin.psi.KtCodeFragment +import org.jetbrains.kotlin.test.KotlinTestUtils +import java.io.File +import kotlin.test.assertNull + +abstract class AbstractCodeFragmentAutoImportTest : AbstractPsiCheckerTest() { + override fun doTest(filePath: String) { + myFixture.configureByCodeFragment(filePath) + myFixture.doHighlighting() + + val importFix = myFixture.availableIntentions.singleOrNull { it.familyName == "Import" } + ?: error("No import fix available") + importFix.invoke(project, editor, file) + + myFixture.checkResultByFile("$filePath.after") + + val fragment = myFixture.file as KtCodeFragment + fragment.checkImports(testDataPath + File.separator + filePath) + + val fixAfter = myFixture.availableIntentions.firstOrNull { it.familyName == "Import" } + assertNull(fixAfter, "No import fix should be available after") + } + + override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE + override fun getTestDataPath() = KotlinTestUtils.getHomeDirectory() +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionHandlerTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionHandlerTest.kt new file mode 100644 index 00000000000..4f9fecc94f3 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionHandlerTest.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.evaluate + +import com.intellij.codeInsight.completion.CompletionType +import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractCompletionHandlerTest +import org.jetbrains.kotlin.psi.KtCodeFragment + +abstract class AbstractCodeFragmentCompletionHandlerTest : AbstractCompletionHandlerTest(CompletionType.BASIC) { + override fun setUpFixture(testPath: String) { + myFixture.configureByCodeFragment(testPath) + } + + override fun doTest(testPath: String) { + super.doTest(testPath) + + val fragment = myFixture.file as KtCodeFragment + fragment.checkImports(testPath) + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionTest.kt new file mode 100644 index 00000000000..b383827ce41 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentCompletionTest.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.evaluate + +import org.jetbrains.kotlin.idea.completion.test.AbstractJvmBasicCompletionTest + +abstract class AbstractCodeFragmentCompletionTest : AbstractJvmBasicCompletionTest() { + override fun setUpFixture(testPath: String) { + myFixture.configureByCodeFragment(testPath) + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentHighlightingTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentHighlightingTest.kt new file mode 100644 index 00000000000..ba2ab37af90 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractCodeFragmentHighlightingTest.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.evaluate + +import com.intellij.codeInspection.InspectionProfileEntry +import com.intellij.openapi.util.io.FileUtil +import org.jetbrains.kotlin.checkers.AbstractPsiCheckerTest +import org.jetbrains.kotlin.idea.caches.resolve.resolveImportReference +import org.jetbrains.kotlin.idea.util.ImportInsertHelper +import org.jetbrains.kotlin.idea.util.application.executeWriteCommand +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.test.InTextDirectivesUtils +import java.io.File + +abstract class AbstractCodeFragmentHighlightingTest : AbstractPsiCheckerTest() { + override fun doTest(filePath: String) { + myFixture.configureByCodeFragment(filePath) + checkHighlighting(filePath) + } + + fun doTestWithImport(filePath: String) { + myFixture.configureByCodeFragment(filePath) + + project.executeWriteCommand("Imports insertion") { + val fileText = FileUtil.loadFile(File(filePath), true) + val file = myFixture.file as KtFile + InTextDirectivesUtils.findListWithPrefixes(fileText, "// IMPORT: ").forEach { + val descriptor = file.resolveImportReference(FqName(it)).singleOrNull() + ?: error("Could not resolve descriptor to import: $it") + ImportInsertHelper.getInstance(project).importDescriptor(file, descriptor) + } + } + + checkHighlighting(filePath) + } + + private fun checkHighlighting(filePath: String) { + val inspectionName = InTextDirectivesUtils.findStringWithPrefixes(File(filePath).readText(), "// INSPECTION_CLASS: ") + if (inspectionName != null) { + val inspection = Class.forName(inspectionName).newInstance() as InspectionProfileEntry + myFixture.enableInspections(inspection) + try { + myFixture.checkHighlighting(true, false, false) + } finally { + myFixture.disableInspections(inspection) + } + return + } + + myFixture.checkHighlighting(true, false, false) + } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractEditorForEvaluateExpressionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractEditorForEvaluateExpressionTest.kt deleted file mode 100644 index b4c55b038e3..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractEditorForEvaluateExpressionTest.kt +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger.evaluate - -import com.intellij.codeInsight.completion.CompletionType -import com.intellij.codeInspection.InspectionProfileEntry -import com.intellij.openapi.util.io.FileUtil -import com.intellij.openapi.util.text.StringUtil -import com.intellij.psi.PsiElement -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture -import org.jetbrains.kotlin.checkers.AbstractPsiCheckerTest -import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent -import org.jetbrains.kotlin.idea.caches.resolve.resolveImportReference -import org.jetbrains.kotlin.idea.completion.test.AbstractJvmBasicCompletionTest -import org.jetbrains.kotlin.idea.completion.test.ExpectedCompletionUtils -import org.jetbrains.kotlin.idea.completion.test.handlers.AbstractCompletionHandlerTest -import org.jetbrains.kotlin.idea.debugger.getContextElement -import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor -import org.jetbrains.kotlin.idea.util.ImportInsertHelper -import org.jetbrains.kotlin.idea.util.application.executeWriteCommand -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.resolve.BindingContext -import org.jetbrains.kotlin.test.InTextDirectivesUtils -import org.jetbrains.kotlin.test.KotlinTestUtils -import java.io.File -import kotlin.test.assertNull -import kotlin.test.assertTrue - -abstract class AbstractCodeFragmentHighlightingTest : AbstractPsiCheckerTest() { - override fun doTest(filePath: String) { - myFixture.configureByCodeFragment(filePath) - checkHighlighting(filePath) - } - - fun doTestWithImport(filePath: String) { - myFixture.configureByCodeFragment(filePath) - - project.executeWriteCommand("Imports insertion") { - val fileText = FileUtil.loadFile(File(filePath), true) - val file = myFixture.file as KtFile - InTextDirectivesUtils.findListWithPrefixes(fileText, "// IMPORT: ").forEach { - val descriptor = file.resolveImportReference(FqName(it)).singleOrNull() - ?: error("Could not resolve descriptor to import: $it") - ImportInsertHelper.getInstance(project).importDescriptor(file, descriptor) - } - } - - checkHighlighting(filePath) - } - - private fun checkHighlighting(filePath: String) { - val inspectionName = InTextDirectivesUtils.findStringWithPrefixes(File(filePath).readText(), "// INSPECTION_CLASS: ") - if (inspectionName != null) { - val inspection = Class.forName(inspectionName).newInstance() as InspectionProfileEntry - myFixture.enableInspections(inspection) - try { - myFixture.checkHighlighting(true, false, false) - } finally { - myFixture.disableInspections(inspection) - } - return - } - - myFixture.checkHighlighting(true, false, false) - } -} - -abstract class AbstractCodeFragmentCompletionTest : AbstractJvmBasicCompletionTest() { - override fun setUpFixture(testPath: String) { - myFixture.configureByCodeFragment(testPath) - } -} - -abstract class AbstractCodeFragmentCompletionHandlerTest : AbstractCompletionHandlerTest(CompletionType.BASIC) { - override fun setUpFixture(testPath: String) { - myFixture.configureByCodeFragment(testPath) - } - - override fun doTest(testPath: String) { - super.doTest(testPath) - - val fragment = myFixture.file as KtCodeFragment - fragment.checkImports(testPath) - } -} - -abstract class AbstractCodeFragmentAutoImportTest : AbstractPsiCheckerTest() { - override fun doTest(filePath: String) { - myFixture.configureByCodeFragment(filePath) - myFixture.doHighlighting() - - val importFix = myFixture.availableIntentions.singleOrNull { it.familyName == "Import" } - ?: error("No import fix available") - importFix.invoke(project, editor, file) - - myFixture.checkResultByFile("$filePath.after") - - val fragment = myFixture.file as KtCodeFragment - fragment.checkImports(testDataPath + File.separator + filePath) - - val fixAfter = myFixture.availableIntentions.firstOrNull { it.familyName == "Import" } - assertNull(fixAfter, "No import fix should be available after") - } - - override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE - override fun getTestDataPath() = KotlinTestUtils.getHomeDirectory() -} - -private fun KtCodeFragment.checkImports(testPath: String) { - val importList = importsAsImportList() - val importsText = StringUtil.convertLineSeparators(importList?.text ?: "") - val fragmentAfterFile = File("$testPath.after.imports") - - if (fragmentAfterFile.exists()) { - KotlinTestUtils.assertEqualsToFile(fragmentAfterFile, importsText) - } else { - assertTrue(importsText.isEmpty(), "Unexpected imports found: $importsText") - } -} - -private fun JavaCodeInsightTestFixture.configureByCodeFragment(filePath: String) { - configureByFile(filePath) - - val elementAt = file?.findElementAt(caretOffset) - val file = createCodeFragment(filePath, elementAt!!) - - val typeStr = InTextDirectivesUtils.findStringWithPrefixes(getFile().text, "// ${ExpectedCompletionUtils.RUNTIME_TYPE} ") - if (typeStr != null) { - file.putCopyableUserData(KtCodeFragment.RUNTIME_TYPE_EVALUATOR) { - val codeFragment = KtPsiFactory(project).createBlockCodeFragment( - "val xxx: $typeStr", - PsiTreeUtil.getParentOfType(elementAt, KtElement::class.java) - ) - val context = codeFragment.analyzeWithContent() - val typeReference: KtTypeReference = - PsiTreeUtil.getChildOfType(codeFragment.getContentElement().firstChild, KtTypeReference::class.java)!! - context[BindingContext.TYPE, typeReference] - } - } - - configureFromExistingVirtualFile(file.virtualFile!!) -} - -private fun createCodeFragment(filePath: String, contextElement: PsiElement): KtCodeFragment { - val fileForFragment = File("$filePath.fragment") - val codeFragmentText = FileUtil.loadFile(fileForFragment, true).trim() - val psiFactory = KtPsiFactory(contextElement.project) - if (fileForFragment.readLines().size == 1) { - return psiFactory.createExpressionCodeFragment(codeFragmentText, getContextElement(contextElement)) - } - return psiFactory.createBlockCodeFragment(codeFragmentText, getContextElement(contextElement)) -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt deleted file mode 100644 index 7070d55914c..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/AbstractKotlinEvaluateExpressionTest.kt +++ /dev/null @@ -1,531 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.idea.debugger.evaluate - -import com.intellij.debugger.SourcePosition -import com.intellij.debugger.engine.* -import com.intellij.debugger.engine.evaluation.CodeFragmentKind -import com.intellij.debugger.engine.evaluation.EvaluateException -import com.intellij.debugger.engine.evaluation.TextWithImports -import com.intellij.debugger.engine.evaluation.TextWithImportsImpl -import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilderImpl -import com.intellij.debugger.engine.events.SuspendContextCommandImpl -import com.intellij.debugger.settings.NodeRendererSettings -import com.intellij.debugger.ui.impl.watch.* -import com.intellij.debugger.ui.tree.* -import com.intellij.execution.process.ProcessOutputTypes -import com.intellij.openapi.application.ApplicationManager -import com.intellij.openapi.application.ModalityState -import com.intellij.openapi.util.Disposer -import com.intellij.openapi.util.io.FileUtil -import com.intellij.psi.PsiExpression -import com.intellij.xdebugger.impl.XDebugSessionImpl -import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl -import com.intellij.xdebugger.impl.frame.XDebugViewSessionListener -import com.intellij.xdebugger.impl.frame.XVariablesView -import com.intellij.xdebugger.impl.frame.XWatchesViewImpl -import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants -import com.intellij.xdebugger.impl.ui.tree.ValueMarkup -import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree -import com.intellij.xdebugger.impl.ui.tree.nodes.* -import com.sun.jdi.ObjectReference -import org.apache.log4j.AppenderSkeleton -import org.apache.log4j.Level -import org.apache.log4j.Logger -import org.apache.log4j.spi.LoggingEvent -import org.jetbrains.eval4j.ObjectValue -import org.jetbrains.eval4j.Value -import org.jetbrains.eval4j.jdi.asValue -import org.jetbrains.kotlin.idea.KotlinFileType -import org.jetbrains.kotlin.idea.debugger.* -import org.jetbrains.kotlin.idea.debugger.evaluate.AbstractKotlinEvaluateExpressionTest.PrinterConfig.DescriptorViewOptions -import org.jetbrains.kotlin.idea.util.application.runReadAction -import org.jetbrains.kotlin.test.InTextDirectivesUtils.* -import org.junit.Assert -import java.io.File -import java.util.* -import javax.swing.tree.TreeNode - -abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() { - private val logger = Logger.getLogger(KotlinDebuggerCaches::class.java)!! - - private var appender: AppenderSkeleton? = null - - private var oldLogLevel: Level? = null - private var oldShowKotlinVariables: Boolean = false - private var oldShowFqTypeNames = false - private var oldRenderDelegatedPropertiesState = false - - override fun setUp() { - super.setUp() - - val classRenderer = NodeRendererSettings.getInstance()!!.classRenderer!! - oldShowFqTypeNames = classRenderer.SHOW_FQ_TYPE_NAMES - classRenderer.SHOW_FQ_TYPE_NAMES = true - - oldShowKotlinVariables = ToggleKotlinVariablesState.getService().kotlinVariableView - - oldRenderDelegatedPropertiesState = KotlinDebuggerSettings.getInstance().DEBUG_RENDER_DELEGATED_PROPERTIES - - oldLogLevel = logger.level - logger.level = Level.DEBUG - - appender = object : AppenderSkeleton() { - override fun append(event: LoggingEvent?) { - println(event?.renderedMessage, ProcessOutputTypes.SYSTEM) - } - - override fun close() {} - override fun requiresLayout() = false - } - - logger.addAppender(appender) - } - - override fun tearDown() { - ToggleKotlinVariablesState.getService().kotlinVariableView = oldShowKotlinVariables - - KotlinDebuggerSettings.getInstance().DEBUG_RENDER_DELEGATED_PROPERTIES = oldRenderDelegatedPropertiesState - - logger.level = oldLogLevel - logger.removeAppender(appender) - - appender = null - oldLogLevel = null - - NodeRendererSettings.getInstance()!!.classRenderer!!.SHOW_FQ_TYPE_NAMES = oldShowFqTypeNames - - super.tearDown() - } - - fun doSingleBreakpointTest(path: String) { - val file = File(path) - val fileText = FileUtil.loadFile(file, true) - - configureSettings(fileText) - createAdditionalBreakpoints(fileText) - - val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ") - - val blocks = findFilesWithBlocks(file).map { FileUtil.loadFile(it, true) } - val expectedBlockResults = blocks.map { findLinesWithPrefixesRemoved(it, "// RESULT: ").joinToString("\n") } - - createDebugProcess(path) - - val printFrameHandler = PrintFrameHandler(fileText) - - doStepping(path) - - doOnBreakpoint { - val exceptions = linkedMapOf() - try { - createMarkers(fileText) - - for ((expression, expected) in expressions) { - mayThrow(exceptions, expression) { - evaluate(expression, CodeFragmentKind.EXPRESSION, expected) - } - } - - for ((i, block) in blocks.withIndex()) { - mayThrow(exceptions, block) { - evaluate(block, CodeFragmentKind.CODE_BLOCK, expectedBlockResults[i]) - } - } - } finally { - printFrameHandler.trigger(this@doOnBreakpoint) - } - - checkExceptions(exceptions) - } - - finish() - } - - fun doMultipleBreakpointsTest(path: String) { - val file = File(path) - val fileText = FileUtil.loadFile(file, true) - - createAdditionalBreakpoints(fileText) - - createDebugProcess(path) - - val printFrameHandler = PrintFrameHandler(fileText) - - val expressions = loadTestDirectivesPairs(fileText, "// EXPRESSION: ", "// RESULT: ") - - val exceptions = linkedMapOf() - for ((expression, expected) in expressions) { - mayThrow(exceptions, expression) { - doOnBreakpoint { - try { - evaluate(expression, CodeFragmentKind.EXPRESSION, expected) - } finally { - printFrameHandler.trigger(this@doOnBreakpoint) - } - } - } - } - - checkExceptions(exceptions) - finish() - } - - private inner class PrintFrameHandler(fileText: String) { - private val shouldPrintFrame = isDirectiveDefined(fileText, "// PRINT_FRAME") - private val skipInPrintFrame = if (shouldPrintFrame) findListWithPrefixes(fileText, "// SKIP: ") else emptyList() - private val descriptorViewOptions = - DescriptorViewOptions.valueOf(findStringWithPrefixes(fileText, "// DESCRIPTOR_VIEW_OPTIONS: ") ?: "FULL") - - private val kotlinVariablesState: ToggleKotlinVariablesState - private val oldKotlinVariablesState: Boolean - - private lateinit var variablesView: XVariablesView - private lateinit var watchesView: XWatchesViewImpl - - init { - ApplicationManager.getApplication().invokeAndWait( - { - variablesView = createVariablesView() - watchesView = createWatchesView() - }, ModalityState.any() - ) - - kotlinVariablesState = ToggleKotlinVariablesState.getService() - oldKotlinVariablesState = kotlinVariablesState.kotlinVariableView - - kotlinVariablesState.kotlinVariableView = isDirectiveDefined(fileText, "// SHOW_KOTLIN_VARIABLES") - - KotlinDebuggerSettings.getInstance().DEBUG_RENDER_DELEGATED_PROPERTIES = - isDirectiveDefined(fileText, "// RENDER_DELEGATED_PROPERTIES") - } - - fun trigger(suspendContext: SuspendContextImpl) { - if (shouldPrintFrame) { - suspendContext.printFrame(variablesView, watchesView, PrinterConfig(skipInPrintFrame, descriptorViewOptions)) - } else { - resume(suspendContext) - } - } - } - - private fun createWatchesView(): XWatchesViewImpl { - val session = myDebuggerSession.xDebugSession as XDebugSessionImpl - val watchesView = XWatchesViewImpl(session, false) - Disposer.register(testRootDisposable, watchesView) - XDebugViewSessionListener.attach(watchesView, session) - return watchesView - } - - private fun createVariablesView(): XVariablesView { - val session = myDebuggerSession.xDebugSession as XDebugSessionImpl - val variablesView = XVariablesView(session) - Disposer.register(testRootDisposable, variablesView) - XDebugViewSessionListener.attach(variablesView, session) - return variablesView - } - - private fun SuspendContextImpl.printFrame(variablesView: XVariablesView, watchesView: XWatchesViewImpl, config: PrinterConfig) { - val tree = variablesView.tree - expandAll( - tree, - { - try { - Printer(config).printTree(tree) - - for (extra in getExtraVars()) { - watchesView.addWatchExpression(XExpressionImpl.fromText(extra.text), -1, false) - } - Printer(config).printTree(watchesView.tree) - } - finally { - resume(this) - } - }, - hashSetOf(), - // TODO why this is needed? Otherwise some tests are never ended - { it !is XValueNodeImpl || it.name != "cause" }, - this - ) - } - - fun getExtraVars(): Set { - return KotlinFrameExtraVariablesProvider().collectVariables(debuggerContext.sourcePosition, evaluationContext, hashSetOf()) - } - - internal class PrinterConfig( - val variablesToSkipInPrintFrame: List = emptyList(), - val viewOptions: DescriptorViewOptions = DescriptorViewOptions.FULL - ) { - enum class DescriptorViewOptions { - FULL, - NAME_EXPRESSION, - NAME_EXPRESSION_RESULT - } - - fun shouldRenderSourcesPosition(): Boolean { - return when (viewOptions) { - DescriptorViewOptions.FULL -> true - else -> false - } - } - - fun shouldRenderExpression(): Boolean { - return when { - viewOptions.toString().contains("EXPRESSION") -> true - else -> false - } - } - - fun renderLabel(node: TreeNode, descriptor: NodeDescriptorImpl): String { - return when { - descriptor is WatchItemDescriptor -> descriptor.calcValueName() - viewOptions.toString().contains("NAME") -> (node as? XValueNodeImpl)?.name ?: descriptor.name ?: descriptor.label - else -> descriptor.label - } - } - - fun shouldComputeResultOfCreateExpression(): Boolean { - return viewOptions == DescriptorViewOptions.NAME_EXPRESSION_RESULT - } - } - - private inner class Printer(private val config: PrinterConfig) { - fun printTree(tree: XDebuggerTree) { - val root = tree.treeModel.root as TreeNode - printNode(root, 0) - } - - private fun printNode(node: TreeNode, indent: Int) { - val descriptor = when { - node is DebuggerTreeNodeImpl -> node.descriptor - node is XValueNodeImpl -> (node.valueContainer as? JavaValue)?.descriptor ?: MessageDescriptor(node.text.toString()) - node is XStackFrameNode -> (node.valueContainer as? JavaStackFrame)?.descriptor - node is XValueGroupNodeImpl -> (node.valueContainer as? JavaStaticGroup)?.descriptor - node is WatchesRootNode -> null - node is WatchNodeImpl -> WatchItemDescriptor(project, TextWithImportsImpl(CodeFragmentKind.EXPRESSION, node.expression.expression)) - node is MessageTreeNode -> MessageDescriptor(node.text.toString()) - else -> MessageDescriptor(node.toString()) - } - - if (descriptor != null && printDescriptor(node, descriptor, indent)) return - - printChildren(node, indent + 2) - } - - fun printDescriptor(node: TreeNode, descriptor: NodeDescriptorImpl, indent: Int): Boolean { - if (descriptor is DefaultNodeDescriptor) return true - if (config.variablesToSkipInPrintFrame.contains(descriptor.name)) return true - - var label = config.renderLabel(node, descriptor) - - // TODO: update presentation before calc label - if (label == NodeDescriptorImpl.UNKNOWN_VALUE_MESSAGE && descriptor is StaticDescriptor) { - label = "static = " + NodeRendererSettings.getInstance().classRenderer.renderTypeName(descriptor.type.name()) - } - if (label.endsWith(XDebuggerUIConstants.COLLECTING_DATA_MESSAGE)) return true - - val builder = StringBuilder() - - with(builder) { - append(" ".repeat(indent + 1)) - append(getPrefix(descriptor)) - append(label) - if (config.shouldRenderSourcesPosition() && hasSourcePosition(descriptor)) { - val sp = debugProcess.invokeInManagerThread { - SourcePositionProvider.getSourcePosition(descriptor, myProject, debuggerContext) - } - append(" (sp = ${render(sp)})") - } - - if (config.shouldRenderExpression() && descriptor is ValueDescriptorImpl) { - val expression = debugProcess.invokeInManagerThread { - descriptor.getTreeEvaluation((node as XValueNodeImpl).valueContainer as JavaValue, it) as? PsiExpression - } - - if (expression != null) { - val text = TextWithImportsImpl(expression) - val imports = expression.getUserData(DebuggerTreeNodeExpression.ADDITIONAL_IMPORTS_KEY)?.joinToString { it } ?: "" - - val codeFragment = KotlinCodeFragmentFactory().createPresentationCodeFragment( - TextWithImportsImpl(text.kind, text.text, text.imports + imports, text.fileType), - debuggerContext.sourcePosition.elementAt, project - ) - val codeFragmentText = codeFragment.text - - if (config.shouldComputeResultOfCreateExpression()) { - debugProcess.invokeInManagerThread { - it.suspendContext?.evaluate( - TextWithImportsImpl(text.kind, codeFragmentText, codeFragment.importsToString(), text.fileType), - null) - } - } - - append(" (expression = $codeFragmentText)") - } - } - append("\n") - } - - logDescriptor(descriptor, builder.toString()) - - return false - } - - private fun getPrefix(descriptor: NodeDescriptorImpl): String { - val prefix = when (descriptor) { - is StackFrameDescriptor -> "frame" - is WatchItemDescriptor -> "extra" - is LocalVariableDescriptor -> "local" - is StaticDescriptor -> "static" - is ThisDescriptorImpl -> "this" - is FieldDescriptor -> "field" - is ArrayElementDescriptor -> "element" - is MessageDescriptor -> "" - else -> "unknown" - } - return prefix + " ".repeat("unknown ".length - prefix.length) + if (descriptor is MessageDescriptor) " - " else " = " - } - - private fun hasSourcePosition(descriptor: NodeDescriptorImpl): Boolean { - return when (descriptor) { - is LocalVariableDescriptor, - is FieldDescriptor -> true - else -> false - } - } - - private fun printChildren(node: TreeNode, indent: Int) { - val e = node.children() - while (e.hasMoreElements()) { - printNode(e.nextElement() as TreeNode, indent) - } - } - - private fun render(sp: SourcePosition?): String { - return renderSourcePosition(sp).replace(":", ", ") - } - } - - private fun checkExceptions(exceptions: MutableMap) { - if (!exceptions.isEmpty()) { - for (exc in exceptions.values) { - exc.printStackTrace() - } - throw AssertionError("Test failed:\n" + exceptions.map { "expression: ${it.key}, exception: ${it.value.message}" }.joinToString("\n")) - } - } - - private fun mayThrow(map: MutableMap, expression: String, f: () -> Unit) { - try { - f() - } - catch (e: Throwable) { - map.put(expression, e) - } - } - - private fun loadTestDirectivesPairs(fileContent: String, directivePrefix: String, expectedPrefix: String): List> { - val directives = findLinesWithPrefixesRemoved(fileContent, directivePrefix) - val expected = findLinesWithPrefixesRemoved(fileContent, expectedPrefix) - assert(directives.size == expected.size) { "Sizes of test directives are different" } - return directives.zip(expected) - } - - private fun findFilesWithBlocks(mainFile: File): List { - val mainFileName = mainFile.name - return mainFile.parentFile?.listFiles()?.filter { it.name.startsWith(mainFileName) && it.name != mainFileName } ?: Collections.emptyList() - } - - private fun createMarkers(fileText: String) { - val labelsAsText = findLinesWithPrefixesRemoved(fileText, "// DEBUG_LABEL: ") - if (labelsAsText.isEmpty()) return - - val markupMap = NodeDescriptorImpl.getMarkupMap(debugProcess) - - for (labelAsText in labelsAsText) { - val labelParts = labelAsText.split("=") - assert(labelParts.size == 2) { "Wrong format for DEBUG_LABEL directive: // DEBUG_LABEL: {localVariableName} = {labelText}" } - val localVariableName = labelParts[0].trim() - val labelName = labelParts[1].trim() - val localVariable = debuggerContext.frameProxy!!.visibleVariableByName(localVariableName) - assert(localVariable != null) { "Couldn't find localVariable for label: name = $localVariableName" } - val localVariableValue = debuggerContext.frameProxy!!.getValue(localVariable) as? ObjectReference - assert(localVariableValue != null) { "Local variable $localVariableName should be an ObjectReference" } - localVariableValue!! - markupMap?.put(localVariableValue, ValueMarkup(labelName, null, labelName)) - } - } - - private fun SuspendContextImpl.evaluate(text: String, codeFragmentKind: CodeFragmentKind, expectedResult: String?) { - return evaluate(TextWithImportsImpl(codeFragmentKind, text, "", KotlinFileType.INSTANCE), expectedResult) - } - - private fun SuspendContextImpl.evaluate(item: TextWithImportsImpl, expectedResult: String?) { - val sourcePosition = ContextUtil.getSourcePosition(this) - val contextElement = ContextUtil.getContextElement(debuggerContext)!! - - assert(KotlinCodeFragmentFactory().isContextAccepted(contextElement)) { - val text = runReadAction { contextElement.text } - "KotlinCodeFragmentFactory should be accepted for context element otherwise default evaluator will be called. " + - "ContextElement = $text" - } - - contextElement.putCopyableUserData( - KotlinCodeFragmentFactory.DEBUG_CONTEXT_FOR_TESTS, - this@AbstractKotlinEvaluateExpressionTest.debuggerContext - ) - - runActionInSuspendCommand { - try { - val evaluator = runReadAction { EvaluatorBuilderImpl.build(item, contextElement, sourcePosition, project) } - ?: throw AssertionError("Cannot create an Evaluator for Evaluate Expression") - - val value = evaluator.evaluate(this@AbstractKotlinEvaluateExpressionTest.evaluationContext) - val actualResult = value.asValue().asString() - if (expectedResult != null) { - Assert.assertEquals( - "Evaluate expression returns wrong result for ${item.text}:\n" + - "expected = $expectedResult\n" + - "actual = $actualResult\n", - expectedResult, actualResult) - } - } catch (e: EvaluateException) { - val expectedMessage = e.message?.replaceFirst(ID_PART_REGEX, "id=ID") - Assert.assertEquals( - "Evaluate expression throws wrong exception for ${item.text}:\n" + - "expected = $expectedResult\n" + - "actual = $expectedMessage\n", - expectedResult, expectedMessage) - } - } - } - - private fun SuspendContextImpl.runActionInSuspendCommand(action: SuspendContextImpl.() -> Unit) { - if (myInProgress) { - action() - } - else { - val command = object : SuspendContextCommandImpl(this) { - override fun contextAction(suspendContext: SuspendContextImpl) { - action(suspendContext) - } - } - - // Try to execute the action inside a command if we aren't already inside it. - debuggerContext.debugProcess?.managerThread?.invoke(command) ?: command.contextAction(this) - } - } - - private fun Value.asString(): String { - if (this is ObjectValue && this.value is ObjectReference) { - return this.toString().replaceFirst(ID_PART_REGEX, "id=ID") - } - return this.toString() - } -} - -private val ID_PART_REGEX = "id=[0-9]*".toRegex() \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/CodeFragmentTestUtils.kt b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/CodeFragmentTestUtils.kt new file mode 100644 index 00000000000..6dde00a4170 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/debugger/evaluate/CodeFragmentTestUtils.kt @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.debugger.evaluate + +import com.intellij.openapi.util.io.FileUtil +import com.intellij.openapi.util.text.StringUtil +import com.intellij.psi.PsiElement +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture +import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent +import org.jetbrains.kotlin.idea.completion.test.ExpectedCompletionUtils +import org.jetbrains.kotlin.idea.debugger.getContextElement +import org.jetbrains.kotlin.psi.KtCodeFragment +import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtPsiFactory +import org.jetbrains.kotlin.psi.KtTypeReference +import org.jetbrains.kotlin.resolve.BindingContext +import org.jetbrains.kotlin.test.InTextDirectivesUtils +import org.jetbrains.kotlin.test.KotlinTestUtils +import java.io.File +import kotlin.test.assertTrue + +internal fun KtCodeFragment.checkImports(testPath: String) { + val importList = importsAsImportList() + val importsText = StringUtil.convertLineSeparators(importList?.text ?: "") + val fragmentAfterFile = File("$testPath.after.imports") + + if (fragmentAfterFile.exists()) { + KotlinTestUtils.assertEqualsToFile(fragmentAfterFile, importsText) + } else { + assertTrue(importsText.isEmpty(), "Unexpected imports found: $importsText") + } +} + +internal fun JavaCodeInsightTestFixture.configureByCodeFragment(filePath: String) { + configureByFile(filePath) + + val elementAt = file?.findElementAt(caretOffset) + val file = createCodeFragment(filePath, elementAt!!) + + val typeStr = InTextDirectivesUtils.findStringWithPrefixes(getFile().text, "// ${ExpectedCompletionUtils.RUNTIME_TYPE} ") + if (typeStr != null) { + file.putCopyableUserData(KtCodeFragment.RUNTIME_TYPE_EVALUATOR) { + val codeFragment = KtPsiFactory(project).createBlockCodeFragment( + "val xxx: $typeStr", + PsiTreeUtil.getParentOfType(elementAt, KtElement::class.java) + ) + val context = codeFragment.analyzeWithContent() + val typeReference: KtTypeReference = + PsiTreeUtil.getChildOfType(codeFragment.getContentElement().firstChild, KtTypeReference::class.java)!! + context[BindingContext.TYPE, typeReference] + } + } + + configureFromExistingVirtualFile(file.virtualFile!!) +} + +internal fun createCodeFragment(filePath: String, contextElement: PsiElement): KtCodeFragment { + val fileForFragment = File("$filePath.fragment") + val codeFragmentText = FileUtil.loadFile(fileForFragment, true).trim() + val psiFactory = KtPsiFactory(contextElement.project) + if (fileForFragment.readLines().size == 1) { + return psiFactory.createExpressionCodeFragment(codeFragmentText, getContextElement(contextElement)) + } + return psiFactory.createBlockCodeFragment(codeFragmentText, getContextElement(contextElement)) +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt.193 b/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt.193 deleted file mode 100644 index 6e90195b119..00000000000 --- a/idea/tests/org/jetbrains/kotlin/idea/debugger/sequence/KotlinPsiChainBuilderTestCase.kt.193 +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ -package org.jetbrains.kotlin.idea.debugger.sequence - -import com.intellij.debugger.streams.test.StreamChainBuilderTestCase -import com.intellij.debugger.streams.wrapper.StreamChain -import com.intellij.debugger.streams.wrapper.StreamChainBuilder -import com.intellij.openapi.application.ApplicationManager -import com.intellij.openapi.projectRoots.Sdk -import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable -import com.intellij.testFramework.LightPlatformTestCase -import com.intellij.testFramework.PsiTestUtil -import junit.framework.TestCase -import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime -import org.jetbrains.kotlin.idea.caches.project.LibraryModificationTracker -import org.jetbrains.kotlin.idea.test.PluginTestCaseBase -import java.io.File -import java.nio.file.Paths - -abstract class KotlinPsiChainBuilderTestCase(private val relativePath: String) : StreamChainBuilderTestCase() { - override fun getTestDataPath(): String = - Paths.get(File("").absolutePath, "idea/testData/debugger/sequence/psi/$relativeTestPath/").toString() - - override fun getFileExtension(): String = ".kt" - abstract val kotlinChainBuilder: StreamChainBuilder - override fun getChainBuilder(): StreamChainBuilder = kotlinChainBuilder - private val stdLibName = "kotlin-stdlib" - - protected abstract fun doTest() - - final override fun getRelativeTestPath(): String = relativePath - - override fun setUp() { - super.setUp() - ApplicationManager.getApplication().runWriteAction { - if (ProjectLibraryTable.getInstance(project).getLibraryByName(stdLibName) == null) { - val stdLibPath = ForTestCompileRuntime.runtimeJarForTests() - PsiTestUtil.addLibrary( - testRootDisposable, - module, - stdLibName, - stdLibPath.parent, - stdLibPath.name - ) - } - } - LibraryModificationTracker.getInstance(project).incModificationCount() - } - - - override fun getProjectJDK(): Sdk { - return PluginTestCaseBase.mockJdk9() - } - - abstract class Positive(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) { - override fun doTest() { - val chains = buildChains() - checkChains(chains) - } - - private fun checkChains(chains: MutableList) { - TestCase.assertFalse(chains.isEmpty()) - } - } - - abstract class Negative(relativePath: String) : KotlinPsiChainBuilderTestCase(relativePath) { - override fun doTest() { - val elementAtCaret = configureAndGetElementAtCaret() - TestCase.assertFalse(chainBuilder.isChainExists(elementAtCaret)) - TestCase.assertTrue(chainBuilder.build(elementAtCaret).isEmpty()) - } - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/AbstractQuickDocProviderTest.java b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/AbstractQuickDocProviderTest.java index ac6f1944261..4bec92b2692 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/AbstractQuickDocProviderTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/editor/quickDoc/AbstractQuickDocProviderTest.java @@ -42,7 +42,7 @@ public abstract class AbstractQuickDocProviderTest extends KotlinLightCodeInsigh File testDataFile = new File(path); String textData = FileUtil.loadFile(testDataFile, true); - List directives = InTextDirectivesUtils.findLinesWithPrefixesRemoved(textData, false, "INFO:"); + List directives = InTextDirectivesUtils.findLinesWithPrefixesRemoved(textData, false, true, "INFO:"); if (directives.isEmpty()) { throw new FileComparisonFailure( diff --git a/idea/tests/org/jetbrains/kotlin/idea/kdoc/KDocSampleTest.kt b/idea/tests/org/jetbrains/kotlin/idea/kdoc/KDocSampleTest.kt index 65db4c65eb4..205940c4f04 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/kdoc/KDocSampleTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/kdoc/KDocSampleTest.kt @@ -101,7 +101,7 @@ class KDocSampleTest : AbstractMultiModuleTest() { } val textData = FileUtil.loadFile(testDataFile, true) - val directives = InTextDirectivesUtils.findLinesWithPrefixesRemoved(textData, false, "INFO:") + val directives = InTextDirectivesUtils.findLinesWithPrefixesRemoved(textData, false, true, "INFO:") if (directives.isEmpty()) { throw FileComparisonFailure( diff --git a/settings.gradle b/settings.gradle index e8105ca20f3..f57dbacf26a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -118,6 +118,7 @@ include ":kotlin-build-common", ":idea:jvm-debugger:jvm-debugger-core", ":idea:jvm-debugger:jvm-debugger-evaluation", ":idea:jvm-debugger:jvm-debugger-sequence", + ":idea:jvm-debugger:jvm-debugger-test", ":j2k", ":idea:idea-j2k", ":nj2k",