Replace Gradle-based Android testing with individual emulator executables#1639
Draft
Replace Gradle-based Android testing with individual emulator executables#1639
Conversation
Co-authored-by: derselbst <8152480+derselbst@users.noreply.github.com>
Co-authored-by: derselbst <8152480+derselbst@users.noreply.github.com>
Co-authored-by: derselbst <8152480+derselbst@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Propose a solution to @FluidSynth/fluidsynth/issues/912 . You'll find additional context in @FluidSynth/fluidsynth/pull/875 and @FluidSynth/fluidsynth/issues/897 . The goal should be to allow execution of fluidsynth's unit test in the Android CI pipeli...
Replace Gradle-based Android testing with individual emulator executables
Aug 30, 2025
|
derselbst
reviewed
Aug 30, 2025
Member
derselbst
left a comment
There was a problem hiding this comment.
Currently, ADB wait-for-device is waiting forever. I need to reproduce this locally, this may take some time...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Addresses #912 by implementing a new Android testing approach that eliminates the Gradle dependency and maintains individual test files for better maintainability.
Problem
The current Android CI pipeline used Gradle to compile all unit tests into a single shared library, which had several issues:
convert-tests.sh)Solution
This PR introduces a new emulator-based testing system that builds and executes individual test executables directly in the Android emulator via ADB:
Key Components
ADD_FLUID_ANDROID_TEST()that builds individual Android test executablesTechnical Implementation
test_snprintf_android)libfluidsynth-OBJand required dependencies (LIBFLUID_LIBS, Android log library)adb pushand executed withadb shellBenefits
Usage
Backward Compatibility
The legacy Gradle-based approach is still available via
-DENABLE_ANDROID_GRADLE_TESTS=ONfor compatibility, but the new emulator-based approach is now the default.Files Added/Modified
cmake_admin/FluidAndroidTest.cmake- CMake integration for Android teststest-android/run-emulator-tests.sh- Test execution enginetest-android/verify-setup.sh- Developer verification tooltest-android/README_emulator_testing.md- Comprehensive documentation.azure/azure-pipelines-android.yml- Updated CI pipelinetest/CMakeLists.txt- Added Android test targetsCMakeLists.txt- Made Gradle approach optionalThe solution is ready for immediate CI testing with both armv7a and aarch64 architectures and completely addresses the maintainability concerns raised in the original issue.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.