From ab792a587cf3cff9c7ff75418ef8b17cf0b634e5 Mon Sep 17 00:00:00 2001 From: "Natalia.Ukhorskaya" Date: Tue, 26 Feb 2013 19:46:11 +0400 Subject: [PATCH] Android tests: do not call adb emu kill (throws exception if there are more than 1 emulator) --- .../jet/compiler/emulator/Emulator.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java b/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java index 5c12919a685..c8dd61174cd 100644 --- a/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java +++ b/compiler/android-tests/src/org/jetbrains/jet/compiler/emulator/Emulator.java @@ -19,6 +19,7 @@ package org.jetbrains.jet.compiler.emulator; import com.intellij.execution.configurations.GeneralCommandLine; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; +import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.compiler.OutputUtils; import org.jetbrains.jet.compiler.PathManager; import org.jetbrains.jet.compiler.ThreadUtils; @@ -83,20 +84,17 @@ public class Emulator { return commandLine; } + @Nullable private GeneralCommandLine getStopCommand() { - GeneralCommandLine commandLine = new GeneralCommandLine(); if (SystemInfo.isWindows) { + GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.setExePath("taskkill"); commandLine.addParameter("/F"); commandLine.addParameter("/IM"); commandLine.addParameter("emulator-arm.exe"); + return commandLine; } - else { - commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/adb"); - commandLine.addParameter("emu"); - commandLine.addParameter("kill"); - } - return commandLine; + return null; } public void createEmulator() { @@ -118,7 +116,9 @@ public class Emulator { public void stopEmulator() { System.out.println("Stopping emulator..."); - OutputUtils.checkResult(RunUtils.execute(getStopCommand())); + if (SystemInfo.isWindows) { + OutputUtils.checkResult(RunUtils.execute(getStopCommand())); + } finishProcess("emulator-arm"); }