diff --git a/bindings/python/test_logger.py b/bindings/python/test_logger.py index a5b0ecbae..e12b0e270 100644 --- a/bindings/python/test_logger.py +++ b/bindings/python/test_logger.py @@ -46,6 +46,16 @@ def run_logger(self, variables, body=''): if _key not in _seen: _dll_handles.append(os.add_dll_directory(_directory)) _seen.add(_key) +_project_dlls = [] +if os.name == 'nt': + import ctypes + # Select this build's project DLLs before Python can find installed copies. + for _variable, _name in ( + ('OPENSHOT_TEST_AUDIO_DLL_DIR', 'libopenshot-audio.dll'), + ('OPENSHOT_TEST_DLL_DIR', 'libopenshot.dll')): + _directory = os.environ.get(_variable) + if _directory: + _project_dlls.append(ctypes.WinDLL(os.path.abspath(os.path.join(_directory, _name)))) import openshot logger = openshot.Logger.Instance() assert openshot.ZmqLogger is openshot.Logger diff --git a/src/OpenShotVersion.cpp b/src/OpenShotVersion.cpp index c0bdaaba2..6dcdf7158 100644 --- a/src/OpenShotVersion.cpp +++ b/src/OpenShotVersion.cpp @@ -12,8 +12,13 @@ // SPDX-License-Identifier: LGPL-3.0-or-later #include "OpenShotVersion.h" +#include namespace openshot { + std::string GetAudioVersion() { + return openshot_audio::GetVersion(); + } + OpenShotVersion GetVersion() { return openshot::Version; } diff --git a/src/OpenShotVersion.h.in b/src/OpenShotVersion.h.in index 3c03d9212..b8e41dee2 100644 --- a/src/OpenShotVersion.h.in +++ b/src/OpenShotVersion.h.in @@ -60,6 +60,9 @@ namespace openshot /// Get the current version number of libopenshot (major, minor, and build number) openshot::OpenShotVersion GetVersion(); + + /// Full version of the loaded libopenshot-audio, including development suffixes. + std::string GetAudioVersion(); } #endif // OPENSHOT_VERSION_H diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c909e5f55..98cee3ae7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -34,6 +34,7 @@ target_link_libraries(openshot-benchmark openshot) ### TEST SOURCE FILES ### set(OPENSHOT_TESTS + OpenShotVersion GpuMetrics AdaptivePreroll AudioDeviceManager diff --git a/tests/OpenShotVersion.cpp b/tests/OpenShotVersion.cpp new file mode 100644 index 000000000..6d843cee0 --- /dev/null +++ b/tests/OpenShotVersion.cpp @@ -0,0 +1,19 @@ +/** + * @file + * @brief Verify that libopenshot reports the loaded audio library version. + * @author OpenShot Studios, LLC + */ + +// SPDX-FileCopyrightText: 2026 OpenShot Studios, LLC +// SPDX-License-Identifier: LGPL-3.0-or-later + +#include "openshot_catch.h" +#include "OpenShotVersion.h" +#include +#include + +TEST_CASE("Audio version identifies the loaded library", "[version]") { + const std::string audio_version = openshot_audio::GetVersion(); + REQUIRE_FALSE(audio_version.empty()); + CHECK(openshot::GetAudioVersion() == audio_version); +}