From a0e518870d732a056af7cbd01625770eb34dbbec Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Mon, 13 Oct 2014 17:36:18 +0400 Subject: [PATCH] Fix Android tests --- .../jet/compiler/CodegenTestsOnAndroidRunner.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java b/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java index ffb660c694a..b6effc86a55 100644 --- a/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java +++ b/compiler/android-tests/src/org/jetbrains/jet/compiler/CodegenTestsOnAndroidRunner.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.compiler; +import com.intellij.util.PlatformUtils; import junit.framework.TestCase; import junit.framework.TestSuite; import org.jetbrains.annotations.NotNull; @@ -181,9 +182,11 @@ public class CodegenTestsOnAndroidRunner { PermissionManager.setPermissions(pathManager); - antRunner.packLibraries(); + String platformPrefixProperty = System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, "Idea"); try { + antRunner.packLibraries(); + emulator.createEmulator(); emulator.startEmulator(); @@ -207,6 +210,12 @@ public class CodegenTestsOnAndroidRunner { throw e; } finally { + if (platformPrefixProperty != null) { + System.setProperty(PlatformUtils.PLATFORM_PREFIX_KEY, platformPrefixProperty); + } + else { + System.clearProperty(PlatformUtils.PLATFORM_PREFIX_KEY); + } emulator.finishEmulatorProcesses(); } }