diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fae87f9..c53c336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,61 +97,6 @@ jobs: mingw-w64-ucrt-x86_64-boost mingw-w64-ucrt-x86_64-nlohmann-json - - name: Prepare tests - id: prepare-tests - if: runner.os == 'Windows' - shell: pwsh - run: | - # function to download and extract a zip file - function DownloadAndExtract { - param ( - [string]$Uri, - [string]$OutFile - ) - - $maxRetries = 5 - $retryCount = 0 - $success = $false - - while (-not $success -and $retryCount -lt $maxRetries) { - $retryCount++ - Write-Host "Downloading $Uri to $OutFile, attempt $retryCount of $maxRetries" - try { - Invoke-WebRequest -Uri $Uri -OutFile $OutFile - $success = $true - } catch { - Write-Host "Attempt $retryCount of $maxRetries failed with error: $($_.Exception.Message). Retrying..." - Start-Sleep -Seconds 5 - } - } - - if (-not $success) { - Write-Host "Failed to download the file after $maxRetries attempts." - exit 1 - } - - # use .NET to get the base name of the file - $baseName = (Get-Item $OutFile).BaseName - - # Extract the zip file - Expand-Archive -Path $OutFile -DestinationPath $baseName - } - - # virtual display driver - DownloadAndExtract ` - -Uri "https://www.amyuni.com/downloads/usbmmidd_v2.zip" ` - -OutFile "usbmmidd_v2.zip" - - # install - Set-Location -Path usbmmidd_v2/usbmmidd_v2 - ./deviceinstaller64 install usbmmidd.inf usbmmidd - - # create 2 virtual displays, using 3+ can crash the runner - # see: https://github.com/LizardByte/libdisplaydevice/pull/36 - for ($i = 1; $i -le 2; $i++) { - ./deviceinstaller64 enableidd 1 - } - - name: Setup python id: setup-python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 diff --git a/tests/unit/windows/test_win_display_device_hdr.cpp b/tests/unit/windows/test_win_display_device_hdr.cpp index 985a785..fa1f2f0 100644 --- a/tests/unit/windows/test_win_display_device_hdr.cpp +++ b/tests/unit/windows/test_win_display_device_hdr.cpp @@ -63,9 +63,13 @@ namespace { } // namespace TEST_F_S(GetSetHdrStates) { - const auto available_devices {getAvailableDevices(*m_layer)}; + const auto available_devices {getAvailableDevices(*m_layer, false)}; ASSERT_TRUE(available_devices); + if (available_devices->empty()) { + GTEST_SKIP_("No displays are available in the system."); + } + const auto topology_guard {makeTopologyGuard(m_win_dd)}; ASSERT_TRUE(m_win_dd.setTopology(makeExtendedTopology(*available_devices)));