From cb7e911c3595f591065ea9513bfa95b8d465a900 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Thu, 16 Jul 2026 16:21:18 +0800 Subject: [PATCH] Fix CI crash --- tests/CMakeLists.txt | 9 ++++++++- tests/gtest/CMakeLists.txt | 7 +++++++ tests/gtest/render_clip_buffer_hint_test.cpp | 7 +++++-- tests/gtest/render_direct_connection_test.cpp | 7 +++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2040ce48b..7fa46d0a8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -69,7 +69,14 @@ function(olive_add_test GROUP NAME SOURCE) add_test("Olive.${GROUP}.${NAME}" ${NAME}) else() add_test(${NAME} ${NAME}) -endif() + endif() + + if (WIN32) + # Windows has no RPATH: ffmpeg_bridge.dll must sit next to the executable + add_custom_command(TARGET ${NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ $) + endif() endfunction() include(FetchContent) diff --git a/tests/gtest/CMakeLists.txt b/tests/gtest/CMakeLists.txt index 5063838cc..a66b0fdde 100644 --- a/tests/gtest/CMakeLists.txt +++ b/tests/gtest/CMakeLists.txt @@ -128,3 +128,10 @@ if (MSVC) else() add_test(olive-gtest olive-gtest) endif() + +if (WIN32) + # Windows has no RPATH: ffmpeg_bridge.dll must sit next to the executable + add_custom_command(TARGET olive-gtest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ $) +endif() diff --git a/tests/gtest/render_clip_buffer_hint_test.cpp b/tests/gtest/render_clip_buffer_hint_test.cpp index f3f7cdce8..31db1132d 100644 --- a/tests/gtest/render_clip_buffer_hint_test.cpp +++ b/tests/gtest/render_clip_buffer_hint_test.cpp @@ -207,8 +207,11 @@ protected: void TearDown() override { - RenderManager::instance()->GetCacher()->SetProject(nullptr); - RenderManager::DestroyInstance(); + // May be null when SetUp() skipped before creating the instance. + if (RenderManager::instance()) { + RenderManager::instance()->GetCacher()->SetProject(nullptr); + RenderManager::DestroyInstance(); + } project_.reset(); } diff --git a/tests/gtest/render_direct_connection_test.cpp b/tests/gtest/render_direct_connection_test.cpp index 32dc9e744..15cd18a0f 100644 --- a/tests/gtest/render_direct_connection_test.cpp +++ b/tests/gtest/render_direct_connection_test.cpp @@ -188,8 +188,11 @@ protected: void TearDown() override { - RenderManager::instance()->GetCacher()->SetProject(nullptr); - RenderManager::DestroyInstance(); + // May be null when SetUp() skipped before creating the instance. + if (RenderManager::instance()) { + RenderManager::instance()->GetCacher()->SetProject(nullptr); + RenderManager::DestroyInstance(); + } project_.reset(); }