kiwix-android/contrib/instrumentation.sh
MohitMaliFtechiz 87632c5f6a Fixed ZimHostFragment which is failing on API level 33.
* Improved the permission.
* Enabled wifi programmatically in emulator.
* Improved test case for showing "Wifi connection dialog".
2024-01-14 19:08:31 +05:30

28 lines
591 B
Bash

#!/usr/bin/env bash
# Enable Wi-Fi on the emulator
adb shell svc wifi enable
adb logcat -c
adb logcat ./*:E -v color &
retry=0
while [ $retry -le 3 ]
do
if ./gradlew jacocoInstrumentationTestReport; then
echo "jacocoInstrumentationTestReport succeeded" >&2
break
else
adb kill-server
adb start-server
# Enable Wi-Fi on the emulator
adb shell svc wifi enable
adb logcat -c
adb logcat ./*:E -v color &
./gradlew clean
retry=$(( retry + 1 ))
if [ $retry -eq 3 ]; then
adb exec-out screencap -p >screencap.png
exit 1
fi
fi
done