test(videoout): skip the output mode test without a display

guest_video_out_output_mode (#1496) opens VideoOut directly, which needs
a Vulkan-capable SDL window, and aborts on the CI runners that have none.
Skip with 77 like the other VideoOut window tests, unless
ANYPS5_REQUIRE_DISPLAY is set.
This commit is contained in:
Dean Galvin 2026-10-10 15:36:07 +13:00
parent d1bf5c73de
commit 19d620dec5
2 changed files with 10 additions and 2 deletions

View File

@ -89,7 +89,7 @@ if(BUILD_TESTING)
target_link_libraries(guest_video_out_output_mode_tests PRIVATE libSceVideoOut libSceAgcDriver libkernel libc)
configure_windows_unwind(guest_video_out_output_mode_tests)
add_test(NAME guest_video_out_output_mode COMMAND guest_video_out_output_mode_tests)
set_tests_properties(guest_video_out_output_mode PROPERTIES TIMEOUT 20)
set_tests_properties(guest_video_out_output_mode PROPERTIES TIMEOUT 20 SKIP_RETURN_CODE 77)
if(WIN32)
set_tests_properties(guest_video_out_output_mode PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")

View File

@ -2,6 +2,7 @@
#include "prx/libc/include/Shutdown.hpp"
#include <array>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <stdexcept>
@ -39,7 +40,14 @@ int main() {
Require(sceVideoOutIsOutputSupported(handle, 2, nullptr, &options, 1) == INVALID_HANDLE);
}
const int handle = sceVideoOutOpen(SYSTEM_USER, MAIN_BUS, 0, nullptr);
int handle = 0;
try {
handle = sceVideoOutOpen(SYSTEM_USER, MAIN_BUS, 0, nullptr);
} catch (const std::runtime_error& error) {
if (std::getenv("ANYPS5_REQUIRE_DISPLAY") != nullptr) throw;
std::printf("skipped, no display or Vulkan device: %s\n", error.what());
return 77;
}
Require(handle > 0);
Require(sceVideoOutIsOutputSupported(handle, 1, &options, nullptr, 0) == 1);
Require(sceVideoOutIsOutputSupported(handle, 1, nullptr, nullptr, 0) == 1);