Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
30c4644
try to get android emulator working
derselbst Jun 13, 2021
dfeea7c
fix
derselbst Jun 13, 2021
d1cf69f
update androi
derselbst Jun 13, 2021
618e518
port to macos because it has android emulator
derselbst Jun 13, 2021
82a80ad
bumpcache
derselbst Jun 13, 2021
06619e9
fix cp -ur
derselbst Jun 13, 2021
402f70c
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
d385341
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
76e94e1
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
c497081
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
b7e1554
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
38047ce
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
3540956
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 13, 2021
e6837c2
Merge branch 'master' into android-emulator
derselbst Jun 14, 2021
c821562
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
071270c
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
b3c0e96
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
5529585
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
52f341f
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
8023bc9
Update convert-tests.sh
derselbst Jun 14, 2021
807e5c2
Update convert-tests.sh
derselbst Jun 14, 2021
e256b21
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
39897d9
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
9c910f4
Update cmake-android.yml
derselbst Jun 14, 2021
d30d0e8
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
cdd61de
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 14, 2021
90f1225
Update CMakeLists.txt
derselbst Jun 15, 2021
b3dfce9
Update CMakeLists.txt
derselbst Jun 15, 2021
faccd36
Update CMakeLists.txt
derselbst Jun 15, 2021
c454574
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 15, 2021
b0ee079
Update azure-pipelines-android.yml for Azure Pipelines
derselbst Jun 15, 2021
c8e1853
Update build.gradle
derselbst Jun 15, 2021
08a9efb
Update CMakeLists.txt
derselbst Jun 15, 2021
b09b929
Merge remote-tracking branch 'origin/master' into android-emulator
derselbst Jan 29, 2023
ccd2868
Initial plan
Copilot Aug 30, 2025
92599bf
Implement Android emulator testing without Gradle dependency
Copilot Aug 30, 2025
ebfce49
Enhance Android testing with robust error handling and verification
Copilot Aug 30, 2025
7b11bae
Complete Android emulator testing solution - ready for CI validation
Copilot Aug 30, 2025
47415b8
fix android ci?
derselbst Aug 30, 2025
7c5a98f
Merge branch 'master' into copilot/fix-aac6dbca-def2-4626-b3f8-b6aaf5…
derselbst Aug 30, 2025
abe50b8
dbg
derselbst Aug 30, 2025
c28585c
dbg
derselbst Aug 30, 2025
9cf60a5
install emulator
derselbst Aug 30, 2025
ea191cb
accept eula
derselbst Aug 30, 2025
a7b9a02
Merge remote-tracking branch 'origin/master' into copilot/fix-aac6dbc…
derselbst Sep 19, 2026
a9962a6
fix
derselbst Sep 19, 2026
ceb3c36
fix
derselbst Sep 19, 2026
94bcb80
fix
derselbst Sep 19, 2026
a998f0b
dbg
derselbst Sep 19, 2026
3ec01b8
add to kvm
derselbst Sep 19, 2026
d3d30cf
fix adb
derselbst Sep 19, 2026
93bd2c2
fix?
derselbst Sep 19, 2026
3da48db
fix
derselbst Sep 19, 2026
f3d388d
[[]]
derselbst Sep 19, 2026
61f2761
try tests on arm
derselbst Sep 19, 2026
586f05b
remove unused verify-setup script
derselbst Sep 19, 2026
902ac4c
disable arm again
derselbst Sep 19, 2026
abcfdac
remove redundant link
derselbst Sep 20, 2026
c924585
remove FluidAndroidTest.cmake
derselbst Sep 20, 2026
6c40504
fix build?
derselbst Sep 20, 2026
07a0b49
filter test exec
derselbst Sep 20, 2026
0eb3560
remove unmaintained and obsolete gradle stuff
derselbst Sep 20, 2026
a86fbed
rename run-emulator-tests.sh
derselbst Sep 20, 2026
f200550
cleanup
derselbst Sep 20, 2026
6ee0a77
add run-android-tests to exclusion
derselbst Sep 20, 2026
c9e8431
oops
derselbst Sep 20, 2026
9e088e2
undo noise
derselbst Sep 20, 2026
651c080
Stage testfiles into dedicated test dir
derselbst Sep 27, 2026
c99ddcf
ugh
derselbst Sep 27, 2026
d90f412
...
derselbst Sep 27, 2026
5c85747
dbg
derselbst Sep 27, 2026
1c625fd
hide some logs
derselbst Sep 27, 2026
3d0be29
cleanup
derselbst Sep 27, 2026
576264b
sonarqube
derselbst Sep 27, 2026
8a2f22f
fix rendering ref
derselbst Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .azure/azure-pipelines-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ trigger:
- '.azure/azure-pipelines-win.yml'
- '.circleci/config.yml'
- '.github/workflows/*'
- 'test/run-android-tests.sh'
- 'README.md'

