Repository navigation
tests: share one plugin source list between the native test scripts - #622
Merged
Merged
Conversation
- test/support/plugin_sources.txt lists the plugin's sources once; the test/common scripts, plugin_build.sh, engine_sources.sh, windows_native.sh and native_build.ps1 read it - plugin_sources_test.dart fails when a source the build hook compiles is missing from the list
Owner
|
This is a great cleanup, removing ~20 duplicated source lists will save a lot of maintenance headaches. Merging now, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The native tests that link the whole plugin (bindings.cpp down to the SoLoud
engine) each carried their own copy of the plugin's source list: 17
test/common/*_test.shscripts,test/support/plugin_build.sh,test/support/engine_sources.sh(the macOS, Linux, iOS and Androidscripts),
test/docker/windows_native.shandGet-PluginSourcesintest/support/native_build.ps1.This PR moves the list to one file,
test/support/plugin_sources.txt, andmakes all of them read it:
plugin_sources [apple|android|linux|windows]inengine_sources.shsets
PLUGIN_SOURCES,PLUGIN_INCLUDESandPLUGIN_LIBS.engine_sourcesandplugin_buildnow use it.test/commonscript replaces its-Iblock, its source block andits
PLATFORM_SOURCES/PLATFORM_LIBSblock with"${PLUGIN_INCLUDES[@]}","${PLUGIN_SOURCES[@]}"and"${PLUGIN_LIBS[@]}". The defines, the sanitizer flags, the backendchoice and the test-only sources stay in each script as before.
plugin_build.shkeepsPLUGIN_BUILD_NO_COMMON=1.windows_native.shandnative_build.ps1read thewindows:lines ofthe same file.
test/common/plugin_sources_test.dartcompares the list withcollectSources()inhook/build.dartfor macOS, iOS, Android, Linux andWindows. It fails when a source the hook compiles is missing from the list.
test/README.mdgets one paragraph saying where the list is.Why
Adding a source file to the plugin meant editing about 20 lists, and a list
that was missed only showed up as a link error in one test, or as a test
that quietly built less than the plugin ships. Now there is one list, and a
test that catches the hook and the list drifting apart.
There is no CHANGELOG entry: the change is test-only, and the CHANGELOG
describes what users of the package see.
Testing
All on macOS (arm64), from the repository root. Every script was run on
main(9abf4b3) and then on this branch:coreaudio_device_changefails the same two checks onmainon thismachine ("the engine lists it (id -2)" and "aggregate listed"). It depends
on the machine's audio devices, not on this change.
The compiler calls were recorded with the generator's fake compilers, for
every script plain, with
--asanand with--tsan(775 calls before, 775after). They are the same, except that:
Foundation, as the other scripts already did;
plugin_build.shpasses the same frameworks in a different order.With
src/mixeroutput/*.cpptaken out of the list,plugin_sources_test.dartfails for every platform, as it should.gen_cmake.pyneeds the VST3 prebuild (orVST3_PREBUILD_DIR) toreproduce the committed file. Without it, it drops the
vst3_param_changes_testtarget. That is true onmaintoo.Not run on this branch: Linux, the Windows scripts (
windows_native.sh,native_build.ps1), iOS and Android. The same change, with a fewadditions of our own on top, does pass the Windows suite in our fork
(Windows 11, MSVC 14.50:
test\windows\all.ps1, ctest 61/61,msvc_build_testwith /W3 /WX). Windows now also compilessrc/device_lifecycle_test_hooks.cpp, which is empty withoutSOLOUD_LIFECYCLE_TEST_HOOKS.Follow-ups
test/commonscripts compile only parts of the engine (SoLoudcore, one decoder, ...), not the whole plugin, so they keep their own
lists. They could share smaller named lists in the same way.
🤖 Generated with Claude Code