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 #913

Merged
merged 16 commits into from
Jun 14, 2021

Conversation

atsushieno
Copy link
Contributor

context: #912

This adds basic testing setup along with custom build scripts and test source generator scripts.

The rationale behind the app and how-to documentation to set up and run both locally and on Azure DevOps are described on test-android/README.md.

Changes are rebased off of master HEAD and can be either packed in merge-commit or merged as is (some extraneous reverts involved though).

As described on README, it does not really run tests yet.
But it asserts that libfluidsynth.so is loadable at least.
…-target.

gettext is known as cause of problem for running host tool in target ABI
in our builds, and the latest script still had the issue.
https://github.com/atsushieno/aap-lv2-fluidsynth/actions/runs/914453645

This fixes the problem by explicitly specifying that the build host is
x86_64 linux.
If you want to reuse the script on other platforms, you have to edit it.
…oid test.

The existing ctests cannot be simply used in Android tests because
everything is compiled as standalone executable with `main()` function.
Since Android 11+ does not support standalone executables, those test
`main()` functions are converted as unique functions and then picked up
in this test's native-lib CMakeLists.txt.

Since those tests depend on libfluidsynth internals, we cannot simply
link with libfluidsynth.so. We instead compile the library with OBJ files.
@atsushieno
Copy link
Contributor Author

Some defects I'm aware of:

  • Azure DevOps setup is not done. Maybe it can be done based on existing information like this. I'm still unsure if setting up emulator costs too much build time and/or network resources and have no idea how the team can afford to accept the cost, so I would leave it to @derselbst for now, but feel free to delegate it to me if it was not easy, it would certainly require some Android development background.
  • The package versions are hard-coded on build-scripts/build-env.sh as they were just copied from Azure DevOps setup. Ideally they had better be retrieved from somewhere, but that would affect how you manage the builds. Considering that it would not be too version dependent, at this state I leave them as is.

@derselbst
Copy link
Member

Works like a charm! I only added a missing mkdir and relaxed the CMake version check. I'll keep the commit history when merging this, as it could be helpful in the future to understand the trouble you've been through :)

One question: Currently, a single gradlew build command handles all four arch. How does gradle know that it should handle those four archs? I couldn't find that place. I'm asking because in ADops we will only be able to handle a single arch.

context: FluidSynth#913 (comment)

Run with `./gradlew -PcustomAbiFilters=x86` etc.
@atsushieno
Copy link
Contributor Author

awesome!

One question: Currently, a single gradlew build command handles all four arch. How does gradle know that it should handle those four archs? I couldn't find that place. I'm asking because in ADops we will only be able to handle a single arch.

Looks like Azure DevOps has awkward limitation.. I just added an customizible build property. Now you can run gradle like: ./gradlew connectedCheck -PcustomAbiFilters=x86

@sonarcloud
Copy link

sonarcloud bot commented Jun 13, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@derselbst
Copy link
Member

derselbst commented Jun 14, 2021

Perfect, thank you! I'm merging this and in the next days / weeks will work on the ADops integration.

Looks like Azure DevOps has awkward limitation

It's intentional: You get up to 10 parallel build slots in Azure, but each virtual machine only gets a dual-core CPU. Building all four archs on a single VM takes way too long (for my taste). But building each architecture in a different slot reduces overall build time by factor four ;)

@derselbst derselbst merged commit 15bd824 into FluidSynth:master Jun 14, 2021
@derselbst derselbst added this to the 2.2 milestone Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants