Open atsushieno opened 3 years ago
The main problem is that the include and library paths are hardcoded in the CMakeLists.txt:
When we build in Azure, the paths are different. To circumvent this, we could use the build-scripts in test-android/build-scripts/. Although this would work, it would still mean to have hard-coded paths and increased maintenance effort, as they always need to be kept in sync with the rest of the build.
Instead, I would like to integrate the android CMake part into our main CMake build system. I've already started this on the android-emulator
branch, but it's far from being complete. The idea is that CMake should detect, whether it's compiled for ANDROID or not. If complied for ANDROID, it should directly compile all unit tests into a single .so file, which could then be directly consumed by gradle.
I'll keep working on this from time to time. But it will take some...
context: https://github.com/FluidSynth/fluidsynth/pull/875#issuecomment-846898475 / https://github.com/FluidSynth/fluidsynth/issues/897#issuecomment-859687282
Current Android build setup on Azure DevOps misses testing on Android:
https://github.com/FluidSynth/fluidsynth/blob/f81caf37f192a518f24c460481ddeb8f1cfb8382/.azure/azure-pipelines-android.yml#L586
Since the tests that are based on ctest are not simply runnable on Android, we first have to convert existing tests into runnable style in Android manner. A dedicated test runner application would suffice.
As commented on the issue linked above, I came up with such a solution (test generator + runnable setup). A PR will follow and be linked here. So far it lacks the actual Azure DevOps setup, but having a locally runnable test app would be a good starter.