From 8d9f17d09d832cc8c72b02b3c5440d2de3c3d1c6 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Mon, 20 Oct 2014 18:21:26 +0400 Subject: [PATCH] Reconfigure KotlinDebuggerTestCase It is hiding a problem: evaluate expression fails in libraries --- .../breakpointOnLocalProperty/1/1.kt | 0 .../breakpointOnLocalProperty/2/1.kt | 0 .../oneFunSameFileName/1/1.kt | 0 .../oneFunSameFileName/2/1.kt | 0 .../property/1/1.kt | 0 .../property/2/1.kt | 0 .../simpleLibFile/simpleLibFile.kt | 0 .../twoFunDifferentSignature/1/1.kt | 0 .../twoFunDifferentSignature/2/1.kt | 0 .../jet/plugin/debugger/KotlinDebuggerTestCase.java | 12 +++++------- 10 files changed, 5 insertions(+), 7 deletions(-) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/breakpointOnLocalProperty/1/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/breakpointOnLocalProperty/2/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/oneFunSameFileName/1/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/oneFunSameFileName/2/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/property/1/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/property/2/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/simpleLibFile/simpleLibFile.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/twoFunDifferentSignature/1/1.kt (100%) rename idea/testData/debugger/{tinyApp/customLibrary => customLibraryForTinyApp}/twoFunDifferentSignature/2/1.kt (100%) diff --git a/idea/testData/debugger/tinyApp/customLibrary/breakpointOnLocalProperty/1/1.kt b/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/1/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/breakpointOnLocalProperty/1/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/1/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/breakpointOnLocalProperty/2/1.kt b/idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/2/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/breakpointOnLocalProperty/2/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/breakpointOnLocalProperty/2/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/oneFunSameFileName/1/1.kt b/idea/testData/debugger/customLibraryForTinyApp/oneFunSameFileName/1/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/oneFunSameFileName/1/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/oneFunSameFileName/1/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/oneFunSameFileName/2/1.kt b/idea/testData/debugger/customLibraryForTinyApp/oneFunSameFileName/2/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/oneFunSameFileName/2/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/oneFunSameFileName/2/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/property/1/1.kt b/idea/testData/debugger/customLibraryForTinyApp/property/1/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/property/1/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/property/1/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/property/2/1.kt b/idea/testData/debugger/customLibraryForTinyApp/property/2/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/property/2/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/property/2/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/simpleLibFile/simpleLibFile.kt b/idea/testData/debugger/customLibraryForTinyApp/simpleLibFile/simpleLibFile.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/simpleLibFile/simpleLibFile.kt rename to idea/testData/debugger/customLibraryForTinyApp/simpleLibFile/simpleLibFile.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/twoFunDifferentSignature/1/1.kt b/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/1/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/twoFunDifferentSignature/1/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/1/1.kt diff --git a/idea/testData/debugger/tinyApp/customLibrary/twoFunDifferentSignature/2/1.kt b/idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/2/1.kt similarity index 100% rename from idea/testData/debugger/tinyApp/customLibrary/twoFunDifferentSignature/2/1.kt rename to idea/testData/debugger/customLibraryForTinyApp/twoFunDifferentSignature/2/1.kt diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java index aa2a8cd8188..47767e3cbea 100644 --- a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java @@ -56,7 +56,7 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { private static boolean IS_TINY_APP_COMPILED = false; private static File CUSTOM_LIBRARY_JAR; - private final File CUSTOM_LIBRARY_SOURCES = new File(getTestAppPath() + "/customLibrary"); + private final File CUSTOM_LIBRARY_SOURCES = new File(PluginTestCaseBase.getTestDataPathBase() + "/debugger/customLibraryForTinyApp"); private final ProjectDescriptorWithStdlibSources projectDescriptor = ProjectDescriptorWithStdlibSources.INSTANCE; @@ -88,9 +88,7 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { VirtualFile customLibrarySources = VfsUtil.findFileByIoFile(CUSTOM_LIBRARY_SOURCES, false); assert customLibrarySources != null : "VirtualFile for customLibrary sources should be found"; - model.getContentEntries()[0].addExcludeFolder(customLibrarySources); - - configureCustomLibrary(model); + configureCustomLibrary(model, customLibrarySources); model.commit(); } @@ -99,13 +97,13 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { }); } - private static void configureCustomLibrary(@NotNull ModifiableRootModel model) { + private static void configureCustomLibrary(@NotNull ModifiableRootModel model, @NotNull VirtualFile customLibrarySources) { NewLibraryEditor customLibEditor = new NewLibraryEditor(); customLibEditor.setName("CustomLibrary"); String customLibraryRoot = VfsUtil.getUrlForLibraryRoot(CUSTOM_LIBRARY_JAR); customLibEditor.addRoot(customLibraryRoot, OrderRootType.CLASSES); - customLibEditor.addRoot(customLibraryRoot + "/src", OrderRootType.SOURCES); + customLibEditor.addRoot(customLibrarySources, OrderRootType.SOURCES); ConfigLibraryUtil.addLibrary(customLibEditor, model); } @@ -122,7 +120,7 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase { if (!IS_TINY_APP_COMPILED) { String modulePath = getTestAppPath(); - CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), "debuggerCustomLibrary", true); + CUSTOM_LIBRARY_JAR = MockLibraryUtil.compileLibraryToJar(CUSTOM_LIBRARY_SOURCES.getPath(), "debuggerCustomLibrary", false); String outputDir = modulePath + File.separator + "classes"; String sourcesDir = modulePath + File.separator + "src";