use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class AntRunner method runTestsOnEmulator.
public String runTestsOnEmulator() {
System.out.println("Running tests...");
RunResult result = RunUtils.execute(generateCommandLine("test"));
String resultOutput = result.getOutput();
OutputUtils.checkResult(result);
return resultOutput;
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class Emulator method finishProcess.
//Only for Unix
private static void finishProcess(String processName) {
if (SystemInfo.isUnix) {
GeneralCommandLine pidOfProcess = new GeneralCommandLine();
pidOfProcess.setExePath("pidof");
pidOfProcess.addParameter(processName);
RunResult runResult = RunUtils.execute(pidOfProcess);
String processIdsStr = runResult.getOutput().substring(("pidof " + processName).length());
List<String> processIds = StringUtil.getWordsIn(processIdsStr);
for (String pid : processIds) {
GeneralCommandLine killCommand = new GeneralCommandLine();
killCommand.setExePath("kill");
killCommand.addParameter("-s");
killCommand.addParameter("9");
killCommand.addParameter(pid);
RunUtils.execute(killCommand);
}
}
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class Emulator method stopDdmsProcess.
//Only for Unix
private static void stopDdmsProcess() {
if (SystemInfo.isUnix) {
GeneralCommandLine listOfEmulatorProcess = new GeneralCommandLine();
listOfEmulatorProcess.setExePath("sh");
listOfEmulatorProcess.addParameter("-c");
listOfEmulatorProcess.addParameter("ps aux | grep emulator");
RunResult runResult = RunUtils.execute(listOfEmulatorProcess);
OutputUtils.checkResult(runResult);
String pidFromPsCommand = OutputUtils.getPidFromPsCommand(runResult.getOutput());
if (pidFromPsCommand != null) {
GeneralCommandLine killCommand = new GeneralCommandLine();
killCommand.setExePath("kill");
killCommand.addParameter(pidFromPsCommand);
RunUtils.execute(killCommand);
}
}
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class Emulator method waitEmulatorStart.
public void waitEmulatorStart() {
System.out.println("Waiting for emulator start...");
OutputUtils.checkResult(RunUtils.execute(getWaitCommand()));
GeneralCommandLine bootCheckCommand = createAdbCommand();
bootCheckCommand.addParameter("shell");
bootCheckCommand.addParameter("getprop");
bootCheckCommand.addParameter("sys.boot_completed");
int counter = 0;
RunResult execute = RunUtils.execute(bootCheckCommand);
while (counter < 12) {
String output = execute.getOutput();
if (output.trim().endsWith("1")) {
System.out.println("Emulator fully booted!");
return;
}
System.out.println("Waiting for emulator boot (" + counter + ")...");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
counter++;
execute = RunUtils.execute(bootCheckCommand);
}
Assert.fail("Can't find booted emulator: " + execute.getOutput());
}
use of org.jetbrains.kotlin.android.tests.run.RunResult in project kotlin by JetBrains.
the class GradleRunner method connectedDebugAndroidTest.
public String connectedDebugAndroidTest() {
System.out.println("Starting tests...");
RunResult result = RunUtils.execute(generateCommandLine("connectedAndroidTest"));
return result.getOutput();
}
Aggregations