mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-16 00:21:26 +00:00
Ability to run tests via adb
This commit is contained in:
@@ -98,6 +98,7 @@ public class CodegenTestsOnAndroidRunner {
|
||||
|
||||
try {
|
||||
emulator.waitEmulatorStart();
|
||||
//runTestsViaAdb(emulator, gradleRunner);
|
||||
return gradleRunner.connectedDebugAndroidTest();
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
@@ -123,6 +124,14 @@ public class CodegenTestsOnAndroidRunner {
|
||||
}
|
||||
}
|
||||
|
||||
private String runTestsViaAdb(Emulator emulator, GradleRunner gradleRunner) {
|
||||
gradleRunner.installDebugAndroidTest();
|
||||
String result = emulator.runTestsViaAdb();
|
||||
System.out.println(result);
|
||||
gradleRunner.uninstallDebugAndroidTest();
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<TestCase> parseSingleReportInFolder(String reportFolder) throws
|
||||
IOException,
|
||||
SAXException,
|
||||
|
||||
@@ -50,6 +50,17 @@ public class GradleRunner {
|
||||
OutputUtils.checkResult(result);
|
||||
}
|
||||
|
||||
public void installDebugAndroidTest() {
|
||||
System.out.println("Install tests...");
|
||||
OutputUtils.checkResult(RunUtils.execute(generateCommandLine("installDebug")));
|
||||
OutputUtils.checkResult(RunUtils.execute(generateCommandLine("installDebugAndroidTest")));
|
||||
}
|
||||
|
||||
public void uninstallDebugAndroidTest() {
|
||||
System.out.println("Uninstall tests...");
|
||||
RunUtils.execute(generateCommandLine("uninstallDebugAndroidTest"));
|
||||
RunUtils.execute(generateCommandLine("uninstallDebug"));
|
||||
}
|
||||
|
||||
public String connectedDebugAndroidTest() {
|
||||
System.out.println("Starting tests...");
|
||||
|
||||
Reference in New Issue
Block a user