From 96804f95e4fdd47e5505e56688a7bb95c97e2c04 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 26 Dec 2024 13:05:48 +0100 Subject: [PATCH] run-unit-tests-android.sh: Handle Sys directory This script was written before the Sys directory was used in unit tests. The existing code would successfully push the Sys directory, but would then get an error trying to execute the Sys directory, making $RESULT non-zero. This change fixes that. --- Tools/run-unit-tests-android.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Tools/run-unit-tests-android.sh b/Tools/run-unit-tests-android.sh index 7c4c953f63..c7750c14dd 100644 --- a/Tools/run-unit-tests-android.sh +++ b/Tools/run-unit-tests-android.sh @@ -11,14 +11,25 @@ DEVICE_DIR="/data/local/tmp/dolphin-emu-tests" export MSYS_NO_PATHCONV=1 export MSYS2_ARG_CONV_EXCL="*" +# Remove old copy of the Sys directory +adb shell rm -r "$DEVICE_DIR" + +# Push new copy of the Sys directory +if [ -d "Sys" ]; then + adb push "Sys" "$DEVICE_DIR/Sys" +fi + +# Push and run executables for path in *; do f=$(basename "$path") - adb push "$path" "$DEVICE_DIR/$f" && adb shell chmod 775 "$DEVICE_DIR/$f" && adb shell "$DEVICE_DIR/$f" - RESULT=$(($RESULT+$?)) + if [ -f "$path" ]; then + adb push "$path" "$DEVICE_DIR/$f" && adb shell chmod 775 "$DEVICE_DIR/$f" && adb shell "$DEVICE_DIR/$f" + RESULT=$(($RESULT+$?)) - # Some of these executables are pretty big, so let's remove them as soon as we're done - adb shell rm "$DEVICE_DIR/$f" + # Some of these executables are pretty big, so let's remove them as soon as we're done + adb shell rm "$DEVICE_DIR/$f" + fi done echo ""