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 Android tests using GitHub actions #2945

Merged
merged 2 commits into from May 4, 2024

Conversation

binary1248
Copy link
Member

Title.

Runs Android tests on x86, x86_64 and arm64-v8a. armeabi-v7a is already quite old and there isn't emulator support for it.

To run the tests, an Android Virtual Device (AVD) is created with a default Android system image using the specified emulator API and emulator architecture. Not all combinations are available, the emulator API and architectures in this change are the latest I could find that would still be able to run the tests.

Because we only dynamic link on Android, we also need to copy all the executables and dynamic libraries (including libc++) over to the device as well as the resources that the tests themselves need to pass. The directory containing the libraries is specified using LD_LIBRARY_PATH when running the executable. We can only copy files into a subdirectory of /data/local/tmp/ on the device since everything else is read-only.

Because Catch doesn't currently support a nice way of running tests on a foreign system, we have to make use of the CROSSCOMPILING_EMULATOR target property that Catch uses when building the command line that it executes. Instead of directly executing the test executable, it calls a specially crafted proxy shell script that takes care of setting the working directory on the device, setting LD_LIBRARY_PATH and adding the /data/local/tmp/ directory prefix onto the absolute path to the executable that Catch passes to us. Hopefully Catch supports such use cases better in the future.

Coverage data collection is missing because, well... it doesn't seem to be supported, or at least it wasn't obvious to me how to activate generation of profiling data when the executable is run.

@coveralls
Copy link
Collaborator

coveralls commented Apr 14, 2024

Pull Request Test Coverage Report for Build 8888886252

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage remained the same at 51.598%

Files with Coverage Reduction New Missed Lines %
src/SFML/System/FileInputStream.cpp 1 96.08%
Totals Coverage Status
Change from base Build 8887495729: 0.0%
Covered Lines: 10437
Relevant Lines: 19110

💛 - Coveralls

@eXpl0it3r eXpl0it3r added this to the 3.0 milestone Apr 14, 2024
@ChrisThrasher ChrisThrasher merged commit 2386653 into master May 4, 2024
209 checks passed
@ChrisThrasher ChrisThrasher deleted the feature/run_android_tests branch May 4, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants