Commit 6bfb0960 authored by Aneta Steimarova's avatar Aneta Steimarova

#691 Added task dependency on 'assembleITest', shell script for running tests on Android removed

parent b3a582b3
......@@ -297,7 +297,7 @@ def runTest(String iTestName) {
println "[iTest] Test " + iTestName + " timed out."
}
task runAndroidITestBundle {
task runAndroidITestBundle (dependsOn:'assembleITest'){
doLast{
int testsCount = 0;
int successfulTestsCount = 0;
......
# Copyright (C) 2016 CZ.NIC, z.s.p.o. (http://www.nic.cz/)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#!/bin/bash
tablexia=$(dirname $0)/..;
testDir=iTest_results;
android=android/build/outputs/apk/$testDir;
mkdir -p $tablexia/$android;
adb shell rm -r /sdcard/$testDir;
for testName in $(cat $tablexia/itest/iTestBundle.txt);
do
adb logcat -c;
adb shell am start -a android.intent.action.MAIN -n cz.nic.tablexia.itest/cz.nic.tablexia.android.AndroidITestLauncher -e testClassName $testName;
timeout=0;
while (( $timeout < 1200 ));
do
if [ "$(adb shell ps | grep tablexia.itest | wc -l)" != "1" ]
then break;
fi;
status=$(adb shell ls /sdcard/iTest_results | grep ".log" | cut -d_ -f1);
if [ "$status" != "PROCESSING" ]
then break;
fi;
sleep 1;
timeout=$timeout+1;
done;
if (( $timeout >= 1200 ))
then adb shell ps | tablexia.itest | awk '{print $2}' | xargs adb shell kill;
echo "Test timeouted, something bad occured. Running next test.";
fi;
adb pull /sdcard/$testDir $tablexia/$android;
adb shell rm -r /sdcard/$testDir;
echo "Test "$testName" finished with status "$status".";
done;
exit 0;
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