-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(ci): added android tests (#16)
- Loading branch information
1 parent
e042b16
commit e7a426d
Showing
9 changed files
with
897 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
adb uninstall id.animo.example.android || true | ||
adb install -r "$1" | ||
adb logcat -c | ||
adb shell am start -a android.intent.action.MAIN -n "id.animo.example.android/android.app.NativeActivity" | ||
|
||
sleep 30 | ||
sleep 10 | ||
|
||
adb logcat RustStdoutStderr:D '*:S' | tee ~/logcat.log | ||
LOG=$(adb logcat -d RustStdoutStderr:D '*:S') | ||
HAS_STARTED=$(echo $LOG | grep 'RustStdoutStderr') | ||
HAS_ERROR=$(echo $LOG | grep 'panicked') | ||
|
||
if grep 'RustStdoutStderr' ~/logcat.log; | ||
then | ||
if [ -n "$HAS_STARTED" ]; then | ||
echo "App running" | ||
else | ||
echo "::error:: App not running" | ||
exit 1 | ||
fi | ||
|
||
MSG=$(grep -e 'panicked' "$HOME"/logcat.log) | ||
if [ -z "${MSG}" ]; then | ||
if [ -n "$HAS_ERROR" ]; then | ||
cat $LOG | ||
echo "::error:: Rust panicked! Tests failed. Logs will be uploaded" | ||
exit 1 | ||
else | ||
echo "::success:: All tests passed!" | ||
exit 0 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.