Skip to content

Instantly share code, notes, and snippets.

@jordifierro
Created April 26, 2016 14:06
Show Gist options
  • Save jordifierro/41ed328fb55280604ac945b375d25e2f to your computer and use it in GitHub Desktop.
Save jordifierro/41ed328fb55280604ac945b375d25e2f to your computer and use it in GitHub Desktop.
#!/bin/sh
exec 5>&1
androidTestResult=$(adb shell "am instrument -w \
com.jordifierro.androidbase.presentation.test/\
com.jordifierro.androidbase.presentation.TestMockerRunner ; printf \"$?\"" \
| tee /dev/fd/5)
exitCode=$(printf "%s" "$androidTestResult" | tail -1)
if [ "$exitCode" != "0" ]; then
echo "\nStatus code error!"
exit 1
fi
if echo "$androidTestResult" | grep -q -e "Error" -e "Process crashed"; then
echo "\nSome error ocurred!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment