Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions core/libs/prx/libSceVideoOut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ target_include_directories(video_out_flip_tests PRIVATE ${LIBS_INCLUDE_DIR} ${CM
target_link_libraries(video_out_flip_tests PRIVATE libSceVideoOut libSceAgcDriver libkernel libc)
set_target_properties(video_out_flip_tests PROPERTIES CXX_EXTENSIONS OFF)
configure_windows_unwind(video_out_flip_tests)
if(BUILD_TESTING)
set_target_properties(video_out_flip_tests PROPERTIES EXCLUDE_FROM_ALL OFF)
foreach(flipMode IN ITEMS lifetime decode controls)
if(flipMode STREQUAL "lifetime")
add_test(NAME video_out_flip_${flipMode} COMMAND video_out_flip_tests)
else()
add_test(NAME video_out_flip_${flipMode} COMMAND video_out_flip_tests ${flipMode})
endif()
set_tests_properties(video_out_flip_${flipMode} PROPERTIES TIMEOUT 30 SKIP_RETURN_CODE 77 ENVIRONMENT "SDL_VIDEODRIVER=offscreen")
if(WIN32)
set_tests_properties(video_out_flip_${flipMode} PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
endif()
endforeach()
endif()

if(BUILD_TESTING)
add_test_executable(pad_sdl_tests tests/PadSdl.cpp)
Expand Down
7 changes: 6 additions & 1 deletion core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,12 @@ void VideoOutDriver::presentLoop(std::stop_token token, std::promise<void>& star
cancelled.swap(flipQueue->requests);
}
}
AgcDriverShutdown_nid_postfix();
try {
AgcDriverShutdown_nid_postfix();
} catch (...) {
std::lock_guard lock(flipQueue->mutex);
if (!flipQueue->failure) flipQueue->failure = std::current_exception();
}
window.Destroy();
}

Expand Down
6 changes: 6 additions & 0 deletions core/libs/prx/libSceVideoOut/tests/Flip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <initializer_list>
#include <string>
#include <limits>
Expand Down Expand Up @@ -532,6 +535,8 @@ void testOneDevice() {

int main(int argc, char** argv) {
try {
std::filesystem::create_directories("app0/sce_sys");
std::ofstream("app0/sce_sys/param.json", std::ios::binary) << R"({"titleId":"PPSA00000","localizedParameters":{"en-US":{"titleName":"Example"}},"downloadDataSize":0})";
if (argc == 2 && std::string(argv[1]) == "decode") testDecode();
else if (argc == 2 && std::string(argv[1]) == "controls") testControls();
else if (argc == 2 && std::string(argv[1]) == "present") testPresentation();
Expand All @@ -548,6 +553,7 @@ int main(int argc, char** argv) {
std::fprintf(stderr, "%s\n", error.what());
try { LibcRunShutdown_nid_postfix(); }
catch (const std::exception& shutdown) { std::fprintf(stderr, "shutdown: %s\n", shutdown.what()); }
if (std::string(error.what()).find("Vulkan support") != std::string::npos && !std::getenv("ANYPS5_REQUIRE_DISPLAY")) return 77;
return 1;
}
}
1 change: 0 additions & 1 deletion tools/check_test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

KNOWN_UNRUN = {
"agc_driver_recorder_tests",
"video_out_flip_tests",
}


Expand Down
Loading