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