Commit 64fac6d2 authored by Aneta Steimarova's avatar Aneta Steimarova

#691 added TODO for Android iTest runner

parent 7357f419
......@@ -261,3 +261,52 @@ idea {
}
}
}
//TODO make android iTest runner like in desktop->build.gradle
/*task runAndroidITestBundle(type: Exec) {
int testsCount = 0;
int successfulTestsCount = 0;
def iTestOutputPath = "${libsDir}/iTest_results/"
println "${libsDir}"
def iTestOutputFile = new File(iTestOutputPath)
if (iTestOutputFile.exists()) {
println "[iTest] REMOVING OLD iTest OUTPUT DIRECTORY"
iTestOutputFile.deleteDir()
}
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}
def adb = path + "/platform-tools/adb"
new File("${project(':itest').projectDir}/iTestBundle.txt").eachLine { iTestName ->
testsCount++
println "[iTest] STARTING TEST: " + iTestName
commandLine "$adb", 'shell', 'am', 'start', '-a', 'android.intent.action.MAIN', '-n', 'cz.nic.tablexia.itest/cz.nic.tablexia.android.AndroidITestLauncher', '-e', 'testClassName', iTestName
//TODO wait until test finished - shell: "$(adb shell ps | grep tablexia.itest | wc -l)" != "1"
commandLine "$adb", 'pull', '/sdcard/$testDir $tablexia/$android'
commandLine "$adb", 'shell', 'rm', '-r', '/sdcard/$testDir'
println "[iTest] TEST: " + iTestName + " FINISHED"
}*/
//TODO make counting files work
/*iTestOutputFile.traverse(type : FileType.FILES, nameFilter: ~/OK_.*\.log/) { iTestLog ->
successfulTestsCount++;
}*/
/* if (testsCount != successfulTestsCount) throw new GradleException("Failed to complete all iTests! Check iTest log files in: \'${iTestOutputPath}\'")
}*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment