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

Add Android testing setup #912

Open
atsushieno opened this issue Jun 12, 2021 · 1 comment
Open

Add Android testing setup #912

atsushieno opened this issue Jun 12, 2021 · 1 comment

Comments

@atsushieno
Copy link
Contributor

context: #875 (comment) / #897 (comment)

Current Android build setup on Azure DevOps misses testing on Android:

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.

@derselbst
Copy link
Member

Interim report

The main problem is that the include and library paths are hardcoded in the CMakeLists.txt:

../../../../../build_${CMAKE_ANDROID_ARCH_ABI}
../../../../build-scripts/build-artifacts/include
../../../../build-scripts/android-build-root/${CMAKE_ANDROID_ARCH_ABI}/opt/android/include
../../../../build-scripts/android-build-root/${CMAKE_ANDROID_ARCH_ABI}/opt/android/include/glib-2.0
../../../../build-scripts/android-build-root/${CMAKE_ANDROID_ARCH_ABI}/opt/android/lib/glib-2.0/include

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants