forked from aludmila-gdev/kranberry-sample
-
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.
@knludi Step 8 - Include a makefile to run the tests from the termina…
…l command line
- Loading branch information
1 parent
ab36808
commit 1525eb5
Showing
1 changed file
with
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
### BUILD #### | ||
buildDebug: | ||
./gradlew assembleDebug | ||
|
||
buildAndroidTestDebug: | ||
./gradlew assembleDebugAndroidTest | ||
|
||
### INSTALL ### | ||
installDebug: | ||
adb install app/build/outputs/apk/debug/app-debug.apk | ||
|
||
installAndroidTestDebug: | ||
adb install app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk | ||
|
||
buildInstallDebug: buildDebug installDebug | ||
|
||
### TEST ### | ||
testDebug: | ||
./gradlew testDebug | ||
|
||
testFileDebug: | ||
./gradlew testDebug --tests $(file) | ||
|
||
androidTestDebug: | ||
./gradlew connectedDebugAndroidTest | ||
|
||
androidTestDebugModule: | ||
./gradlew :$(module):connectedDebugAndroidTest | ||
|
||
androidTestFileDebugModule: | ||
./gradlew :$(module):connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=$(file) | ||
|
||
clear-logcat-logs: | ||
@adb shell logcat -b all -c | ||
|
||
copy-tests-outputs: | ||
@rm -rf kranberry-outputs; \ | ||
mkdir kranberry-outputs; \ | ||
adb pull /storage/emulated/0/Android/media/io.kranberry.sample kranberry-outputs; \ | ||
|
||
### RUN UI TESTS ### | ||
# before run tests make sure to call: buildDebug buildAndroidTestDebug installDebug installAndroidTestDebug | ||
test: buildDebug buildAndroidTestDebug installDebug installAndroidTestDebug clear-logcat-logs | ||
@adb logcat *:S KRANBERRY_LOG:V & LOGCAT_PID=$$!; \ | ||
TERM=dumb adb shell am instrument -w io.kranberry.sample.test/androidx.test.runner.AndroidJUnitRunner ; \ | ||
RESULT=$$?; \ | ||
if [ -n "$$LOGCAT_PID" ]; then kill $$LOGCAT_PID; fi; \ | ||
exit $$RESULT | ||
|
||
run-kranberry: | ||
@make test && make copy-tests-outputs |