From b9ed52e6306581bfe02745cf3684f82ac1ee8168 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Wed, 9 Apr 2014 16:32:12 +0400 Subject: [PATCH] Debugger: compile TINY_APP in test once --- .gitignore | 1 + .../debugger/KotlinDebuggerTestCase.java | 20 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index ecff4e2f26a..7c15e279fb2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ pluginPublisher/plugin-verifier.jar tmp workspace.xml *.versionsBackup +idea/testData/debugger/tinyApp/classes* diff --git a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java index 8796acce79c..dcfdd648720 100644 --- a/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java +++ b/idea/tests/org/jetbrains/jet/plugin/debugger/KotlinDebuggerTestCase.java @@ -47,8 +47,7 @@ import java.io.File; public abstract class KotlinDebuggerTestCase extends DebuggerTestCase { protected static final String TINY_APP = PluginTestCaseBase.getTestDataPathBase() + "/debugger/tinyApp"; - - private File outputDir; + private static boolean IS_TINY_APP_COMPILED = false; @Override protected OutputChecker initOutputChecker() { @@ -87,19 +86,14 @@ public abstract class KotlinDebuggerTestCase extends DebuggerTestCase { } - @Override - public void tearDown() throws Exception { - super.tearDown(); - if (outputDir != null && outputDir.exists()) { - FileUtil.delete(outputDir); - } - } - @Override protected void ensureCompiledAppExists() throws Exception { - String modulePath = getTestAppPath(); - outputDir = new File(modulePath + File.separator + "classes"); - MockLibraryUtil.compileKotlin(modulePath + File.separator + "src", outputDir); + if (!IS_TINY_APP_COMPILED) { + String modulePath = getTestAppPath(); + MockLibraryUtil.compileKotlin(modulePath + File.separator + "src", new File(modulePath + File.separator + "classes")); + //noinspection AssignmentToStaticFieldFromInstanceMethod + IS_TINY_APP_COMPILED = true; + } } private static class KotlinOutputChecker extends OutputChecker {