run-unit-tests-android.sh 858 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. #
  3. # Runs unit tests (must have been built beforehand) on an Android device connected via adb.
  4. #
  5. # The current working directory must contain test executables. Normally (for AArch64)
  6. # the working directory would be: Source/Android/app/.cxx/cmake/debug/arm64-v8a/Binaries/Tests
  7. DEVICE_DIR="/data/local/tmp/dolphin-emu-tests"
  8. # Prevent MingW MSYS from being "smart" and turning the path above into a Windows-style path
  9. export MSYS_NO_PATHCONV=1
  10. export MSYS2_ARG_CONV_EXCL="*"
  11. for path in *; do
  12. f=$(basename "$path")
  13. adb push "$path" "$DEVICE_DIR/$f" && adb shell chmod 775 "$DEVICE_DIR/$f" && adb shell "$DEVICE_DIR/$f"
  14. RESULT=$(($RESULT+$?))
  15. # Some of these executables are pretty big, so let's remove them as soon as we're done
  16. adb shell rm "$DEVICE_DIR/$f"
  17. done
  18. echo ""
  19. echo "Total failed tests: $RESULT"
  20. exit $RESULT