mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Update build.sh
This commit is contained in:
49
build.sh
49
build.sh
@@ -199,15 +199,20 @@ uninstall_test_apk() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fetch_images() {
|
fetch_images() {
|
||||||
rm -rf tmp/test-screenshots > /dev/null
|
rm -rf tmp/test-screenshots > /dev/null
|
||||||
mkdir -p tmp/
|
mkdir -p tmp/
|
||||||
adb pull /sdcard/Android/data/org.isoron.uhabits/files/test-screenshots tmp/
|
$ADB pull /mnt/sdcard/test-screenshots/ tmp/
|
||||||
adb shell rm -rf /sdcard/Android/data/org.isoron.uhabits/files/test-screenshots
|
$ADB pull /storage/sdcard/test-screenshots/ tmp/
|
||||||
|
$ADB pull /sdcard/Android/data/${PACKAGE_NAME}/files/test-screenshots/ tmp/
|
||||||
|
|
||||||
|
$ADB shell rm -r /mnt/sdcard/test-screenshots/
|
||||||
|
$ADB shell rm -r /storage/sdcard/test-screenshots/
|
||||||
|
$ADB shell rm -r /sdcard/Android/data/${PACKAGE_NAME}/files/test-screenshots/
|
||||||
}
|
}
|
||||||
|
|
||||||
accept_images() {
|
accept_images() {
|
||||||
find tmp/test-screenshots -name '*.expected*' -delete
|
find tmp/test-screenshots -name '*.expected*' -delete
|
||||||
rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/
|
rsync -av tmp/test-screenshots/ uhabits-android/src/androidTest/assets/
|
||||||
}
|
}
|
||||||
|
|
||||||
run_local_tests() {
|
run_local_tests() {
|
||||||
@@ -217,7 +222,7 @@ run_local_tests() {
|
|||||||
build_instrumentation_apk
|
build_instrumentation_apk
|
||||||
install_test_butler
|
install_test_butler
|
||||||
install_apk
|
install_apk
|
||||||
uninstall_test_apk
|
uninstall_test_apk
|
||||||
install_test_apk
|
install_test_apk
|
||||||
run_instrumented_tests
|
run_instrumented_tests
|
||||||
parse_instrumentation_results
|
parse_instrumentation_results
|
||||||
@@ -249,12 +254,12 @@ case "$1" in
|
|||||||
Usage: $0 ci-tests AVD_NAME AVD_SERIAL [options]
|
Usage: $0 ci-tests AVD_NAME AVD_SERIAL [options]
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
AVD_NAME name of the virtual android device to start
|
AVD_NAME name of the virtual android device to start
|
||||||
AVD_SERIAL adb port to use (e.g. 5560)
|
AVD_SERIAL adb port to use (e.g. 5560)
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-u --uninstall-first Uninstall existing APK first
|
-u --uninstall-first Uninstall existing APK first
|
||||||
-r --release Build and install release version, instead of debug
|
-r --release Build and install release version, instead of debug
|
||||||
END
|
END
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -275,13 +280,13 @@ case "$1" in
|
|||||||
run_local_tests
|
run_local_tests
|
||||||
;;
|
;;
|
||||||
|
|
||||||
fetch-images)
|
fetch-images)
|
||||||
fetch_images
|
fetch_images
|
||||||
;;
|
;;
|
||||||
|
|
||||||
accept-images)
|
accept-images)
|
||||||
accept_images
|
accept_images
|
||||||
;;
|
;;
|
||||||
|
|
||||||
install)
|
install)
|
||||||
shift; parse_opts $*
|
shift; parse_opts $*
|
||||||
@@ -295,11 +300,11 @@ case "$1" in
|
|||||||
Builds, installs and tests Loop Habit Tracker
|
Builds, installs and tests Loop Habit Tracker
|
||||||
|
|
||||||
Commands:
|
Commands:
|
||||||
ci-tests Start emulator silently, run tests then kill emulator
|
ci-tests Start emulator silently, run tests then kill emulator
|
||||||
local-tests Run all tests on connected device
|
local-tests Run all tests on connected device
|
||||||
install Install app on connected device
|
install Install app on connected device
|
||||||
fetch-images Fetches failed view test images from device
|
fetch-images Fetches failed view test images from device
|
||||||
accept-images Copies fetched images to corresponding assets folder
|
accept-images Copies fetched images to corresponding assets folder
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-u --uninstall-first Uninstall existing APK first
|
-u --uninstall-first Uninstall existing APK first
|
||||||
|
|||||||
Reference in New Issue
Block a user