resources:
Expand Down
93 changes: 78 additions & 15 deletions .azure/azure-pipelines-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ jobs:

- script: |
set -ex

sudo apt remove --purge --auto-remove cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'
Expand Down Expand Up @@ -232,7 +231,7 @@ jobs:
- template: cmake-android.yml
parameters:
sourceDir: 'oboe-$(OBOE_VERSION)'
installCommand: 'cp liboboe.* ${PREFIX}/lib/ && cp -ur ../include/oboe ${PREFIX}/include'
installCommand: 'cp liboboe.* ${PREFIX}/lib/ && cp -R ../include/oboe ${PREFIX}/include'

- script: |
set -ex
Expand Down Expand Up @@ -265,20 +264,84 @@ jobs:
cmakeArgs: '-Denable-opensles=1 -Denable-floats=1 -Denable-oboe=1 -Denable-dbus=0 -Denable-oss=0 -Denable-openmp=0'
installCommand: ''

- script: |
set -x
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(PREFIX)/lib:$(NDK_TOOLCHAIN)/sysroot/usr/lib/$(ARCH)-linux-android$(ANDROID_TARGET_ABI)/$(ANDROID_API)
pushd build
make -j$((`nproc`+1)) check
ldd test/test_sample_cache
# Build individual Android test executables
- bash: |
set -ex
pushd build_$(ANDROID_ABI_CMAKE)
make check
popd
displayName: 'Execute fluidsynth unit test'
condition: and(succeeded(), in(variables['ARCH'], 'x86_64', 'i686'))
enabled: 'false'
# List built test executables for verification
find build_$(ANDROID_ABI_CMAKE) -name "*" -type f | head -10
displayName: 'Build Android Test Executables'

- script: |
- bash: |
set -ex
# Grant the current CI user access to /dev/kvm so the emulator can use hardware acceleration.
# Without this, x86/x86_64 system images refuse to boot at all ("x86 emulation currently
# requires hardware acceleration!") because the KVM device is only group-readable/writable.
if [ -e /dev/kvm ]; then
sudo groupadd -f kvm
sudo usermod -aG kvm "$USER"
sudo chown root:kvm /dev/kvm
sudo chmod 660 /dev/kvm
# Apply the new group membership to this shell without needing to re-login.
sudo setfacl -m u:"$USER":rw /dev/kvm || true
else
echo "##[warning]/dev/kvm does not exist; hardware acceleration will not be available."
fi

ls $ANDROID_HOME/cmdline-tools/ || true
cd $ANDROID_HOME/cmdline-tools/latest/bin
yes | ./sdkmanager --licenses > /dev/null 2>&1
./sdkmanager --list | grep system-images
./sdkmanager 'system-images;android-$(ANDROID_API);default;$(ANDROID_ABI_CMAKE)' > /dev/null
./sdkmanager --channel=3 emulator
echo "no" | ./avdmanager create avd -n android_emulator -k 'system-images;android-$(ANDROID_API);default;$(ANDROID_ABI_CMAKE)' --force
echo "Emulator created successfully $($ANDROID_HOME/emulator/emulator -list-avds), launching it"

# NOTE: -gpu guest can stall on headless CI runners without a display/GPU. swiftshader_indirect
# is the software renderer explicitly recommended for headless emulator use.
# Emulator output is logged to a file (instead of discarded) so we can diagnose boot failures below.
nohup $ANDROID_HOME/emulator/emulator -avd android_emulator -no-window -no-snapshot -no-audio -no-boot-anim -accel auto -gpu swiftshader_indirect > $(Build.ArtifactStagingDirectory)/emulator.log 2>&1 &
emulatorPid=$!

# adb wait-for-device only waits for the emulator's ADB transport to attach, which normally
# happens within seconds of a healthy boot. It never times out on its own, so if the emulator
# process fails/crashes/hangs during boot (e.g. no hardware acceleration available for this ABI),
# this would otherwise block for the entire job timeout. Bound it explicitly and fail fast with logs.
if ! timeout 300 $ANDROID_HOME/platform-tools/adb wait-for-device; then
echo "##[error]Timed out waiting for the emulator to attach via adb."
echo "--- emulator.log ---"
cat $(Build.ArtifactStagingDirectory)/emulator.log || true
echo "--- adb devices ---"
$ANDROID_HOME/platform-tools/adb devices -l || true
kill -9 $emulatorPid 2>/dev/null || true
exit 1
fi

