Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-unit-tests-android.sh: Handle Sys directory #13242

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions Tools/run-unit-tests-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,34 @@
#
# Runs unit tests (must have been built beforehand) on an Android device connected via adb.
#
# The current working directory must contain test executables. Normally (for AArch64)
# the working directory would be: Source/Android/app/.cxx/cmake/debug/arm64-v8a/Binaries/Tests
# The current working directory must contain test executables. Normally (for AArch64) the path to use
# looks like: Source/Android/app/.cxx/RelWithDebInfo/<random characters>/arm64-v8a/Binaries/Tests

DEVICE_DIR="/data/local/tmp/dolphin-emu-tests"

# Prevent MingW MSYS from being "smart" and turning the path above into a Windows-style path
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 ""
Expand Down