From 1af7ab7838b80af6aa230babb697a283514b55b0 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Mon, 3 Aug 2026 13:32:18 +0800 Subject: [PATCH] ci: engine tests use dllexport-consistent macros on Windows; run Linux tests under Xvfb - make_oakengine_gtest embeds oakengine-obj; test code must see OAKENGINE_API as dllexport too (OAKENGINE_BUILD), otherwise MinGW resolves nothing against __imp_* stubs - the render worker intentionally drops QT_QPA_PLATFORM=offscreen and needs a real display for its GL context; run the Linux ctest and the filtered gtest steps under xvfb-run --- .github/workflows/ci.yml | 13 +++++++------ engine/CMakeLists.txt | 6 ++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 423c8810b..fa2b0dcea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,8 @@ jobs: qt6-base-dev qt6-base-dev-tools qt6-base-private-dev qt6-tools-dev qt6-tools-dev-tools \ libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev \ libopencolorio-dev libopenimageio-dev libopenexr-dev libexpat1-dev \ - portaudio19-dev libgl1-mesa-dev libxkbcommon-dev ccache + portaudio19-dev libgl1-mesa-dev libxkbcommon-dev ccache \ + xvfb # ------------------------------------------------------------------ # macOS dependencies @@ -248,7 +249,7 @@ jobs: if: runner.os == 'Linux' env: QT_QPA_PLATFORM: offscreen - run: ctest --test-dir build --output-on-failure -C ${{ env.CMAKE_BUILD_TYPE }} + run: xvfb-run -a ctest --test-dir build --output-on-failure -C ${{ env.CMAKE_BUILD_TYPE }} - name: Test (macOS) if: runner.os == 'macOS' @@ -266,7 +267,7 @@ jobs: if: runner.os == 'Linux' env: QT_QPA_PLATFORM: offscreen - run: ./build/tests/gtest/olive-gtest --gtest_filter="PluginSmoke*" + run: xvfb-run -a ./build/tests/gtest/olive-gtest --gtest_filter="PluginSmoke*" - name: Plugin Smoke Tests (macOS) if: runner.os == 'macOS' @@ -281,7 +282,7 @@ jobs: if: runner.os == 'Linux' env: QT_QPA_PLATFORM: offscreen - run: ./build/tests/gtest/olive-gtest --gtest_filter="PluginIntegration.*:PluginMisc.*" + run: xvfb-run -a ./build/tests/gtest/olive-gtest --gtest_filter="PluginIntegration.*:PluginMisc.*" - name: OFX Integration Tests (macOS) if: runner.os == 'macOS' @@ -291,7 +292,7 @@ jobs: if: runner.os == 'Linux' env: QT_QPA_PLATFORM: offscreen - run: ./build/tests/gtest/olive-gtest --gtest_filter="AudioSmoke*" + run: xvfb-run -a ./build/tests/gtest/olive-gtest --gtest_filter="AudioSmoke*" - name: Audio Smoke Tests (macOS) if: runner.os == 'macOS' @@ -306,7 +307,7 @@ jobs: if: runner.os == 'Linux' env: QT_QPA_PLATFORM: offscreen - run: ./build/tests/gtest/olive-gtest --gtest_filter="ViewerSmoke*" + run: xvfb-run -a ./build/tests/gtest/olive-gtest --gtest_filter="ViewerSmoke*" - name: Viewer Smoke Tests (macOS) if: runner.os == 'macOS' diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index edc3a0409..9992b3c3c 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -309,6 +309,12 @@ if (BUILD_TESTS) if (UNIX AND NOT APPLE) target_link_options(${name} PRIVATE "LINKER:--export-dynamic") endif () + if (WIN32) + # The test embeds oakengine-obj; its OAKENGINE_API references must + # match the library side (dllexport), otherwise MinGW looks for + # __imp_* import stubs that only a real DLL import lib provides. + target_compile_definitions(${name} PRIVATE OAKENGINE_BUILD) + endif () # Freshly linked binaries can exceed the 5s default discovery # timeout on first run (dyld cold cache + Qt/OCIO init) if (WIN32)