# Set up environment and run individual test executables
# run-android-tests.sh calls plain "adb" (not the full path), so platform-tools must be on PATH.
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export ANDROID_ABI_CMAKE="$(ANDROID_ABI_CMAKE)"
# BUILD_DIR must be absolute: run-android-tests.sh resolves it relative to its own cwd
# (test/), not the repo root, so a relative "build_x86_64" would never be found.
export BUILD_DIR="$(Build.SourcesDirectory)/build_$(ANDROID_ABI_CMAKE)"
export PREFIX="${PREFIX}"

cd $(Build.SourcesDirectory)/test
./run-android-tests.sh

kill -9 $emulatorPid
displayName: 'Start emulator and execute individual test executables'
# armeabi-v7a and arm64-v8a system images cannot be hardware-accelerated on the x86_64 hosted
# agent (KVM only accelerates same-architecture guests; ARM-on-x86 always falls back to slow
# TCG software emulation), so booting them is impractically slow/unreliable in CI and is what
# caused this step to hang. Only run the emulator for the x86/x86_64 legs, which can use KVM.
condition: and(succeeded(), in(variables['ANDROID_ABI_CMAKE'], 'x86', 'x86_64'))

- bash: |
set -ex
pushd build
pushd build_$(ANDROID_ABI_CMAKE)
make install
popd
displayName: 'Install fluidsynth'
Expand All @@ -302,7 +365,7 @@ jobs:
cd $(Build.ArtifactStagingDirectory)/lib/$(ANDROID_ABI_CMAKE)
cp -LR $(PREFIX)/lib/* .
ls -Rg .
rm -rf *.dll *.alias gettext/ libtextstyle.* *.a *.la
rm -Rf *.dll *.alias gettext/ libtextstyle.* *.a *.la
rm -f *.so.*
mkdir -p $(Build.ArtifactStagingDirectory)/include
cd $(Build.ArtifactStagingDirectory)/include
Expand Down Expand Up @@ -340,7 +403,7 @@ jobs:
- script: |
set -ex
# as very last step before creating the pipeline cache, remove fluidsynth
pushd build
pushd build_$(ANDROID_ABI_CMAKE)
make uninstall
popd
displayName: 'Uninstall fluidsynth'
1 change: 1 addition & 0 deletions .azure/azure-pipelines-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ trigger:
- '.azure/Dockerfile.azure-alpine'
- '.circleci/config.yml'
- '.github/workflows/*'
- 'test/run-android-tests.sh'
- 'README.md'

parameters:
Expand Down
4 changes: 2 additions & 2 deletions .azure/cmake-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ steps:
set -ex

pushd ${{ parameters.sourceDir }}
mkdir -p build
pushd build
mkdir -p build_${ANDROID_ABI_CMAKE}
pushd build_${ANDROID_ABI_CMAKE}

# Invoke cmake in the most correctest way I've could find while try and erroring:
#
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/api_doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/workflows/os2.yml'
- '.github/workflows/sonarcloud.yml'
- '.github/workflows/windows.yml'
- 'test/run-android-tests.sh'
- 'README.md'
workflow_dispatch:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/sonarcloud.yml'
- '.github/workflows/solaris.yml'
- '.github/workflows/windows.yml'
- 'test/run-android-tests.sh'
- 'README.md'

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/windows.yml'
- '.github/workflows/sonarcloud.yml'
- '.github/workflows/rendering-regression.yml'
- 'test/run-android-tests.sh'
- 'README.md'
tags:
- 'v*'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/ios.yml'
- '.github/workflows/os2.yml'
- '.github/workflows/rendering-regression.yml'
- 'test/run-android-tests.sh'
- 'README.md'

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/os2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/ios.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/rendering-regression.yml'
- 'test/run-android-tests.sh'
- 'README.md'

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rendering-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
- '.github/workflows/os2.yml'
- '.github/workflows/sonarcloud.yml'
- '.github/workflows/windows.yml'
- 'test/run-android-tests.sh'
- 'README.md'

permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/solaris.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/rendering-regression.yml'
- '.github/workflows/sonarcloud.yml'
- '.github/workflows/windows.yml'
- 'test/run-android-tests.sh'
- 'README.md'

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- '.github/workflows/ios.yml'
- '.github/workflows/os2.yml'
- '.github/workflows/rendering-regression.yml'
- 'test/run-android-tests.sh'
- 'README.md'
pull_request:
types: [opened, synchronize, reopened]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- '.github/workflows/ios.yml'
- '.github/workflows/os2.yml'
- '.github/workflows/rendering-regression.yml'
- 'test/run-android-tests.sh'
- 'README.md'
tags:
- 'v*'
Expand Down
47 changes: 40 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -804,13 +804,46 @@ if ( enable-signalsmith )
endif ( enable-signalsmith )

# manipulate some variables to setup a proper test env
set(TEST_SOUNDFONT "${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf2")
set(TEST_DLS "${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.dls")
set(TEST_SOUNDFONT_UTF8_1 "${FluidSynth_SOURCE_DIR}/sf2/\\xE2\\x96\\xA0VintageDreamsWaves-v2\\xE2\\x96\\xA0.sf2")
set(TEST_SOUNDFONT_UTF8_2 "${FluidSynth_SOURCE_DIR}/sf2/VìntàgèDrèàmsWàvès-v2.sf2")
set(TEST_SOUNDFONT_SF3 "${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf3")
set(TEST_MIDI_UTF8 "${FluidSynth_SOURCE_DIR}/test/ⓉⒺⓈⓉ.mid")
set(TEST_WAV_UTF8 "${FluidSynth_BINARY_DIR}/test/ⓉⒺⓈⓉ.wav")
#
# The unit tests resolve their test data relative to the current working
# directory (the test build dir on the host via ctest, the adb-pushed
# ${TEST_DIR} in the Android emulator), therefore TEST_* are plain relative
# paths. The actual files are staged into ${TEST_DATA_STAGE} mirroring their
# location relative to the source root (see TEST_DATA_FILES below), and on
# the Android emulator test/run-android-tests.sh pushes that staged tree to
# the device.
set(TEST_DATA_STAGE "${CMAKE_BINARY_DIR}/test")
set(TEST_DATA_FILES
"${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf2"
"${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.dls"
"${FluidSynth_SOURCE_DIR}/sf2/■VintageDreamsWaves-v2■.sf2"
"${FluidSynth_SOURCE_DIR}/sf2/VìntàgèDrèàmsWàvès-v2.sf2"
"${FluidSynth_SOURCE_DIR}/sf2/VintageDreamsWaves-v2.sf3"
"${FluidSynth_SOURCE_DIR}/test/ⓉⒺⓈⓉ.mid"
)
set(TEST_DATA_OUTPUTS "")
foreach(src IN LISTS TEST_DATA_FILES)
file(RELATIVE_PATH rel "${FluidSynth_SOURCE_DIR}" "${src}")
set(dst "${TEST_DATA_STAGE}/${rel}")
get_filename_component(dst_dir "${dst}" DIRECTORY)
add_custom_command(
OUTPUT "${dst}"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${dst_dir}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${src}" "${dst}"
DEPENDS "${src}"
VERBATIM
)
list(APPEND TEST_DATA_OUTPUTS "${dst}")
endforeach()
add_custom_target(test_data DEPENDS ${TEST_DATA_OUTPUTS})

set(TEST_SOUNDFONT "sf2/VintageDreamsWaves-v2.sf2")
set(TEST_DLS "sf2/VintageDreamsWaves-v2.dls")
set(TEST_SOUNDFONT_UTF8_1 "sf2/\\xE2\\x96\\xA0VintageDreamsWaves-v2\\xE2\\x96\\xA0.sf2")
set(TEST_SOUNDFONT_UTF8_2 "sf2/VìntàgèDrèàmsWàvès-v2.sf2")
set(TEST_SOUNDFONT_SF3 "sf2/VintageDreamsWaves-v2.sf3")
set(TEST_MIDI_UTF8 "test/ⓉⒺⓈⓉ.mid")
set(TEST_WAV_UTF8 "test/ⓉⒺⓈⓉ.wav")

# Make sure to link against libm before checking for math functions below
set ( CMAKE_REQUIRED_LIBRARIES "${LIBFLUID_LIBS};${WINDOWS_LIBS}" )
Expand Down
4 changes: 3 additions & 1 deletion cmake_admin/FluidUnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ macro ( ADD_FLUID_TEST _test )
)

# add the test to ctest
ADD_TEST(NAME ${_test} COMMAND ${_test})
if( NOT ANDROID )
ADD_TEST(NAME ${_test} COMMAND ${_test})
endif()

# append the current unit test to check-target as dependency
add_dependencies(check ${_test})
Expand Down
21 changes: 0 additions & 21 deletions test-android/.gitignore

This file was deleted.

41 changes: 0 additions & 41 deletions test-android/README.md

This file was deleted.

1 change: 0 additions & 1 deletion test-android/app/.gitignore

This file was deleted.

Loading
Loading