From b22ede6c934826116dc12e767e67e1f4d595588e Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 1 Oct 2026 12:21:46 +0300 Subject: [PATCH 1/5] refactor(cmake): move some libs test definitions to local cmakelists --- README.md | 2 +- core/libs/CMakeLists.txt | 436 ------------------ core/libs/prx/libSceAgc/CMakeLists.txt | 12 + core/libs/prx/libSceAgcDriver/CMakeLists.txt | 63 +++ core/libs/prx/libSceAudioOut/CMakeLists.txt | 18 + core/libs/prx/libSceFont/CMakeLists.txt | 17 + core/libs/prx/libSceJpegEnc/CMakeLists.txt | 18 + .../CMakeLists.txt | 18 + core/libs/prx/libScePngDec/CMakeLists.txt | 18 + .../prx/libScePosixForWebKit/CMakeLists.txt | 17 + core/libs/prx/libSceVideoOut/CMakeLists.txt | 12 + core/libs/prx/libSceVideodec2/CMakeLists.txt | 18 + core/libs/prx/libc/CMakeLists.txt | 158 +++++++ core/libs/prx/libkernel/CMakeLists.txt | 157 +++++++ 14 files changed, 527 insertions(+), 437 deletions(-) diff --git a/README.md b/README.md index 4d969e52e..7b78e635b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ On Intel hosts, pass `--to-intel` to the relinker to lower supported AMD-only in [libc.prx](core/libs/prx/libc) implementations contain compiler-specific code. Linux builds work with GCC; on Windows, MinGW-w64 GCC 15.2.0 (`winlibs-gcc15`, `x86_64-ucrt-posix-seh`) is currently required. -The project targets maximum compiler portability. Support for additional compilers will be addressed after the first successful game launch. +The project targets maximum compiler portability (but now it is not implemented). ## Compatibility diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index edc09b124..7fc6e12a6 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -129,15 +129,6 @@ list(APPEND PATCHED_OUTPUTS ${LIBCOHTML_PROSPERO_PATCHED}) add_custom_target(libs DEPENDS ${PATCHED_OUTPUTS}) if(BUILD_TESTING) - add_executable(player_invitation_dialog_tests tests/PlayerInvitationDialog.cpp) - target_include_directories(player_invitation_dialog_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(player_invitation_dialog_tests PRIVATE libScePlayerInvitationDialog libc) - configure_windows_unwind(player_invitation_dialog_tests) - add_test(NAME player_invitation_dialog COMMAND player_invitation_dialog_tests) - if(WIN32) - set_tests_properties(player_invitation_dialog PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_library(host_thread_local_test_library SHARED tests/HostThreadLocalLibrary.cpp) target_include_directories(host_thread_local_test_library PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) add_executable(host_thread_local_tests tests/HostThreadLocal.cpp) @@ -148,93 +139,6 @@ if(BUILD_TESTING) endif() add_test(NAME host_thread_local COMMAND host_thread_local_tests) set_tests_properties(host_thread_local PROPERTIES TIMEOUT 15) - add_executable(texture_format_lookup_tests tests/TextureFormatLookup.cpp) - target_include_directories(texture_format_lookup_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/Vulkan-Headers/include) - target_link_libraries(texture_format_lookup_tests PRIVATE libSceAgcDriver libc) - configure_windows_unwind(texture_format_lookup_tests) - add_test(NAME texture_format_lookup COMMAND texture_format_lookup_tests) - if(WIN32) - set_tests_properties(texture_format_lookup PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(linear_display_buffer_tests tests/LinearDisplayBuffer.cpp) - target_include_directories(linear_display_buffer_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(linear_display_buffer_tests PRIVATE libSceAgcDriver libc) - configure_windows_unwind(linear_display_buffer_tests) - add_test(NAME linear_display_buffer COMMAND linear_display_buffer_tests) - if(WIN32) - set_tests_properties(linear_display_buffer PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_rendering_wait_tests tests/GuestRenderingWait.cpp) - target_include_directories(guest_rendering_wait_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_rendering_wait_tests PRIVATE libSceAgcDriver libc) - configure_windows_unwind(guest_rendering_wait_tests) - add_test(NAME guest_rendering_wait COMMAND guest_rendering_wait_tests) - if(WIN32) - set_tests_properties(guest_rendering_wait PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_buffer_reuse_tests tests/GuestBufferReuse.cpp) - target_include_directories(guest_buffer_reuse_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_buffer_reuse_tests PRIVATE libc) - configure_windows_unwind(guest_buffer_reuse_tests) - add_test(NAME guest_buffer_reuse COMMAND guest_buffer_reuse_tests) - if(WIN32) - set_tests_properties(guest_buffer_reuse PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(audio_out2_pad_mix_tests prx/libSceAudioOut/tests/AudioOut2PadMix.cpp prx/libSceAudioOut/src/AudioOut2PadMix.cpp) - target_include_directories(audio_out2_pad_mix_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(audio_out2_pad_mix_tests PRIVATE libc) - configure_windows_unwind(audio_out2_pad_mix_tests) - add_test(NAME audio_out2_pad_mix COMMAND audio_out2_pad_mix_tests) - if(WIN32) - set_tests_properties(audio_out2_pad_mix PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_indexed_draw_tests tests/GuestIndexedDraw.cpp) - add_executable(shader_buffer_address_tests tests/ShaderBufferAddress.cpp) - target_link_libraries(shader_buffer_address_tests PRIVATE shader_recompiler_agc_driver libc) - configure_windows_unwind(shader_buffer_address_tests) - add_test(NAME shader_buffer_address COMMAND shader_buffer_address_tests) - if(WIN32) - set_tests_properties(shader_buffer_address PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(ray_tracing_miss_tests tests/RayTracingMiss.cpp) - target_link_libraries(ray_tracing_miss_tests PRIVATE shader_recompiler_agc_driver libc) - configure_windows_unwind(ray_tracing_miss_tests) - add_test(NAME ray_tracing_miss COMMAND ray_tracing_miss_tests) - if(WIN32) - set_tests_properties(ray_tracing_miss PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(vector_compare_i16_u16_tests tests/VectorCompareI16U16.cpp) - target_link_libraries(vector_compare_i16_u16_tests PRIVATE shader_recompiler_agc_driver libc) - configure_windows_unwind(vector_compare_i16_u16_tests) - add_test(NAME vector_compare_i16_u16 COMMAND vector_compare_i16_u16_tests) - if(WIN32) - set_tests_properties(vector_compare_i16_u16 PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - target_include_directories(guest_indexed_draw_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_indexed_draw_tests PRIVATE libSceAgc libSceAgcDriver libc) - configure_windows_unwind(guest_indexed_draw_tests) - add_test(NAME guest_indexed_draw COMMAND guest_indexed_draw_tests) - if(WIN32) - set_tests_properties(guest_indexed_draw PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_shader_link_tests tests/GuestShaderLink.cpp) - target_include_directories(guest_shader_link_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_shader_link_tests PRIVATE libSceAgc libc) - configure_windows_unwind(guest_shader_link_tests) - add_test(NAME guest_shader_link COMMAND guest_shader_link_tests) - if(WIN32) - set_tests_properties(guest_shader_link PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_executable(guest_system_exit_tests tests/GuestSystemExit.cpp) target_include_directories(guest_system_exit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_system_exit_tests PRIVATE libSceSystemService libc) @@ -267,202 +171,6 @@ if(BUILD_TESTING) set_tests_properties(guest_content_export PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_character_tests tests/GuestCharacter.cpp) - target_include_directories(guest_character_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_character_tests PRIVATE libc) - configure_windows_unwind(guest_character_tests) - add_test(NAME guest_character COMMAND guest_character_tests) - if(WIN32) - set_tests_properties(guest_character PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_math_tests tests/GuestMath.cpp) - target_include_directories(guest_math_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_math_tests PRIVATE libc) - configure_windows_unwind(guest_math_tests) - add_test(NAME guest_math COMMAND guest_math_tests) - if(WIN32) - set_tests_properties(guest_math PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_working_directory_tests tests/GuestWorkingDirectory.cpp) - target_include_directories(guest_working_directory_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_working_directory_tests PRIVATE libc) - configure_windows_unwind(guest_working_directory_tests) - add_test(NAME guest_working_directory COMMAND guest_working_directory_tests) - if(WIN32) - set_tests_properties(guest_working_directory PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_library(guest_module_fixture SHARED tests/GuestModuleFixture.cpp) - target_include_directories(guest_module_fixture PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - add_custom_command(TARGET guest_module_fixture POST_BUILD - COMMAND $ guest_module_fixture $ - VERBATIM) - add_dependencies(guest_module_fixture nid_patcher) - add_executable(guest_dynamic_loader_tests tests/GuestDynamicLoader.cpp) - target_include_directories(guest_dynamic_loader_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_dynamic_loader_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_dynamic_loader_tests) - add_dependencies(guest_dynamic_loader_tests guest_module_fixture) - add_test(NAME guest_dynamic_loader COMMAND guest_dynamic_loader_tests $) - set_tests_properties(guest_dynamic_loader PROPERTIES - WORKING_DIRECTORY "$") - if(WIN32) - set_tests_properties(guest_dynamic_loader PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_filesystem_tests tests/GuestFilesystem.cpp) - target_include_directories(guest_filesystem_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_filesystem_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_filesystem_tests) - add_test(NAME guest_filesystem COMMAND guest_filesystem_tests) - if(WIN32) - set_tests_properties(guest_filesystem PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_directory_tests tests/GuestDirectory.cpp) - target_include_directories(guest_directory_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_directory_tests PRIVATE libc) - configure_windows_unwind(guest_directory_tests) - add_test(NAME guest_directory COMMAND guest_directory_tests) - if(WIN32) - set_tests_properties(guest_directory PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_aio_tests tests/GuestAio.cpp) - target_include_directories(guest_aio_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_aio_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_aio_tests) - add_test(NAME guest_aio COMMAND guest_aio_tests) - if(WIN32) - set_tests_properties(guest_aio PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_environment_tests tests/GuestEnvironment.cpp) - target_include_directories(guest_environment_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_environment_tests PRIVATE libc) - configure_windows_unwind(guest_environment_tests) - add_test(NAME guest_environment COMMAND guest_environment_tests) - if(WIN32) - set_tests_properties(guest_environment PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_lifecycle_tests tests/GuestLifecycle.cpp) - target_include_directories(guest_lifecycle_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_lifecycle_tests PRIVATE libc) - configure_windows_unwind(guest_lifecycle_tests) - add_test(NAME guest_lifecycle COMMAND guest_lifecycle_tests) - if(WIN32) - set_tests_properties(guest_lifecycle PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_reallocalign_tests tests/GuestReallocalign.cpp) - target_include_directories(guest_reallocalign_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_reallocalign_tests PRIVATE libc) - configure_windows_unwind(guest_reallocalign_tests) - add_test(NAME guest_reallocalign COMMAND guest_reallocalign_tests) - if(WIN32) - set_tests_properties(guest_reallocalign PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_standard_stream_tests tests/GuestStandardStreams.cpp) - target_include_directories(guest_standard_stream_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_standard_stream_tests PRIVATE libc) - configure_windows_unwind(guest_standard_stream_tests) - add_test(NAME guest_standard_streams COMMAND guest_standard_stream_tests) - if(WIN32) - set_tests_properties(guest_standard_streams PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_once_tests tests/GuestOnce.cpp) - target_include_directories(guest_once_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_once_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_once_tests) - add_test(NAME guest_once COMMAND guest_once_tests) - set_tests_properties(guest_once PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_once PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_thread_self_tests tests/GuestThreadSelf.cpp) - target_include_directories(guest_thread_self_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_thread_self_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_thread_self_tests) - add_test(NAME guest_thread_self COMMAND guest_thread_self_tests) - set_tests_properties(guest_thread_self PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_thread_self PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_cond_timedwait_tests tests/GuestCondTimedwait.cpp) - target_include_directories(guest_cond_timedwait_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_cond_timedwait_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_cond_timedwait_tests) - add_test(NAME guest_cond_timedwait COMMAND guest_cond_timedwait_tests) - set_tests_properties(guest_cond_timedwait PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_cond_timedwait PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_pthread_sem_tests tests/GuestPthreadSem.cpp) - target_include_directories(guest_pthread_sem_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_pthread_sem_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_pthread_sem_tests) - add_test(NAME guest_pthread_sem COMMAND guest_pthread_sem_tests) - set_tests_properties(guest_pthread_sem PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_pthread_sem PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_signal_tests tests/GuestSignals.cpp) - target_include_directories(guest_signal_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_signal_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_signal_tests) - add_test(NAME guest_signals COMMAND guest_signal_tests) - if(WIN32) - set_tests_properties(guest_signals PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_kernel_error_tests tests/GuestKernelErrors.cpp) - target_include_directories(guest_kernel_error_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_kernel_error_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_kernel_error_tests) - add_test(NAME guest_kernel_errors COMMAND guest_kernel_error_tests) - set_tests_properties(guest_kernel_errors PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_kernel_errors PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_system_configuration_tests tests/GuestSystemConfiguration.cpp) - target_include_directories(guest_system_configuration_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_system_configuration_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_system_configuration_tests) - add_test(NAME guest_system_configuration COMMAND guest_system_configuration_tests) - if(WIN32) - set_tests_properties(guest_system_configuration PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_udp_tests tests/GuestUdp.cpp) - target_include_directories(guest_udp_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_udp_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_udp_tests) - add_test(NAME guest_udp COMMAND guest_udp_tests) - set_tests_properties(guest_udp PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_udp PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_tcp_tests tests/GuestTcp.cpp) - target_include_directories(guest_tcp_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_tcp_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_tcp_tests) - add_test(NAME guest_tcp COMMAND guest_tcp_tests) - set_tests_properties(guest_tcp PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_tcp PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_executable(guest_sce_net_tests tests/GuestSceNet.cpp) target_include_directories(guest_sce_net_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_sce_net_tests PRIVATE libSceNet libSceNetCtl) @@ -473,24 +181,6 @@ if(BUILD_TESTING) set_tests_properties(guest_sce_net PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_address_tests tests/GuestAddressConversion.cpp) - target_include_directories(guest_address_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_address_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_address_tests) - add_test(NAME guest_addresses COMMAND guest_address_tests) - if(WIN32) - set_tests_properties(guest_addresses PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_error_tests tests/GuestErrors.cpp) - target_include_directories(guest_error_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_error_tests PRIVATE libc) - configure_windows_unwind(guest_error_tests) - add_test(NAME guest_errors COMMAND guest_error_tests) - if(WIN32) - set_tests_properties(guest_errors PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_executable(guest_random_tests tests/GuestRandom.cpp) target_include_directories(guest_random_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_random_tests PRIVATE libSceRandom) @@ -499,14 +189,6 @@ if(BUILD_TESTING) set_tests_properties(guest_random PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_resolver_tests tests/GuestResolver.cpp) - target_include_directories(guest_resolver_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_resolver_tests PRIVATE libScePosixForWebKit) - add_test(NAME guest_resolver COMMAND guest_resolver_tests) - if(WIN32) - set_tests_properties(guest_resolver PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_executable(guest_rtc_tests tests/GuestRtc.cpp) target_include_directories(guest_rtc_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_rtc_tests PRIVATE libSceRtc) @@ -515,32 +197,6 @@ if(BUILD_TESTING) set_tests_properties(guest_rtc PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_jpeg_enc_tests tests/GuestJpegEnc.cpp) - target_include_directories(guest_jpeg_enc_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_jpeg_enc_tests PRIVATE libSceJpegEnc decoder_jpeg libc) - configure_windows_unwind(guest_jpeg_enc_tests) - add_test(NAME guest_jpeg_enc COMMAND guest_jpeg_enc_tests) - if(WIN32) - set_tests_properties(guest_jpeg_enc PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_png_dec_tests tests/GuestPngDec.cpp) - target_include_directories(guest_png_dec_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_png_dec_tests PRIVATE libScePngDec decoder_png libc) - configure_windows_unwind(guest_png_dec_tests) - add_test(NAME guest_png_dec COMMAND guest_png_dec_tests) - if(WIN32) - set_tests_properties(guest_png_dec PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_font_tests tests/GuestFont.cpp) - target_include_directories(guest_font_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_font_tests PRIVATE libSceFont libSceFontFt libc) - add_test(NAME guest_font COMMAND guest_font_tests) - if(WIN32) - set_tests_properties(guest_font PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() add_executable(guest_json_tests tests/GuestJson.cpp) target_include_directories(guest_json_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_json_tests PRIVATE libSceJson2 libc) @@ -557,102 +213,10 @@ if(BUILD_TESTING) set_tests_properties(fiber PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_videodec2_tests tests/GuestVideodec2.cpp) - target_include_directories(guest_videodec2_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_videodec2_tests PRIVATE libSceVideodec2 libc) - configure_windows_unwind(guest_videodec2_tests) - add_test(NAME guest_videodec2 COMMAND guest_videodec2_tests) - if(WIN32) - set_tests_properties(guest_videodec2 PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(mspace_tests tests/Mspace.cpp) - target_include_directories(mspace_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(mspace_tests PRIVATE libc) - configure_windows_unwind(mspace_tests) - add_test(NAME mspace COMMAND mspace_tests) - if(WIN32) - set_tests_properties(mspace PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_formatting_tests tests/Formatting.cpp) - target_include_directories(guest_formatting_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_formatting_tests PRIVATE libc) - configure_windows_unwind(guest_formatting_tests) - if(WIN32) - add_test(NAME guest_formatting COMMAND guest_formatting_tests) - set_tests_properties(guest_formatting PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_memory_tests tests/GuestMemory.cpp) - target_include_directories(guest_memory_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_memory_tests PRIVATE libkernel libc) - configure_windows_unwind(guest_memory_tests) - add_test(NAME guest_memory COMMAND guest_memory_tests) - if(WIN32) - set_tests_properties(guest_memory PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - if(NOT WIN32) - add_executable(guest_directory_entry_tests tests/GuestDirectoryEntries.cpp) - target_include_directories(guest_directory_entry_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_directory_entry_tests PRIVATE libkernel libc) - add_test(NAME guest_directory_entries COMMAND guest_directory_entry_tests) - endif() - add_executable(guest_search_tests tests/GuestSearch.cpp) - target_include_directories(guest_search_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_search_tests PRIVATE libc) - configure_windows_unwind(guest_search_tests) - add_test(NAME guest_search COMMAND guest_search_tests) - if(WIN32) - set_tests_properties(guest_search PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_executable(guest_string_tests tests/GuestStrings.cpp) - target_include_directories(guest_string_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_string_tests PRIVATE libc libScePosixForWebKit) - configure_windows_unwind(guest_string_tests) - add_test(NAME guest_strings COMMAND guest_string_tests) - if(WIN32) - set_tests_properties(guest_strings PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - if(UNIX) - add_executable(exception_runtime_tests tests/ExceptionRuntime.cpp) - target_include_directories(exception_runtime_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(exception_runtime_tests PRIVATE libc) - add_test(NAME exception_runtime COMMAND exception_runtime_tests) - endif() endif() -add_executable(application_heap_tests EXCLUDE_FROM_ALL tests/ApplicationHeap.cpp) -target_include_directories(application_heap_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(application_heap_tests PRIVATE libc) -configure_windows_unwind(application_heap_tests) -set_target_properties(application_heap_tests PROPERTIES CXX_EXTENSIONS OFF) -if(BUILD_TESTING) - set_target_properties(application_heap_tests PROPERTIES EXCLUDE_FROM_ALL FALSE) - add_test(NAME application_heap_replacement COMMAND application_heap_tests) - add_test(NAME application_heap_invalid_metadata COMMAND application_heap_tests invalid) - add_test(NAME application_heap_default COMMAND application_heap_tests default) - if(WIN32) - set_tests_properties(application_heap_replacement application_heap_invalid_metadata application_heap_default - PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") - endif() -endif() - -add_executable(guest_locale_tests EXCLUDE_FROM_ALL tests/GuestLocale.cpp) -target_include_directories(guest_locale_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -set_target_properties(guest_locale_tests PROPERTIES CXX_EXTENSIONS OFF) -target_link_libraries(guest_locale_tests PRIVATE libc) -configure_windows_unwind(guest_locale_tests) - if(MINGW) foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") endforeach() - add_executable(windows_exception_tests EXCLUDE_FROM_ALL tests/WindowsExceptions.cpp) - set_target_properties(windows_exception_tests PROPERTIES CXX_EXTENSIONS OFF) - target_link_libraries(windows_exception_tests PRIVATE libc) - configure_windows_unwind(windows_exception_tests) endif() diff --git a/core/libs/prx/libSceAgc/CMakeLists.txt b/core/libs/prx/libSceAgc/CMakeLists.txt index 2fc49997f..90765da45 100644 --- a/core/libs/prx/libSceAgc/CMakeLists.txt +++ b/core/libs/prx/libSceAgc/CMakeLists.txt @@ -101,3 +101,15 @@ if(BUILD_TESTING) "PATH=path_list_prepend:$") endif() endif() + +if(BUILD_TESTING) + add_executable(guest_shader_link_tests ${LIBS_INCLUDE_DIR}/tests/GuestShaderLink.cpp) + target_include_directories(guest_shader_link_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_shader_link_tests PRIVATE libSceAgc libc) + configure_windows_unwind(guest_shader_link_tests) + add_test(NAME guest_shader_link COMMAND guest_shader_link_tests) + if(WIN32) + set_tests_properties(guest_shader_link PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index 5ce997456..de90dd2cb 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -496,3 +496,66 @@ if(ANYPS5_ENABLE_SPIRV_TOOLS) endif() set_target_properties(agc_shader_replay PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_shader_replay) + +if(BUILD_TESTING) + add_executable(texture_format_lookup_tests ${LIBS_INCLUDE_DIR}/tests/TextureFormatLookup.cpp) + target_include_directories(texture_format_lookup_tests PRIVATE ${LIBS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/Vulkan-Headers/include) + target_link_libraries(texture_format_lookup_tests PRIVATE libSceAgcDriver libc) + configure_windows_unwind(texture_format_lookup_tests) + add_test(NAME texture_format_lookup COMMAND texture_format_lookup_tests) + if(WIN32) + set_tests_properties(texture_format_lookup PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(linear_display_buffer_tests ${LIBS_INCLUDE_DIR}/tests/LinearDisplayBuffer.cpp) + target_include_directories(linear_display_buffer_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(linear_display_buffer_tests PRIVATE libSceAgcDriver libc) + configure_windows_unwind(linear_display_buffer_tests) + add_test(NAME linear_display_buffer COMMAND linear_display_buffer_tests) + if(WIN32) + set_tests_properties(linear_display_buffer PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_rendering_wait_tests ${LIBS_INCLUDE_DIR}/tests/GuestRenderingWait.cpp) + target_include_directories(guest_rendering_wait_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_rendering_wait_tests PRIVATE libSceAgcDriver libc) + configure_windows_unwind(guest_rendering_wait_tests) + add_test(NAME guest_rendering_wait COMMAND guest_rendering_wait_tests) + if(WIN32) + set_tests_properties(guest_rendering_wait PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(shader_buffer_address_tests ${LIBS_INCLUDE_DIR}/tests/ShaderBufferAddress.cpp) + target_link_libraries(shader_buffer_address_tests PRIVATE shader_recompiler_agc_driver libc) + configure_windows_unwind(shader_buffer_address_tests) + add_test(NAME shader_buffer_address COMMAND shader_buffer_address_tests) + if(WIN32) + set_tests_properties(shader_buffer_address PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(ray_tracing_miss_tests ${LIBS_INCLUDE_DIR}/tests/RayTracingMiss.cpp) + target_link_libraries(ray_tracing_miss_tests PRIVATE shader_recompiler_agc_driver libc) + configure_windows_unwind(ray_tracing_miss_tests) + add_test(NAME ray_tracing_miss COMMAND ray_tracing_miss_tests) + if(WIN32) + set_tests_properties(ray_tracing_miss PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(vector_compare_i16_u16_tests ${LIBS_INCLUDE_DIR}/tests/VectorCompareI16U16.cpp) + target_link_libraries(vector_compare_i16_u16_tests PRIVATE shader_recompiler_agc_driver libc) + configure_windows_unwind(vector_compare_i16_u16_tests) + add_test(NAME vector_compare_i16_u16 COMMAND vector_compare_i16_u16_tests) + if(WIN32) + set_tests_properties(vector_compare_i16_u16 PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_indexed_draw_tests ${LIBS_INCLUDE_DIR}/tests/GuestIndexedDraw.cpp) + target_include_directories(guest_indexed_draw_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_indexed_draw_tests PRIVATE libSceAgc libSceAgcDriver libc) + configure_windows_unwind(guest_indexed_draw_tests) + add_test(NAME guest_indexed_draw COMMAND guest_indexed_draw_tests) + if(WIN32) + set_tests_properties(guest_indexed_draw PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceAudioOut/CMakeLists.txt b/core/libs/prx/libSceAudioOut/CMakeLists.txt index f9a479870..6490a9774 100644 --- a/core/libs/prx/libSceAudioOut/CMakeLists.txt +++ b/core/libs/prx/libSceAudioOut/CMakeLists.txt @@ -15,3 +15,21 @@ target_include_directories(libSceAudioOut PRIVATE ) target_link_libraries(libSceAudioOut PRIVATE libc libkernel SDL2-static) configure_windows_unwind(libSceAudioOut) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(audio_out2_pad_mix_tests tests/AudioOut2PadMix.cpp src/AudioOut2PadMix.cpp) + target_include_directories(audio_out2_pad_mix_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(audio_out2_pad_mix_tests PRIVATE libc) + configure_windows_unwind(audio_out2_pad_mix_tests) + add_test(NAME audio_out2_pad_mix COMMAND audio_out2_pad_mix_tests) + if(WIN32) + set_tests_properties(audio_out2_pad_mix PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceFont/CMakeLists.txt b/core/libs/prx/libSceFont/CMakeLists.txt index ccbfe95e4..4ac9628a6 100644 --- a/core/libs/prx/libSceFont/CMakeLists.txt +++ b/core/libs/prx/libSceFont/CMakeLists.txt @@ -1,2 +1,19 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/FontLibrary.cmake) add_sce_font_library(libSceFont) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(guest_font_tests ${LIBS_INCLUDE_DIR}/tests/GuestFont.cpp) + target_include_directories(guest_font_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_font_tests PRIVATE libSceFont libSceFontFt libc) + add_test(NAME guest_font COMMAND guest_font_tests) + if(WIN32) + set_tests_properties(guest_font PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceJpegEnc/CMakeLists.txt b/core/libs/prx/libSceJpegEnc/CMakeLists.txt index 4ddeab93a..34233df70 100644 --- a/core/libs/prx/libSceJpegEnc/CMakeLists.txt +++ b/core/libs/prx/libSceJpegEnc/CMakeLists.txt @@ -3,3 +3,21 @@ target_include_directories(libSceJpegEnc PRIVATE ${LIBS_INCLUDE_DIR}) set_target_properties(libSceJpegEnc PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(libSceJpegEnc) target_link_libraries(libSceJpegEnc PRIVATE decoder_jpeg) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(guest_jpeg_enc_tests ${LIBS_INCLUDE_DIR}/tests/GuestJpegEnc.cpp) + target_include_directories(guest_jpeg_enc_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_jpeg_enc_tests PRIVATE libSceJpegEnc decoder_jpeg libc) + configure_windows_unwind(guest_jpeg_enc_tests) + add_test(NAME guest_jpeg_enc COMMAND guest_jpeg_enc_tests) + if(WIN32) + set_tests_properties(guest_jpeg_enc PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt b/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt index 6f51b0562..5bfc7826e 100644 --- a/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt +++ b/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt @@ -1,3 +1,21 @@ add_library(libScePlayerInvitationDialog SHARED EXCLUDE_FROM_ALL libScePlayerInvitationDialog.cpp) target_include_directories(libScePlayerInvitationDialog PRIVATE ${LIBS_INCLUDE_DIR}) configure_windows_unwind(libScePlayerInvitationDialog) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(player_invitation_dialog_tests ${LIBS_INCLUDE_DIR}/tests/PlayerInvitationDialog.cpp) + target_include_directories(player_invitation_dialog_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(player_invitation_dialog_tests PRIVATE libScePlayerInvitationDialog libc) + configure_windows_unwind(player_invitation_dialog_tests) + add_test(NAME player_invitation_dialog COMMAND player_invitation_dialog_tests) + if(WIN32) + set_tests_properties(player_invitation_dialog PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libScePngDec/CMakeLists.txt b/core/libs/prx/libScePngDec/CMakeLists.txt index afe97d56b..eab91d6df 100644 --- a/core/libs/prx/libScePngDec/CMakeLists.txt +++ b/core/libs/prx/libScePngDec/CMakeLists.txt @@ -3,3 +3,21 @@ target_include_directories(libScePngDec PRIVATE ${LIBS_INCLUDE_DIR}) set_target_properties(libScePngDec PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(libScePngDec) target_link_libraries(libScePngDec PRIVATE decoder_png) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(guest_png_dec_tests ${LIBS_INCLUDE_DIR}/tests/GuestPngDec.cpp) + target_include_directories(guest_png_dec_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_png_dec_tests PRIVATE libScePngDec decoder_png libc) + configure_windows_unwind(guest_png_dec_tests) + add_test(NAME guest_png_dec COMMAND guest_png_dec_tests) + if(WIN32) + set_tests_properties(guest_png_dec PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libScePosixForWebKit/CMakeLists.txt b/core/libs/prx/libScePosixForWebKit/CMakeLists.txt index f5e668f80..61eeaeca2 100644 --- a/core/libs/prx/libScePosixForWebKit/CMakeLists.txt +++ b/core/libs/prx/libScePosixForWebKit/CMakeLists.txt @@ -4,3 +4,20 @@ if(WIN32) target_link_libraries(libScePosixForWebKit PRIVATE ws2_32) endif() configure_windows_unwind(libScePosixForWebKit) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(guest_resolver_tests ${LIBS_INCLUDE_DIR}/tests/GuestResolver.cpp) + target_include_directories(guest_resolver_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_resolver_tests PRIVATE libScePosixForWebKit) + add_test(NAME guest_resolver COMMAND guest_resolver_tests) + if(WIN32) + set_tests_properties(guest_resolver PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceVideoOut/CMakeLists.txt b/core/libs/prx/libSceVideoOut/CMakeLists.txt index 7614efad3..d7c484bfd 100644 --- a/core/libs/prx/libSceVideoOut/CMakeLists.txt +++ b/core/libs/prx/libSceVideoOut/CMakeLists.txt @@ -36,3 +36,15 @@ if(BUILD_TESTING) target_link_libraries(pad_sdl_tests PRIVATE SDL2-static) add_test(NAME pad_sdl COMMAND pad_sdl_tests) endif() + +if(BUILD_TESTING) + add_executable(guest_buffer_reuse_tests ${LIBS_INCLUDE_DIR}/tests/GuestBufferReuse.cpp) + target_include_directories(guest_buffer_reuse_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_buffer_reuse_tests PRIVATE libc) + configure_windows_unwind(guest_buffer_reuse_tests) + add_test(NAME guest_buffer_reuse COMMAND guest_buffer_reuse_tests) + if(WIN32) + set_tests_properties(guest_buffer_reuse PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceVideodec2/CMakeLists.txt b/core/libs/prx/libSceVideodec2/CMakeLists.txt index b8dbc0f7d..4200328a4 100644 --- a/core/libs/prx/libSceVideodec2/CMakeLists.txt +++ b/core/libs/prx/libSceVideodec2/CMakeLists.txt @@ -6,3 +6,21 @@ target_include_directories(libSceVideodec2 PRIVATE ${LIBS_INCLUDE_DIR}) configure_windows_unwind(libSceVideodec2) target_link_libraries(libSceVideodec2 PRIVATE ffmpeg) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_executable(guest_videodec2_tests ${LIBS_INCLUDE_DIR}/tests/GuestVideodec2.cpp) + target_include_directories(guest_videodec2_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_videodec2_tests PRIVATE libSceVideodec2 libc) + configure_windows_unwind(guest_videodec2_tests) + add_test(NAME guest_videodec2 COMMAND guest_videodec2_tests) + if(WIN32) + set_tests_properties(guest_videodec2 PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libc/CMakeLists.txt b/core/libs/prx/libc/CMakeLists.txt index 5d8e197fb..57251427f 100644 --- a/core/libs/prx/libc/CMakeLists.txt +++ b/core/libs/prx/libc/CMakeLists.txt @@ -39,3 +39,161 @@ target_sources(libc PRIVATE target_include_directories(libc PRIVATE ${LIBS_INCLUDE_DIR} ) + +if(BUILD_TESTING) + add_executable(guest_character_tests ${LIBS_INCLUDE_DIR}/tests/GuestCharacter.cpp) + target_include_directories(guest_character_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_character_tests PRIVATE libc) + configure_windows_unwind(guest_character_tests) + add_test(NAME guest_character COMMAND guest_character_tests) + if(WIN32) + set_tests_properties(guest_character PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_math_tests ${LIBS_INCLUDE_DIR}/tests/GuestMath.cpp) + target_include_directories(guest_math_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_math_tests PRIVATE libc) + configure_windows_unwind(guest_math_tests) + add_test(NAME guest_math COMMAND guest_math_tests) + if(WIN32) + set_tests_properties(guest_math PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_working_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestWorkingDirectory.cpp) + target_include_directories(guest_working_directory_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_working_directory_tests PRIVATE libc) + configure_windows_unwind(guest_working_directory_tests) + add_test(NAME guest_working_directory COMMAND guest_working_directory_tests) + if(WIN32) + set_tests_properties(guest_working_directory PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectory.cpp) + target_include_directories(guest_directory_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_directory_tests PRIVATE libc) + configure_windows_unwind(guest_directory_tests) + add_test(NAME guest_directory COMMAND guest_directory_tests) + if(WIN32) + set_tests_properties(guest_directory PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_environment_tests ${LIBS_INCLUDE_DIR}/tests/GuestEnvironment.cpp) + target_include_directories(guest_environment_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_environment_tests PRIVATE libc) + configure_windows_unwind(guest_environment_tests) + add_test(NAME guest_environment COMMAND guest_environment_tests) + if(WIN32) + set_tests_properties(guest_environment PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_lifecycle_tests ${LIBS_INCLUDE_DIR}/tests/GuestLifecycle.cpp) + target_include_directories(guest_lifecycle_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_lifecycle_tests PRIVATE libc) + configure_windows_unwind(guest_lifecycle_tests) + add_test(NAME guest_lifecycle COMMAND guest_lifecycle_tests) + if(WIN32) + set_tests_properties(guest_lifecycle PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_reallocalign_tests ${LIBS_INCLUDE_DIR}/tests/GuestReallocalign.cpp) + target_include_directories(guest_reallocalign_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_reallocalign_tests PRIVATE libc) + configure_windows_unwind(guest_reallocalign_tests) + add_test(NAME guest_reallocalign COMMAND guest_reallocalign_tests) + if(WIN32) + set_tests_properties(guest_reallocalign PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_standard_stream_tests ${LIBS_INCLUDE_DIR}/tests/GuestStandardStreams.cpp) + target_include_directories(guest_standard_stream_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_standard_stream_tests PRIVATE libc) + configure_windows_unwind(guest_standard_stream_tests) + add_test(NAME guest_standard_streams COMMAND guest_standard_stream_tests) + if(WIN32) + set_tests_properties(guest_standard_streams PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestErrors.cpp) + target_include_directories(guest_error_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_error_tests PRIVATE libc) + configure_windows_unwind(guest_error_tests) + add_test(NAME guest_errors COMMAND guest_error_tests) + if(WIN32) + set_tests_properties(guest_errors PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(mspace_tests ${LIBS_INCLUDE_DIR}/tests/Mspace.cpp) + target_include_directories(mspace_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(mspace_tests PRIVATE libc) + configure_windows_unwind(mspace_tests) + add_test(NAME mspace COMMAND mspace_tests) + if(WIN32) + set_tests_properties(mspace PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_formatting_tests ${LIBS_INCLUDE_DIR}/tests/Formatting.cpp) + target_include_directories(guest_formatting_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_formatting_tests PRIVATE libc) + configure_windows_unwind(guest_formatting_tests) + if(WIN32) + add_test(NAME guest_formatting COMMAND guest_formatting_tests) + set_tests_properties(guest_formatting PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_search_tests ${LIBS_INCLUDE_DIR}/tests/GuestSearch.cpp) + target_include_directories(guest_search_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_search_tests PRIVATE libc) + configure_windows_unwind(guest_search_tests) + add_test(NAME guest_search COMMAND guest_search_tests) + if(WIN32) + set_tests_properties(guest_search PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_string_tests ${LIBS_INCLUDE_DIR}/tests/GuestStrings.cpp) + target_include_directories(guest_string_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_string_tests PRIVATE libc libScePosixForWebKit) + configure_windows_unwind(guest_string_tests) + add_test(NAME guest_strings COMMAND guest_string_tests) + if(WIN32) + set_tests_properties(guest_strings PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + if(UNIX) + add_executable(exception_runtime_tests ${LIBS_INCLUDE_DIR}/tests/ExceptionRuntime.cpp) + target_include_directories(exception_runtime_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(exception_runtime_tests PRIVATE libc) + add_test(NAME exception_runtime COMMAND exception_runtime_tests) + endif() +endif() + +add_executable(application_heap_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/ApplicationHeap.cpp) +target_include_directories(application_heap_tests PRIVATE ${LIBS_INCLUDE_DIR}) +target_link_libraries(application_heap_tests PRIVATE libc) +configure_windows_unwind(application_heap_tests) +set_target_properties(application_heap_tests PROPERTIES CXX_EXTENSIONS OFF) +if(BUILD_TESTING) + set_target_properties(application_heap_tests PROPERTIES EXCLUDE_FROM_ALL FALSE) + add_test(NAME application_heap_replacement COMMAND application_heap_tests) + add_test(NAME application_heap_invalid_metadata COMMAND application_heap_tests invalid) + add_test(NAME application_heap_default COMMAND application_heap_tests default) + if(WIN32) + set_tests_properties(application_heap_replacement application_heap_invalid_metadata application_heap_default + PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") + endif() +endif() + +add_executable(guest_locale_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/GuestLocale.cpp) +target_include_directories(guest_locale_tests PRIVATE ${LIBS_INCLUDE_DIR}) +set_target_properties(guest_locale_tests PROPERTIES CXX_EXTENSIONS OFF) +target_link_libraries(guest_locale_tests PRIVATE libc) +configure_windows_unwind(guest_locale_tests) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() + add_executable(windows_exception_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/WindowsExceptions.cpp) + set_target_properties(windows_exception_tests PROPERTIES CXX_EXTENSIONS OFF) + target_link_libraries(windows_exception_tests PRIVATE libc) + configure_windows_unwind(windows_exception_tests) +endif() diff --git a/core/libs/prx/libkernel/CMakeLists.txt b/core/libs/prx/libkernel/CMakeLists.txt index dc6eaa05b..0a43898ed 100644 --- a/core/libs/prx/libkernel/CMakeLists.txt +++ b/core/libs/prx/libkernel/CMakeLists.txt @@ -61,3 +61,160 @@ if(WIN32) target_compile_definitions(libkernel PRIVATE _WIN32_WINNT=0x0602) endif() configure_windows_unwind(libkernel) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_library(guest_module_fixture SHARED ${LIBS_INCLUDE_DIR}/tests/GuestModuleFixture.cpp) + target_include_directories(guest_module_fixture PRIVATE ${LIBS_INCLUDE_DIR}) + add_custom_command(TARGET guest_module_fixture POST_BUILD + COMMAND $ guest_module_fixture $ + VERBATIM) + add_dependencies(guest_module_fixture nid_patcher) + add_executable(guest_dynamic_loader_tests ${LIBS_INCLUDE_DIR}/tests/GuestDynamicLoader.cpp) + target_include_directories(guest_dynamic_loader_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_dynamic_loader_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_dynamic_loader_tests) + add_dependencies(guest_dynamic_loader_tests guest_module_fixture) + add_test(NAME guest_dynamic_loader COMMAND guest_dynamic_loader_tests $) + set_tests_properties(guest_dynamic_loader PROPERTIES + WORKING_DIRECTORY "$") + if(WIN32) + set_tests_properties(guest_dynamic_loader PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_filesystem_tests ${LIBS_INCLUDE_DIR}/tests/GuestFilesystem.cpp) + target_include_directories(guest_filesystem_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_filesystem_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_filesystem_tests) + add_test(NAME guest_filesystem COMMAND guest_filesystem_tests) + if(WIN32) + set_tests_properties(guest_filesystem PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_aio_tests ${LIBS_INCLUDE_DIR}/tests/GuestAio.cpp) + target_include_directories(guest_aio_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_aio_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_aio_tests) + add_test(NAME guest_aio COMMAND guest_aio_tests) + if(WIN32) + set_tests_properties(guest_aio PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_once_tests ${LIBS_INCLUDE_DIR}/tests/GuestOnce.cpp) + target_include_directories(guest_once_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_once_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_once_tests) + add_test(NAME guest_once COMMAND guest_once_tests) + set_tests_properties(guest_once PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_once PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_thread_self_tests ${LIBS_INCLUDE_DIR}/tests/GuestThreadSelf.cpp) + target_include_directories(guest_thread_self_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_thread_self_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_thread_self_tests) + add_test(NAME guest_thread_self COMMAND guest_thread_self_tests) + set_tests_properties(guest_thread_self PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_thread_self PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_cond_timedwait_tests ${LIBS_INCLUDE_DIR}/tests/GuestCondTimedwait.cpp) + target_include_directories(guest_cond_timedwait_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_cond_timedwait_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_cond_timedwait_tests) + add_test(NAME guest_cond_timedwait COMMAND guest_cond_timedwait_tests) + set_tests_properties(guest_cond_timedwait PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_cond_timedwait PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_pthread_sem_tests ${LIBS_INCLUDE_DIR}/tests/GuestPthreadSem.cpp) + target_include_directories(guest_pthread_sem_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_pthread_sem_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_pthread_sem_tests) + add_test(NAME guest_pthread_sem COMMAND guest_pthread_sem_tests) + set_tests_properties(guest_pthread_sem PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_pthread_sem PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_signal_tests ${LIBS_INCLUDE_DIR}/tests/GuestSignals.cpp) + target_include_directories(guest_signal_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_signal_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_signal_tests) + add_test(NAME guest_signals COMMAND guest_signal_tests) + if(WIN32) + set_tests_properties(guest_signals PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_kernel_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestKernelErrors.cpp) + target_include_directories(guest_kernel_error_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_kernel_error_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_kernel_error_tests) + add_test(NAME guest_kernel_errors COMMAND guest_kernel_error_tests) + set_tests_properties(guest_kernel_errors PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_kernel_errors PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_system_configuration_tests ${LIBS_INCLUDE_DIR}/tests/GuestSystemConfiguration.cpp) + target_include_directories(guest_system_configuration_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_system_configuration_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_system_configuration_tests) + add_test(NAME guest_system_configuration COMMAND guest_system_configuration_tests) + if(WIN32) + set_tests_properties(guest_system_configuration PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_udp_tests ${LIBS_INCLUDE_DIR}/tests/GuestUdp.cpp) + target_include_directories(guest_udp_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_udp_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_udp_tests) + add_test(NAME guest_udp COMMAND guest_udp_tests) + set_tests_properties(guest_udp PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_udp PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_tcp_tests ${LIBS_INCLUDE_DIR}/tests/GuestTcp.cpp) + target_include_directories(guest_tcp_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_tcp_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_tcp_tests) + add_test(NAME guest_tcp COMMAND guest_tcp_tests) + set_tests_properties(guest_tcp PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_tcp PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_address_tests ${LIBS_INCLUDE_DIR}/tests/GuestAddressConversion.cpp) + target_include_directories(guest_address_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_address_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_address_tests) + add_test(NAME guest_addresses COMMAND guest_address_tests) + if(WIN32) + set_tests_properties(guest_addresses PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_executable(guest_memory_tests ${LIBS_INCLUDE_DIR}/tests/GuestMemory.cpp) + target_include_directories(guest_memory_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_memory_tests PRIVATE libkernel libc) + configure_windows_unwind(guest_memory_tests) + add_test(NAME guest_memory COMMAND guest_memory_tests) + if(WIN32) + set_tests_properties(guest_memory PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + if(NOT WIN32) + add_executable(guest_directory_entry_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectoryEntries.cpp) + target_include_directories(guest_directory_entry_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_directory_entry_tests PRIVATE libkernel libc) + add_test(NAME guest_directory_entries COMMAND guest_directory_entry_tests) + endif() +endif() From 61ba4d661a910ac46dec9223a868e976c39dd91d Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 1 Oct 2026 12:28:06 +0300 Subject: [PATCH 2/5] refactor(cmake): place all test executables in build tests directory --- CMakeLists.txt | 7 +++ core/Decoder/Jpeg/CMakeLists.txt | 2 +- core/Decoder/Png/CMakeLists.txt | 2 +- core/libs/CMakeLists.txt | 19 ++++---- core/libs/prx/libSceAgc/CMakeLists.txt | 8 ++-- core/libs/prx/libSceAgcDriver/CMakeLists.txt | 47 ++++++++++--------- core/libs/prx/libSceAudioOut/CMakeLists.txt | 2 +- core/libs/prx/libSceFont/CMakeLists.txt | 2 +- core/libs/prx/libSceJpegEnc/CMakeLists.txt | 2 +- core/libs/prx/libSceMouse/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- core/libs/prx/libScePngDec/CMakeLists.txt | 2 +- .../prx/libScePosixForWebKit/CMakeLists.txt | 2 +- core/libs/prx/libSceVideoOut/CMakeLists.txt | 6 +-- core/libs/prx/libSceVideodec2/CMakeLists.txt | 2 +- core/libs/prx/libc/CMakeLists.txt | 34 +++++++------- core/libs/prx/libkernel/CMakeLists.txt | 30 ++++++------ core/relinker/CMakeLists.txt | 12 ++--- 18 files changed, 96 insertions(+), 87 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66a1b2b00..93be284f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ cmake_minimum_required(VERSION 3.20) project(Relinker CXX) +set(ANYPS5_TEST_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests") + +function(add_test_executable target) + add_executable(${target} ${ARGN}) + set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<1:${ANYPS5_TEST_OUTPUT_DIRECTORY}>") +endfunction() + option(BUILD_TESTING "Build and register relinker tests" OFF) if(BUILD_TESTING) enable_testing() diff --git a/core/Decoder/Jpeg/CMakeLists.txt b/core/Decoder/Jpeg/CMakeLists.txt index e438f197a..b9aa17616 100644 --- a/core/Decoder/Jpeg/CMakeLists.txt +++ b/core/Decoder/Jpeg/CMakeLists.txt @@ -9,7 +9,7 @@ set_target_properties(decoder_jpeg PROPERTIES ) if(BUILD_TESTING) - add_executable(decoder_jpeg_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Jpeg.cpp) + add_test_executable(decoder_jpeg_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Jpeg.cpp) target_link_libraries(decoder_jpeg_tests PRIVATE decoder_jpeg) add_test(NAME decoder_jpeg COMMAND decoder_jpeg_tests) endif() diff --git a/core/Decoder/Png/CMakeLists.txt b/core/Decoder/Png/CMakeLists.txt index 877b9cf6e..359651bd8 100644 --- a/core/Decoder/Png/CMakeLists.txt +++ b/core/Decoder/Png/CMakeLists.txt @@ -9,7 +9,7 @@ set_target_properties(decoder_png PROPERTIES ) if(BUILD_TESTING) - add_executable(decoder_png_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Png.cpp) + add_test_executable(decoder_png_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Png.cpp) target_link_libraries(decoder_png_tests PRIVATE decoder_png) add_test(NAME decoder_png COMMAND decoder_png_tests) endif() diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index 7fc6e12a6..f9e9744b4 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -130,8 +130,9 @@ add_custom_target(libs DEPENDS ${PATCHED_OUTPUTS}) if(BUILD_TESTING) add_library(host_thread_local_test_library SHARED tests/HostThreadLocalLibrary.cpp) + set_target_properties(host_thread_local_test_library PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<1:${ANYPS5_TEST_OUTPUT_DIRECTORY}>") target_include_directories(host_thread_local_test_library PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - add_executable(host_thread_local_tests tests/HostThreadLocal.cpp) + add_test_executable(host_thread_local_tests tests/HostThreadLocal.cpp) target_link_libraries(host_thread_local_tests PRIVATE host_thread_local_test_library) if(MINGW) target_compile_options(host_thread_local_test_library PRIVATE -fasynchronous-unwind-tables) @@ -139,7 +140,7 @@ if(BUILD_TESTING) endif() add_test(NAME host_thread_local COMMAND host_thread_local_tests) set_tests_properties(host_thread_local PROPERTIES TIMEOUT 15) - add_executable(guest_system_exit_tests tests/GuestSystemExit.cpp) + add_test_executable(guest_system_exit_tests tests/GuestSystemExit.cpp) target_include_directories(guest_system_exit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_system_exit_tests PRIVATE libSceSystemService libc) configure_windows_unwind(guest_system_exit_tests) @@ -153,7 +154,7 @@ if(BUILD_TESTING) set_tests_properties(guest_system_exit guest_system_exit_parameters guest_immediate_exit guest_return_from_main PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_system_service_tests tests/GuestSystemService.cpp) + add_test_executable(guest_system_service_tests tests/GuestSystemService.cpp) target_include_directories(guest_system_service_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_system_service_tests PRIVATE libSceSystemService libc) configure_windows_unwind(guest_system_service_tests) @@ -162,7 +163,7 @@ if(BUILD_TESTING) set_tests_properties(guest_system_service PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_content_export_tests tests/GuestContentExport.cpp) + add_test_executable(guest_content_export_tests tests/GuestContentExport.cpp) target_include_directories(guest_content_export_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_content_export_tests PRIVATE libSceContentExport libc) configure_windows_unwind(guest_content_export_tests) @@ -171,7 +172,7 @@ if(BUILD_TESTING) set_tests_properties(guest_content_export PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_sce_net_tests tests/GuestSceNet.cpp) + add_test_executable(guest_sce_net_tests tests/GuestSceNet.cpp) target_include_directories(guest_sce_net_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_sce_net_tests PRIVATE libSceNet libSceNetCtl) configure_windows_unwind(guest_sce_net_tests) @@ -181,7 +182,7 @@ if(BUILD_TESTING) set_tests_properties(guest_sce_net PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_random_tests tests/GuestRandom.cpp) + add_test_executable(guest_random_tests tests/GuestRandom.cpp) target_include_directories(guest_random_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_random_tests PRIVATE libSceRandom) add_test(NAME guest_random COMMAND guest_random_tests) @@ -189,7 +190,7 @@ if(BUILD_TESTING) set_tests_properties(guest_random PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_rtc_tests tests/GuestRtc.cpp) + add_test_executable(guest_rtc_tests tests/GuestRtc.cpp) target_include_directories(guest_rtc_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_rtc_tests PRIVATE libSceRtc) add_test(NAME guest_rtc COMMAND guest_rtc_tests) @@ -197,7 +198,7 @@ if(BUILD_TESTING) set_tests_properties(guest_rtc PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_json_tests tests/GuestJson.cpp) + add_test_executable(guest_json_tests tests/GuestJson.cpp) target_include_directories(guest_json_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(guest_json_tests PRIVATE libSceJson2 libc) add_test(NAME guest_json COMMAND guest_json_tests) @@ -205,7 +206,7 @@ if(BUILD_TESTING) set_tests_properties(guest_json PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(fiber_tests tests/Fiber.cpp) + add_test_executable(fiber_tests tests/Fiber.cpp) target_include_directories(fiber_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(fiber_tests PRIVATE libSceFiber libc) add_test(NAME fiber COMMAND fiber_tests) diff --git a/core/libs/prx/libSceAgc/CMakeLists.txt b/core/libs/prx/libSceAgc/CMakeLists.txt index 90765da45..ed4ed41a3 100644 --- a/core/libs/prx/libSceAgc/CMakeLists.txt +++ b/core/libs/prx/libSceAgc/CMakeLists.txt @@ -63,13 +63,13 @@ foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") endforeach() -add_executable(agc_command_tests EXCLUDE_FROM_ALL tests/Commands.cpp) +add_test_executable(agc_command_tests EXCLUDE_FROM_ALL tests/Commands.cpp) target_include_directories(agc_command_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(agc_command_tests PRIVATE libSceAgc libc) configure_windows_unwind(agc_command_tests) configure_windows_unwind(libSceAgc) -add_executable(agc_register_command_tests EXCLUDE_FROM_ALL +add_test_executable(agc_register_command_tests EXCLUDE_FROM_ALL tests/RegisterCommands.cpp Command/src/Packet.cpp DcbState/src/Registers.cpp @@ -87,7 +87,7 @@ if(BUILD_TESTING) endif() endif() -add_executable(agc_shader_fusion_tests EXCLUDE_FROM_ALL tests/ShaderFusion.cpp) +add_test_executable(agc_shader_fusion_tests EXCLUDE_FROM_ALL tests/ShaderFusion.cpp) target_include_directories(agc_shader_fusion_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(agc_shader_fusion_tests PRIVATE libSceAgc libc) set_target_properties(agc_shader_fusion_tests PROPERTIES CXX_EXTENSIONS OFF) @@ -103,7 +103,7 @@ if(BUILD_TESTING) endif() if(BUILD_TESTING) - add_executable(guest_shader_link_tests ${LIBS_INCLUDE_DIR}/tests/GuestShaderLink.cpp) + add_test_executable(guest_shader_link_tests ${LIBS_INCLUDE_DIR}/tests/GuestShaderLink.cpp) target_include_directories(guest_shader_link_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_shader_link_tests PRIVATE libSceAgc libc) configure_windows_unwind(guest_shader_link_tests) diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index de90dd2cb..4bcd34e81 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -122,7 +122,7 @@ foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") endforeach() -add_executable(agc_driver_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_tests EXCLUDE_FROM_ALL tests/Submit.cpp ) @@ -139,7 +139,7 @@ target_link_libraries(agc_driver_tests PRIVATE set_target_properties(agc_driver_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_tests) -add_executable(agc_driver_recompiler_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_recompiler_tests EXCLUDE_FROM_ALL tests/Recompiler.cpp ) @@ -155,7 +155,7 @@ target_link_libraries(agc_driver_recompiler_tests PRIVATE set_target_properties(agc_driver_recompiler_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_recompiler_tests) -add_executable(agc_shader_memory_tests EXCLUDE_FROM_ALL +add_test_executable(agc_shader_memory_tests EXCLUDE_FROM_ALL tests/ShaderMemory.cpp Execution/src/ShaderMemory.cpp Execution/src/GuestMemory.cpp @@ -165,23 +165,23 @@ target_link_libraries(agc_shader_memory_tests PRIVATE shader_recompiler_agc_driv set_target_properties(agc_shader_memory_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_shader_memory_tests) -add_executable(agc_structurizer_tests EXCLUDE_FROM_ALL tests/Structurizer.cpp) +add_test_executable(agc_structurizer_tests EXCLUDE_FROM_ALL tests/Structurizer.cpp) target_link_libraries(agc_structurizer_tests PRIVATE shader_recompiler_agc_driver libc) set_target_properties(agc_structurizer_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_structurizer_tests) -add_executable(agc_dpp_write_tests EXCLUDE_FROM_ALL tests/DppWrite.cpp) +add_test_executable(agc_dpp_write_tests EXCLUDE_FROM_ALL tests/DppWrite.cpp) target_link_libraries(agc_dpp_write_tests PRIVATE shader_recompiler_agc_driver libc) set_target_properties(agc_dpp_write_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_dpp_write_tests) -add_executable(agc_shader_disk_cache_tests EXCLUDE_FROM_ALL tests/ShaderDiskCache.cpp) +add_test_executable(agc_shader_disk_cache_tests EXCLUDE_FROM_ALL tests/ShaderDiskCache.cpp) target_include_directories(agc_shader_disk_cache_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(agc_shader_disk_cache_tests PRIVATE shader_recompiler_agc_driver libc) set_target_properties(agc_shader_disk_cache_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_shader_disk_cache_tests) -add_executable(agc_shader_control_flow_tests EXCLUDE_FROM_ALL +add_test_executable(agc_shader_control_flow_tests EXCLUDE_FROM_ALL tests/ControlFlow.cpp ) target_include_directories(agc_shader_control_flow_tests PRIVATE ${LIBS_INCLUDE_DIR}) @@ -189,7 +189,7 @@ target_link_libraries(agc_shader_control_flow_tests PRIVATE shader_recompiler_ag set_target_properties(agc_shader_control_flow_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_shader_control_flow_tests) -add_executable(agc_driver_flip_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_flip_tests EXCLUDE_FROM_ALL tests/Flip.cpp ) @@ -219,7 +219,7 @@ add_custom_command( VERBATIM ) -add_executable(agc_driver_recorder_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_recorder_tests EXCLUDE_FROM_ALL tests/Recorder.cpp ${agcSampleLodShaderHeader} ) @@ -240,7 +240,7 @@ target_link_libraries(agc_driver_recorder_tests PRIVATE set_target_properties(agc_driver_recorder_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_recorder_tests) -add_executable(agc_driver_pm4_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_pm4_tests EXCLUDE_FROM_ALL tests/Pm4.cpp ) @@ -256,7 +256,7 @@ target_link_libraries(agc_driver_pm4_tests PRIVATE set_target_properties(agc_driver_pm4_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_pm4_tests) -add_executable(agc_driver_graphics_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_graphics_tests EXCLUDE_FROM_ALL tests/Graphics.cpp tests/ColorTargetLayout.cpp tests/BdaResources.cpp @@ -314,7 +314,7 @@ target_link_libraries(agc_driver_graphics_tests PRIVATE set_target_properties(agc_driver_graphics_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_graphics_tests) -add_executable(agc_driver_bda_device_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_bda_device_tests EXCLUDE_FROM_ALL tests/BdaDevice.cpp tests/BdaShader.cpp tests/BdaExecution.cpp @@ -333,7 +333,7 @@ target_link_libraries(agc_driver_bda_device_tests PRIVATE SDL2-static libc shade set_target_properties(agc_driver_bda_device_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_bda_device_tests) -add_executable(agc_driver_mesh_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_mesh_tests EXCLUDE_FROM_ALL tests/Mesh.cpp ${agcDriverSources} ) @@ -347,7 +347,7 @@ target_link_libraries(agc_driver_mesh_tests PRIVATE shader_recompiler_agc_driver set_target_properties(agc_driver_mesh_tests PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_driver_mesh_tests) -add_executable(agc_driver_mix_precision_tests EXCLUDE_FROM_ALL +add_test_executable(agc_driver_mix_precision_tests EXCLUDE_FROM_ALL tests/MixPrecision.cpp ) target_include_directories(agc_driver_mix_precision_tests PRIVATE @@ -380,10 +380,11 @@ if(AGC_BUILD_VISUAL_TEST) set(visualShaders) foreach(stage IN ITEMS vert frag) - set(shaderOutput "${CMAKE_CURRENT_BINARY_DIR}/Triangle.${stage}.spv") + set(shaderOutput "${ANYPS5_TEST_OUTPUT_DIRECTORY}/Triangle.${stage}.spv") add_custom_command( OUTPUT "${shaderOutput}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${ANYPS5_TEST_OUTPUT_DIRECTORY}" COMMAND "$" -V --target-env vulkan1.1 @@ -398,7 +399,7 @@ if(AGC_BUILD_VISUAL_TEST) list(APPEND visualShaders "${shaderOutput}") endforeach() - add_executable(agc_driver_visual_test EXCLUDE_FROM_ALL + add_test_executable(agc_driver_visual_test EXCLUDE_FROM_ALL tests/Visual.cpp Execution/src/VulkanDevice.cpp Execution/src/AspectFit.cpp @@ -498,7 +499,7 @@ set_target_properties(agc_shader_replay PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(agc_shader_replay) if(BUILD_TESTING) - add_executable(texture_format_lookup_tests ${LIBS_INCLUDE_DIR}/tests/TextureFormatLookup.cpp) + add_test_executable(texture_format_lookup_tests ${LIBS_INCLUDE_DIR}/tests/TextureFormatLookup.cpp) target_include_directories(texture_format_lookup_tests PRIVATE ${LIBS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/Vulkan-Headers/include) target_link_libraries(texture_format_lookup_tests PRIVATE libSceAgcDriver libc) configure_windows_unwind(texture_format_lookup_tests) @@ -507,7 +508,7 @@ if(BUILD_TESTING) set_tests_properties(texture_format_lookup PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(linear_display_buffer_tests ${LIBS_INCLUDE_DIR}/tests/LinearDisplayBuffer.cpp) + add_test_executable(linear_display_buffer_tests ${LIBS_INCLUDE_DIR}/tests/LinearDisplayBuffer.cpp) target_include_directories(linear_display_buffer_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(linear_display_buffer_tests PRIVATE libSceAgcDriver libc) configure_windows_unwind(linear_display_buffer_tests) @@ -516,7 +517,7 @@ if(BUILD_TESTING) set_tests_properties(linear_display_buffer PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_rendering_wait_tests ${LIBS_INCLUDE_DIR}/tests/GuestRenderingWait.cpp) + add_test_executable(guest_rendering_wait_tests ${LIBS_INCLUDE_DIR}/tests/GuestRenderingWait.cpp) target_include_directories(guest_rendering_wait_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_rendering_wait_tests PRIVATE libSceAgcDriver libc) configure_windows_unwind(guest_rendering_wait_tests) @@ -525,7 +526,7 @@ if(BUILD_TESTING) set_tests_properties(guest_rendering_wait PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(shader_buffer_address_tests ${LIBS_INCLUDE_DIR}/tests/ShaderBufferAddress.cpp) + add_test_executable(shader_buffer_address_tests ${LIBS_INCLUDE_DIR}/tests/ShaderBufferAddress.cpp) target_link_libraries(shader_buffer_address_tests PRIVATE shader_recompiler_agc_driver libc) configure_windows_unwind(shader_buffer_address_tests) add_test(NAME shader_buffer_address COMMAND shader_buffer_address_tests) @@ -533,7 +534,7 @@ if(BUILD_TESTING) set_tests_properties(shader_buffer_address PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(ray_tracing_miss_tests ${LIBS_INCLUDE_DIR}/tests/RayTracingMiss.cpp) + add_test_executable(ray_tracing_miss_tests ${LIBS_INCLUDE_DIR}/tests/RayTracingMiss.cpp) target_link_libraries(ray_tracing_miss_tests PRIVATE shader_recompiler_agc_driver libc) configure_windows_unwind(ray_tracing_miss_tests) add_test(NAME ray_tracing_miss COMMAND ray_tracing_miss_tests) @@ -541,7 +542,7 @@ if(BUILD_TESTING) set_tests_properties(ray_tracing_miss PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(vector_compare_i16_u16_tests ${LIBS_INCLUDE_DIR}/tests/VectorCompareI16U16.cpp) + add_test_executable(vector_compare_i16_u16_tests ${LIBS_INCLUDE_DIR}/tests/VectorCompareI16U16.cpp) target_link_libraries(vector_compare_i16_u16_tests PRIVATE shader_recompiler_agc_driver libc) configure_windows_unwind(vector_compare_i16_u16_tests) add_test(NAME vector_compare_i16_u16 COMMAND vector_compare_i16_u16_tests) @@ -549,7 +550,7 @@ if(BUILD_TESTING) set_tests_properties(vector_compare_i16_u16 PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_indexed_draw_tests ${LIBS_INCLUDE_DIR}/tests/GuestIndexedDraw.cpp) + add_test_executable(guest_indexed_draw_tests ${LIBS_INCLUDE_DIR}/tests/GuestIndexedDraw.cpp) target_include_directories(guest_indexed_draw_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_indexed_draw_tests PRIVATE libSceAgc libSceAgcDriver libc) configure_windows_unwind(guest_indexed_draw_tests) diff --git a/core/libs/prx/libSceAudioOut/CMakeLists.txt b/core/libs/prx/libSceAudioOut/CMakeLists.txt index 6490a9774..94e484b31 100644 --- a/core/libs/prx/libSceAudioOut/CMakeLists.txt +++ b/core/libs/prx/libSceAudioOut/CMakeLists.txt @@ -23,7 +23,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(audio_out2_pad_mix_tests tests/AudioOut2PadMix.cpp src/AudioOut2PadMix.cpp) + add_test_executable(audio_out2_pad_mix_tests tests/AudioOut2PadMix.cpp src/AudioOut2PadMix.cpp) target_include_directories(audio_out2_pad_mix_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(audio_out2_pad_mix_tests PRIVATE libc) configure_windows_unwind(audio_out2_pad_mix_tests) diff --git a/core/libs/prx/libSceFont/CMakeLists.txt b/core/libs/prx/libSceFont/CMakeLists.txt index 4ac9628a6..3ae1d162b 100644 --- a/core/libs/prx/libSceFont/CMakeLists.txt +++ b/core/libs/prx/libSceFont/CMakeLists.txt @@ -8,7 +8,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(guest_font_tests ${LIBS_INCLUDE_DIR}/tests/GuestFont.cpp) + add_test_executable(guest_font_tests ${LIBS_INCLUDE_DIR}/tests/GuestFont.cpp) target_include_directories(guest_font_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_font_tests PRIVATE libSceFont libSceFontFt libc) add_test(NAME guest_font COMMAND guest_font_tests) diff --git a/core/libs/prx/libSceJpegEnc/CMakeLists.txt b/core/libs/prx/libSceJpegEnc/CMakeLists.txt index 34233df70..707bee436 100644 --- a/core/libs/prx/libSceJpegEnc/CMakeLists.txt +++ b/core/libs/prx/libSceJpegEnc/CMakeLists.txt @@ -11,7 +11,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(guest_jpeg_enc_tests ${LIBS_INCLUDE_DIR}/tests/GuestJpegEnc.cpp) + add_test_executable(guest_jpeg_enc_tests ${LIBS_INCLUDE_DIR}/tests/GuestJpegEnc.cpp) target_include_directories(guest_jpeg_enc_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_jpeg_enc_tests PRIVATE libSceJpegEnc decoder_jpeg libc) configure_windows_unwind(guest_jpeg_enc_tests) diff --git a/core/libs/prx/libSceMouse/CMakeLists.txt b/core/libs/prx/libSceMouse/CMakeLists.txt index 76b0c4fe8..a8284f73a 100644 --- a/core/libs/prx/libSceMouse/CMakeLists.txt +++ b/core/libs/prx/libSceMouse/CMakeLists.txt @@ -7,7 +7,7 @@ set_target_properties(libSceMouse PROPERTIES CXX_EXTENSIONS OFF) configure_windows_unwind(libSceMouse) if(BUILD_TESTING) - add_executable(mouse_tests + add_test_executable(mouse_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Mouse.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../libSceVideoOut/src/MouseInput.cpp ) diff --git a/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt b/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt index 5bfc7826e..915bd6a40 100644 --- a/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt +++ b/core/libs/prx/libScePlayerInvitationDialog/CMakeLists.txt @@ -9,7 +9,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(player_invitation_dialog_tests ${LIBS_INCLUDE_DIR}/tests/PlayerInvitationDialog.cpp) + add_test_executable(player_invitation_dialog_tests ${LIBS_INCLUDE_DIR}/tests/PlayerInvitationDialog.cpp) target_include_directories(player_invitation_dialog_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(player_invitation_dialog_tests PRIVATE libScePlayerInvitationDialog libc) configure_windows_unwind(player_invitation_dialog_tests) diff --git a/core/libs/prx/libScePngDec/CMakeLists.txt b/core/libs/prx/libScePngDec/CMakeLists.txt index eab91d6df..290f559ad 100644 --- a/core/libs/prx/libScePngDec/CMakeLists.txt +++ b/core/libs/prx/libScePngDec/CMakeLists.txt @@ -11,7 +11,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(guest_png_dec_tests ${LIBS_INCLUDE_DIR}/tests/GuestPngDec.cpp) + add_test_executable(guest_png_dec_tests ${LIBS_INCLUDE_DIR}/tests/GuestPngDec.cpp) target_include_directories(guest_png_dec_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_png_dec_tests PRIVATE libScePngDec decoder_png libc) configure_windows_unwind(guest_png_dec_tests) diff --git a/core/libs/prx/libScePosixForWebKit/CMakeLists.txt b/core/libs/prx/libScePosixForWebKit/CMakeLists.txt index 61eeaeca2..72f7d78e2 100644 --- a/core/libs/prx/libScePosixForWebKit/CMakeLists.txt +++ b/core/libs/prx/libScePosixForWebKit/CMakeLists.txt @@ -12,7 +12,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(guest_resolver_tests ${LIBS_INCLUDE_DIR}/tests/GuestResolver.cpp) + add_test_executable(guest_resolver_tests ${LIBS_INCLUDE_DIR}/tests/GuestResolver.cpp) target_include_directories(guest_resolver_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_resolver_tests PRIVATE libScePosixForWebKit) add_test(NAME guest_resolver COMMAND guest_resolver_tests) diff --git a/core/libs/prx/libSceVideoOut/CMakeLists.txt b/core/libs/prx/libSceVideoOut/CMakeLists.txt index d7c484bfd..992b1ae9c 100644 --- a/core/libs/prx/libSceVideoOut/CMakeLists.txt +++ b/core/libs/prx/libSceVideoOut/CMakeLists.txt @@ -25,20 +25,20 @@ configure_windows_unwind(libSceVideoOut) foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") endforeach() -add_executable(video_out_flip_tests EXCLUDE_FROM_ALL tests/Flip.cpp) +add_test_executable(video_out_flip_tests EXCLUDE_FROM_ALL tests/Flip.cpp) target_include_directories(video_out_flip_tests PRIVATE ${LIBS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/SDL2/include) 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) - add_executable(pad_sdl_tests tests/PadSdl.cpp) + add_test_executable(pad_sdl_tests tests/PadSdl.cpp) target_link_libraries(pad_sdl_tests PRIVATE SDL2-static) add_test(NAME pad_sdl COMMAND pad_sdl_tests) endif() if(BUILD_TESTING) - add_executable(guest_buffer_reuse_tests ${LIBS_INCLUDE_DIR}/tests/GuestBufferReuse.cpp) + add_test_executable(guest_buffer_reuse_tests ${LIBS_INCLUDE_DIR}/tests/GuestBufferReuse.cpp) target_include_directories(guest_buffer_reuse_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_buffer_reuse_tests PRIVATE libc) configure_windows_unwind(guest_buffer_reuse_tests) diff --git a/core/libs/prx/libSceVideodec2/CMakeLists.txt b/core/libs/prx/libSceVideodec2/CMakeLists.txt index 4200328a4..178ea8765 100644 --- a/core/libs/prx/libSceVideodec2/CMakeLists.txt +++ b/core/libs/prx/libSceVideodec2/CMakeLists.txt @@ -14,7 +14,7 @@ if(MINGW) endif() if(BUILD_TESTING) - add_executable(guest_videodec2_tests ${LIBS_INCLUDE_DIR}/tests/GuestVideodec2.cpp) + add_test_executable(guest_videodec2_tests ${LIBS_INCLUDE_DIR}/tests/GuestVideodec2.cpp) target_include_directories(guest_videodec2_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_videodec2_tests PRIVATE libSceVideodec2 libc) configure_windows_unwind(guest_videodec2_tests) diff --git a/core/libs/prx/libc/CMakeLists.txt b/core/libs/prx/libc/CMakeLists.txt index 57251427f..718e49f6f 100644 --- a/core/libs/prx/libc/CMakeLists.txt +++ b/core/libs/prx/libc/CMakeLists.txt @@ -41,7 +41,7 @@ target_include_directories(libc PRIVATE ) if(BUILD_TESTING) - add_executable(guest_character_tests ${LIBS_INCLUDE_DIR}/tests/GuestCharacter.cpp) + add_test_executable(guest_character_tests ${LIBS_INCLUDE_DIR}/tests/GuestCharacter.cpp) target_include_directories(guest_character_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_character_tests PRIVATE libc) configure_windows_unwind(guest_character_tests) @@ -50,7 +50,7 @@ if(BUILD_TESTING) set_tests_properties(guest_character PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_math_tests ${LIBS_INCLUDE_DIR}/tests/GuestMath.cpp) + add_test_executable(guest_math_tests ${LIBS_INCLUDE_DIR}/tests/GuestMath.cpp) target_include_directories(guest_math_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_math_tests PRIVATE libc) configure_windows_unwind(guest_math_tests) @@ -59,7 +59,7 @@ if(BUILD_TESTING) set_tests_properties(guest_math PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_working_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestWorkingDirectory.cpp) + add_test_executable(guest_working_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestWorkingDirectory.cpp) target_include_directories(guest_working_directory_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_working_directory_tests PRIVATE libc) configure_windows_unwind(guest_working_directory_tests) @@ -68,7 +68,7 @@ if(BUILD_TESTING) set_tests_properties(guest_working_directory PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectory.cpp) + add_test_executable(guest_directory_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectory.cpp) target_include_directories(guest_directory_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_directory_tests PRIVATE libc) configure_windows_unwind(guest_directory_tests) @@ -77,7 +77,7 @@ if(BUILD_TESTING) set_tests_properties(guest_directory PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_environment_tests ${LIBS_INCLUDE_DIR}/tests/GuestEnvironment.cpp) + add_test_executable(guest_environment_tests ${LIBS_INCLUDE_DIR}/tests/GuestEnvironment.cpp) target_include_directories(guest_environment_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_environment_tests PRIVATE libc) configure_windows_unwind(guest_environment_tests) @@ -86,7 +86,7 @@ if(BUILD_TESTING) set_tests_properties(guest_environment PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_lifecycle_tests ${LIBS_INCLUDE_DIR}/tests/GuestLifecycle.cpp) + add_test_executable(guest_lifecycle_tests ${LIBS_INCLUDE_DIR}/tests/GuestLifecycle.cpp) target_include_directories(guest_lifecycle_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_lifecycle_tests PRIVATE libc) configure_windows_unwind(guest_lifecycle_tests) @@ -95,7 +95,7 @@ if(BUILD_TESTING) set_tests_properties(guest_lifecycle PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_reallocalign_tests ${LIBS_INCLUDE_DIR}/tests/GuestReallocalign.cpp) + add_test_executable(guest_reallocalign_tests ${LIBS_INCLUDE_DIR}/tests/GuestReallocalign.cpp) target_include_directories(guest_reallocalign_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_reallocalign_tests PRIVATE libc) configure_windows_unwind(guest_reallocalign_tests) @@ -104,7 +104,7 @@ if(BUILD_TESTING) set_tests_properties(guest_reallocalign PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_standard_stream_tests ${LIBS_INCLUDE_DIR}/tests/GuestStandardStreams.cpp) + add_test_executable(guest_standard_stream_tests ${LIBS_INCLUDE_DIR}/tests/GuestStandardStreams.cpp) target_include_directories(guest_standard_stream_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_standard_stream_tests PRIVATE libc) configure_windows_unwind(guest_standard_stream_tests) @@ -113,7 +113,7 @@ if(BUILD_TESTING) set_tests_properties(guest_standard_streams PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestErrors.cpp) + add_test_executable(guest_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestErrors.cpp) target_include_directories(guest_error_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_error_tests PRIVATE libc) configure_windows_unwind(guest_error_tests) @@ -122,7 +122,7 @@ if(BUILD_TESTING) set_tests_properties(guest_errors PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(mspace_tests ${LIBS_INCLUDE_DIR}/tests/Mspace.cpp) + add_test_executable(mspace_tests ${LIBS_INCLUDE_DIR}/tests/Mspace.cpp) target_include_directories(mspace_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(mspace_tests PRIVATE libc) configure_windows_unwind(mspace_tests) @@ -131,7 +131,7 @@ if(BUILD_TESTING) set_tests_properties(mspace PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_formatting_tests ${LIBS_INCLUDE_DIR}/tests/Formatting.cpp) + add_test_executable(guest_formatting_tests ${LIBS_INCLUDE_DIR}/tests/Formatting.cpp) target_include_directories(guest_formatting_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_formatting_tests PRIVATE libc) configure_windows_unwind(guest_formatting_tests) @@ -140,7 +140,7 @@ if(BUILD_TESTING) set_tests_properties(guest_formatting PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_search_tests ${LIBS_INCLUDE_DIR}/tests/GuestSearch.cpp) + add_test_executable(guest_search_tests ${LIBS_INCLUDE_DIR}/tests/GuestSearch.cpp) target_include_directories(guest_search_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_search_tests PRIVATE libc) configure_windows_unwind(guest_search_tests) @@ -149,7 +149,7 @@ if(BUILD_TESTING) set_tests_properties(guest_search PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_string_tests ${LIBS_INCLUDE_DIR}/tests/GuestStrings.cpp) + add_test_executable(guest_string_tests ${LIBS_INCLUDE_DIR}/tests/GuestStrings.cpp) target_include_directories(guest_string_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_string_tests PRIVATE libc libScePosixForWebKit) configure_windows_unwind(guest_string_tests) @@ -159,14 +159,14 @@ if(BUILD_TESTING) "PATH=path_list_prepend:$") endif() if(UNIX) - add_executable(exception_runtime_tests ${LIBS_INCLUDE_DIR}/tests/ExceptionRuntime.cpp) + add_test_executable(exception_runtime_tests ${LIBS_INCLUDE_DIR}/tests/ExceptionRuntime.cpp) target_include_directories(exception_runtime_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(exception_runtime_tests PRIVATE libc) add_test(NAME exception_runtime COMMAND exception_runtime_tests) endif() endif() -add_executable(application_heap_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/ApplicationHeap.cpp) +add_test_executable(application_heap_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/ApplicationHeap.cpp) target_include_directories(application_heap_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(application_heap_tests PRIVATE libc) configure_windows_unwind(application_heap_tests) @@ -182,7 +182,7 @@ if(BUILD_TESTING) endif() endif() -add_executable(guest_locale_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/GuestLocale.cpp) +add_test_executable(guest_locale_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/GuestLocale.cpp) target_include_directories(guest_locale_tests PRIVATE ${LIBS_INCLUDE_DIR}) set_target_properties(guest_locale_tests PROPERTIES CXX_EXTENSIONS OFF) target_link_libraries(guest_locale_tests PRIVATE libc) @@ -192,7 +192,7 @@ if(MINGW) foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") endforeach() - add_executable(windows_exception_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/WindowsExceptions.cpp) + add_test_executable(windows_exception_tests EXCLUDE_FROM_ALL ${LIBS_INCLUDE_DIR}/tests/WindowsExceptions.cpp) set_target_properties(windows_exception_tests PROPERTIES CXX_EXTENSIONS OFF) target_link_libraries(windows_exception_tests PRIVATE libc) configure_windows_unwind(windows_exception_tests) diff --git a/core/libs/prx/libkernel/CMakeLists.txt b/core/libs/prx/libkernel/CMakeLists.txt index 0a43898ed..907294a56 100644 --- a/core/libs/prx/libkernel/CMakeLists.txt +++ b/core/libs/prx/libkernel/CMakeLists.txt @@ -75,7 +75,7 @@ if(BUILD_TESTING) COMMAND $ guest_module_fixture $ VERBATIM) add_dependencies(guest_module_fixture nid_patcher) - add_executable(guest_dynamic_loader_tests ${LIBS_INCLUDE_DIR}/tests/GuestDynamicLoader.cpp) + add_test_executable(guest_dynamic_loader_tests ${LIBS_INCLUDE_DIR}/tests/GuestDynamicLoader.cpp) target_include_directories(guest_dynamic_loader_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_dynamic_loader_tests PRIVATE libkernel libc) configure_windows_unwind(guest_dynamic_loader_tests) @@ -87,7 +87,7 @@ if(BUILD_TESTING) set_tests_properties(guest_dynamic_loader PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_filesystem_tests ${LIBS_INCLUDE_DIR}/tests/GuestFilesystem.cpp) + add_test_executable(guest_filesystem_tests ${LIBS_INCLUDE_DIR}/tests/GuestFilesystem.cpp) target_include_directories(guest_filesystem_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_filesystem_tests PRIVATE libkernel libc) configure_windows_unwind(guest_filesystem_tests) @@ -96,7 +96,7 @@ if(BUILD_TESTING) set_tests_properties(guest_filesystem PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_aio_tests ${LIBS_INCLUDE_DIR}/tests/GuestAio.cpp) + add_test_executable(guest_aio_tests ${LIBS_INCLUDE_DIR}/tests/GuestAio.cpp) target_include_directories(guest_aio_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_aio_tests PRIVATE libkernel libc) configure_windows_unwind(guest_aio_tests) @@ -105,7 +105,7 @@ if(BUILD_TESTING) set_tests_properties(guest_aio PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_once_tests ${LIBS_INCLUDE_DIR}/tests/GuestOnce.cpp) + add_test_executable(guest_once_tests ${LIBS_INCLUDE_DIR}/tests/GuestOnce.cpp) target_include_directories(guest_once_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_once_tests PRIVATE libkernel libc) configure_windows_unwind(guest_once_tests) @@ -115,7 +115,7 @@ if(BUILD_TESTING) set_tests_properties(guest_once PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_thread_self_tests ${LIBS_INCLUDE_DIR}/tests/GuestThreadSelf.cpp) + add_test_executable(guest_thread_self_tests ${LIBS_INCLUDE_DIR}/tests/GuestThreadSelf.cpp) target_include_directories(guest_thread_self_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_thread_self_tests PRIVATE libkernel libc) configure_windows_unwind(guest_thread_self_tests) @@ -125,7 +125,7 @@ if(BUILD_TESTING) set_tests_properties(guest_thread_self PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_cond_timedwait_tests ${LIBS_INCLUDE_DIR}/tests/GuestCondTimedwait.cpp) + add_test_executable(guest_cond_timedwait_tests ${LIBS_INCLUDE_DIR}/tests/GuestCondTimedwait.cpp) target_include_directories(guest_cond_timedwait_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_cond_timedwait_tests PRIVATE libkernel libc) configure_windows_unwind(guest_cond_timedwait_tests) @@ -135,7 +135,7 @@ if(BUILD_TESTING) set_tests_properties(guest_cond_timedwait PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_pthread_sem_tests ${LIBS_INCLUDE_DIR}/tests/GuestPthreadSem.cpp) + add_test_executable(guest_pthread_sem_tests ${LIBS_INCLUDE_DIR}/tests/GuestPthreadSem.cpp) target_include_directories(guest_pthread_sem_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_pthread_sem_tests PRIVATE libkernel libc) configure_windows_unwind(guest_pthread_sem_tests) @@ -145,7 +145,7 @@ if(BUILD_TESTING) set_tests_properties(guest_pthread_sem PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_signal_tests ${LIBS_INCLUDE_DIR}/tests/GuestSignals.cpp) + add_test_executable(guest_signal_tests ${LIBS_INCLUDE_DIR}/tests/GuestSignals.cpp) target_include_directories(guest_signal_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_signal_tests PRIVATE libkernel libc) configure_windows_unwind(guest_signal_tests) @@ -154,7 +154,7 @@ if(BUILD_TESTING) set_tests_properties(guest_signals PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_kernel_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestKernelErrors.cpp) + add_test_executable(guest_kernel_error_tests ${LIBS_INCLUDE_DIR}/tests/GuestKernelErrors.cpp) target_include_directories(guest_kernel_error_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_kernel_error_tests PRIVATE libkernel libc) configure_windows_unwind(guest_kernel_error_tests) @@ -164,7 +164,7 @@ if(BUILD_TESTING) set_tests_properties(guest_kernel_errors PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_system_configuration_tests ${LIBS_INCLUDE_DIR}/tests/GuestSystemConfiguration.cpp) + add_test_executable(guest_system_configuration_tests ${LIBS_INCLUDE_DIR}/tests/GuestSystemConfiguration.cpp) target_include_directories(guest_system_configuration_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_system_configuration_tests PRIVATE libkernel libc) configure_windows_unwind(guest_system_configuration_tests) @@ -173,7 +173,7 @@ if(BUILD_TESTING) set_tests_properties(guest_system_configuration PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_udp_tests ${LIBS_INCLUDE_DIR}/tests/GuestUdp.cpp) + add_test_executable(guest_udp_tests ${LIBS_INCLUDE_DIR}/tests/GuestUdp.cpp) target_include_directories(guest_udp_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_udp_tests PRIVATE libkernel libc) configure_windows_unwind(guest_udp_tests) @@ -183,7 +183,7 @@ if(BUILD_TESTING) set_tests_properties(guest_udp PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_tcp_tests ${LIBS_INCLUDE_DIR}/tests/GuestTcp.cpp) + add_test_executable(guest_tcp_tests ${LIBS_INCLUDE_DIR}/tests/GuestTcp.cpp) target_include_directories(guest_tcp_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_tcp_tests PRIVATE libkernel libc) configure_windows_unwind(guest_tcp_tests) @@ -193,7 +193,7 @@ if(BUILD_TESTING) set_tests_properties(guest_tcp PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_address_tests ${LIBS_INCLUDE_DIR}/tests/GuestAddressConversion.cpp) + add_test_executable(guest_address_tests ${LIBS_INCLUDE_DIR}/tests/GuestAddressConversion.cpp) target_include_directories(guest_address_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_address_tests PRIVATE libkernel libc) configure_windows_unwind(guest_address_tests) @@ -202,7 +202,7 @@ if(BUILD_TESTING) set_tests_properties(guest_addresses PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - add_executable(guest_memory_tests ${LIBS_INCLUDE_DIR}/tests/GuestMemory.cpp) + add_test_executable(guest_memory_tests ${LIBS_INCLUDE_DIR}/tests/GuestMemory.cpp) target_include_directories(guest_memory_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_memory_tests PRIVATE libkernel libc) configure_windows_unwind(guest_memory_tests) @@ -212,7 +212,7 @@ if(BUILD_TESTING) "PATH=path_list_prepend:$") endif() if(NOT WIN32) - add_executable(guest_directory_entry_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectoryEntries.cpp) + add_test_executable(guest_directory_entry_tests ${LIBS_INCLUDE_DIR}/tests/GuestDirectoryEntries.cpp) target_include_directories(guest_directory_entry_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_directory_entry_tests PRIVATE libkernel libc) add_test(NAME guest_directory_entries COMMAND guest_directory_entry_tests) diff --git a/core/relinker/CMakeLists.txt b/core/relinker/CMakeLists.txt index 0764e95c7..18d528c73 100644 --- a/core/relinker/CMakeLists.txt +++ b/core/relinker/CMakeLists.txt @@ -68,7 +68,7 @@ target_include_directories(relinker PRIVATE ) if(WIN32) - add_executable(windows_dependency_diagnostics_tests EXCLUDE_FROM_ALL + add_test_executable(windows_dependency_diagnostics_tests EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/tests/WindowsDependencyDiagnosticsTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/src/windows/WindowsDependencyStubBuilder.cpp ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/src/windows/WindowsStubEmitter.cpp @@ -83,7 +83,7 @@ if(WIN32) add_test(NAME windows_dependency_diagnostics COMMAND windows_dependency_diagnostics_tests) endif() - add_executable(amd64_only_windows_tests EXCLUDE_FROM_ALL + add_test_executable(amd64_only_windows_tests EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/tests/Amd64OnlyWindowsTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/src/windows/WindowsTrampolineBuilder.cpp ${CMAKE_CURRENT_SOURCE_DIR}/elfpatcher/src/windows/WindowsLoadImage.cpp @@ -112,7 +112,7 @@ endif() if(BUILD_TESTING) - add_executable(buffer_bounds_tests + add_test_executable(buffer_bounds_tests ${CMAKE_CURRENT_SOURCE_DIR}/io/tests/BufferBoundsTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/io/src/ByteReader.cpp ${CMAKE_CURRENT_SOURCE_DIR}/io/src/BufferUtils.cpp @@ -121,7 +121,7 @@ if(BUILD_TESTING) add_test(NAME buffer_bounds COMMAND buffer_bounds_tests) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_executable(file_writer_tests + add_test_executable(file_writer_tests ${CMAKE_CURRENT_SOURCE_DIR}/io/tests/FileWriterTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/io/src/FileWriter.cpp ) @@ -133,7 +133,7 @@ if(BUILD_TESTING) add_test(NAME file_writer_text COMMAND file_writer_tests text) endif() - add_executable(amd64_only_converter_tests + add_test_executable(amd64_only_converter_tests ${CMAKE_CURRENT_SOURCE_DIR}/codegen/tests/Amd64OnlyConverterTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/src/Amd64OnlyConverter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/src/InstructionScanner.cpp @@ -187,7 +187,7 @@ if(BUILD_TESTING) else() message(STATUS "Python3 interpreter not found; skipping Python relinker tests") endif() - add_executable(strict_nid_filter_tests + add_test_executable(strict_nid_filter_tests ${CMAKE_CURRENT_SOURCE_DIR}/relinker/tests/StrictNidFilterTests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/relinker/src/analysis/UnusedNidFilter/StrictNidFilter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/relinker/src/analysis/UnusedNidFilter/StrictReachability.cpp From 867167e2ffcd90dbce1d00ac8a1f7583591cd392 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 1 Oct 2026 12:32:22 +0300 Subject: [PATCH 3/5] refactor(cmake): move prx.a import libraries to implib directory --- core/libs/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index f9e9744b4..fc638d839 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -43,12 +43,14 @@ configure_windows_unwind(libc) set(UNPATCHED_DIR ${CMAKE_CURRENT_BINARY_DIR}/libs/unpatched) set(PATCHED_DIR ${CMAKE_CURRENT_BINARY_DIR}/libs) +set(IMPLIB_DIR ${PATCHED_DIR}/implib) set_target_properties(libc PROPERTIES PREFIX "" SUFFIX .prx RUNTIME_OUTPUT_DIRECTORY ${UNPATCHED_DIR} LIBRARY_OUTPUT_DIRECTORY ${UNPATCHED_DIR} + ARCHIVE_OUTPUT_DIRECTORY ${IMPLIB_DIR} ) set(LIBC_UNPATCHED ${UNPATCHED_DIR}/libc.prx) @@ -98,6 +100,7 @@ foreach(LIB_DIR ${LIBS_DIRS}) SUFFIX .prx RUNTIME_OUTPUT_DIRECTORY ${UNPATCHED_DIR} LIBRARY_OUTPUT_DIRECTORY ${UNPATCHED_DIR} + ARCHIVE_OUTPUT_DIRECTORY ${IMPLIB_DIR} ) set(UNPATCHED_FILE ${UNPATCHED_DIR}/${LIB_NAME}.prx) From a32715f71fdfc2c089f0a60177430d63f420bfd7 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 1 Oct 2026 12:38:06 +0300 Subject: [PATCH 4/5] refactor(cmake): require explicit runtime target for png and jpeg decoders --- core/Decoder/Jpeg/CMakeLists.txt | 32 +++++++++++++++------- core/Decoder/Png/CMakeLists.txt | 32 +++++++++++++++------- core/libs/prx/libSceJpegEnc/CMakeLists.txt | 2 ++ core/libs/prx/libScePngDec/CMakeLists.txt | 2 ++ 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/core/Decoder/Jpeg/CMakeLists.txt b/core/Decoder/Jpeg/CMakeLists.txt index b9aa17616..2280f398b 100644 --- a/core/Decoder/Jpeg/CMakeLists.txt +++ b/core/Decoder/Jpeg/CMakeLists.txt @@ -1,15 +1,27 @@ -add_library(decoder_jpeg STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/Jpeg.cpp) -target_include_directories(decoder_jpeg PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_include_directories(decoder_jpeg SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/stb) -set_target_properties(decoder_jpeg PROPERTIES +function(add_jpeg_decoder target runtimeTarget) + if(NOT TARGET "${runtimeTarget}") + message(FATAL_ERROR "JPEG decoder requires an existing runtime target: ${runtimeTarget}") + endif() + + add_library(${target} STATIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/Jpeg.cpp) + target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/include) + target_include_directories(${target} SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/stb) + target_link_libraries(${target} PRIVATE ${runtimeTarget}) + set_target_properties(${target} PROPERTIES CXX_EXTENSIONS OFF CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON POSITION_INDEPENDENT_CODE ON -) + ) -if(BUILD_TESTING) - add_test_executable(decoder_jpeg_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Jpeg.cpp) - target_link_libraries(decoder_jpeg_tests PRIVATE decoder_jpeg) - add_test(NAME decoder_jpeg COMMAND decoder_jpeg_tests) -endif() + if(BUILD_TESTING) + add_test_executable(${target}_tests ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/tests/Jpeg.cpp) + target_link_libraries(${target}_tests PRIVATE ${target}) + configure_windows_unwind(${target}_tests) + add_test(NAME ${target} COMMAND ${target}_tests) + if(WIN32) + set_tests_properties(${target} PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + endif() +endfunction() diff --git a/core/Decoder/Png/CMakeLists.txt b/core/Decoder/Png/CMakeLists.txt index 359651bd8..2c4d268b3 100644 --- a/core/Decoder/Png/CMakeLists.txt +++ b/core/Decoder/Png/CMakeLists.txt @@ -1,15 +1,27 @@ -add_library(decoder_png STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/Png.cpp) -target_include_directories(decoder_png PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_include_directories(decoder_png SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/stb) -set_target_properties(decoder_png PROPERTIES +function(add_png_decoder target runtimeTarget) + if(NOT TARGET "${runtimeTarget}") + message(FATAL_ERROR "PNG decoder requires an existing runtime target: ${runtimeTarget}") + endif() + + add_library(${target} STATIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/src/Png.cpp) + target_include_directories(${target} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/include) + target_include_directories(${target} SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/stb) + target_link_libraries(${target} PRIVATE ${runtimeTarget}) + set_target_properties(${target} PROPERTIES CXX_EXTENSIONS OFF CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON POSITION_INDEPENDENT_CODE ON -) + ) -if(BUILD_TESTING) - add_test_executable(decoder_png_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/Png.cpp) - target_link_libraries(decoder_png_tests PRIVATE decoder_png) - add_test(NAME decoder_png COMMAND decoder_png_tests) -endif() + if(BUILD_TESTING) + add_test_executable(${target}_tests ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/tests/Png.cpp) + target_link_libraries(${target}_tests PRIVATE ${target}) + configure_windows_unwind(${target}_tests) + add_test(NAME ${target} COMMAND ${target}_tests) + if(WIN32) + set_tests_properties(${target} PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + endif() +endfunction() diff --git a/core/libs/prx/libSceJpegEnc/CMakeLists.txt b/core/libs/prx/libSceJpegEnc/CMakeLists.txt index 707bee436..fd2c49277 100644 --- a/core/libs/prx/libSceJpegEnc/CMakeLists.txt +++ b/core/libs/prx/libSceJpegEnc/CMakeLists.txt @@ -1,3 +1,5 @@ +add_jpeg_decoder(decoder_jpeg libc) + add_library(libSceJpegEnc SHARED EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/Export.cpp) target_include_directories(libSceJpegEnc PRIVATE ${LIBS_INCLUDE_DIR}) set_target_properties(libSceJpegEnc PROPERTIES CXX_EXTENSIONS OFF) diff --git a/core/libs/prx/libScePngDec/CMakeLists.txt b/core/libs/prx/libScePngDec/CMakeLists.txt index 290f559ad..a3b44bfc8 100644 --- a/core/libs/prx/libScePngDec/CMakeLists.txt +++ b/core/libs/prx/libScePngDec/CMakeLists.txt @@ -1,3 +1,5 @@ +add_png_decoder(decoder_png libc) + add_library(libScePngDec SHARED EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/Export.cpp) target_include_directories(libScePngDec PRIVATE ${LIBS_INCLUDE_DIR}) set_target_properties(libScePngDec PROPERTIES CXX_EXTENSIONS OFF) From bbba29ea61848ffb0b3013a48104789d8910d8d0 Mon Sep 17 00:00:00 2001 From: boykopovar Date: Thu, 1 Oct 2026 12:44:01 +0300 Subject: [PATCH 5/5] refactor(cmake): add local library configs and move test definitions --- core/libs/CMakeLists.txt | 74 ------------------- .../prx/libSceContentExport/CMakeLists.txt | 21 ++++++ core/libs/prx/libSceFiber/CMakeLists.txt | 20 +++++ core/libs/prx/libSceJson2/CMakeLists.txt | 20 +++++ core/libs/prx/libSceNet/CMakeLists.txt | 22 ++++++ core/libs/prx/libSceNetCtl/CMakeLists.txt | 3 + core/libs/prx/libSceRandom/CMakeLists.txt | 20 +++++ core/libs/prx/libSceRtc/CMakeLists.txt | 20 +++++ .../prx/libSceSystemService/CMakeLists.txt | 35 +++++++++ 9 files changed, 161 insertions(+), 74 deletions(-) create mode 100644 core/libs/prx/libSceContentExport/CMakeLists.txt create mode 100644 core/libs/prx/libSceFiber/CMakeLists.txt create mode 100644 core/libs/prx/libSceJson2/CMakeLists.txt create mode 100644 core/libs/prx/libSceNet/CMakeLists.txt create mode 100644 core/libs/prx/libSceNetCtl/CMakeLists.txt create mode 100644 core/libs/prx/libSceRandom/CMakeLists.txt create mode 100644 core/libs/prx/libSceRtc/CMakeLists.txt create mode 100644 core/libs/prx/libSceSystemService/CMakeLists.txt diff --git a/core/libs/CMakeLists.txt b/core/libs/CMakeLists.txt index fc638d839..5b886fafd 100644 --- a/core/libs/CMakeLists.txt +++ b/core/libs/CMakeLists.txt @@ -143,80 +143,6 @@ if(BUILD_TESTING) endif() add_test(NAME host_thread_local COMMAND host_thread_local_tests) set_tests_properties(host_thread_local PROPERTIES TIMEOUT 15) - add_test_executable(guest_system_exit_tests tests/GuestSystemExit.cpp) - target_include_directories(guest_system_exit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_system_exit_tests PRIVATE libSceSystemService libc) - configure_windows_unwind(guest_system_exit_tests) - add_test(NAME guest_system_exit_parameters COMMAND guest_system_exit_tests) - add_test(NAME guest_system_exit COMMAND guest_system_exit_tests --exit) - add_test(NAME guest_immediate_exit COMMAND guest_system_exit_tests --immediate) - add_test(NAME guest_return_from_main COMMAND guest_system_exit_tests --return-from-main) - set_tests_properties(guest_system_exit PROPERTIES - PASS_REGULAR_EXPRESSION "Guest shutdown and atexit completed") - if(WIN32) - set_tests_properties(guest_system_exit guest_system_exit_parameters guest_immediate_exit guest_return_from_main PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_system_service_tests tests/GuestSystemService.cpp) - target_include_directories(guest_system_service_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_system_service_tests PRIVATE libSceSystemService libc) - configure_windows_unwind(guest_system_service_tests) - add_test(NAME guest_system_service COMMAND guest_system_service_tests) - if(WIN32) - set_tests_properties(guest_system_service PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_content_export_tests tests/GuestContentExport.cpp) - target_include_directories(guest_content_export_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_content_export_tests PRIVATE libSceContentExport libc) - configure_windows_unwind(guest_content_export_tests) - add_test(NAME guest_content_export COMMAND guest_content_export_tests) - if(WIN32) - set_tests_properties(guest_content_export PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_sce_net_tests tests/GuestSceNet.cpp) - target_include_directories(guest_sce_net_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_sce_net_tests PRIVATE libSceNet libSceNetCtl) - configure_windows_unwind(guest_sce_net_tests) - add_test(NAME guest_sce_net COMMAND guest_sce_net_tests) - set_tests_properties(guest_sce_net PROPERTIES TIMEOUT 20) - if(WIN32) - set_tests_properties(guest_sce_net PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_random_tests tests/GuestRandom.cpp) - target_include_directories(guest_random_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_random_tests PRIVATE libSceRandom) - add_test(NAME guest_random COMMAND guest_random_tests) - if(WIN32) - set_tests_properties(guest_random PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_rtc_tests tests/GuestRtc.cpp) - target_include_directories(guest_rtc_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_rtc_tests PRIVATE libSceRtc) - add_test(NAME guest_rtc COMMAND guest_rtc_tests) - if(WIN32) - set_tests_properties(guest_rtc PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(guest_json_tests tests/GuestJson.cpp) - target_include_directories(guest_json_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(guest_json_tests PRIVATE libSceJson2 libc) - add_test(NAME guest_json COMMAND guest_json_tests) - if(WIN32) - set_tests_properties(guest_json PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() - add_test_executable(fiber_tests tests/Fiber.cpp) - target_include_directories(fiber_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(fiber_tests PRIVATE libSceFiber libc) - add_test(NAME fiber COMMAND fiber_tests) - if(WIN32) - set_tests_properties(fiber PROPERTIES ENVIRONMENT_MODIFICATION - "PATH=path_list_prepend:$") - endif() endif() if(MINGW) diff --git a/core/libs/prx/libSceContentExport/CMakeLists.txt b/core/libs/prx/libSceContentExport/CMakeLists.txt new file mode 100644 index 000000000..9cdaa75dd --- /dev/null +++ b/core/libs/prx/libSceContentExport/CMakeLists.txt @@ -0,0 +1,21 @@ +add_library(libSceContentExport SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceContentExport PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceContentExport) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_content_export_tests ${LIBS_INCLUDE_DIR}/tests/GuestContentExport.cpp) + target_include_directories(guest_content_export_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_content_export_tests PRIVATE libSceContentExport libc) + configure_windows_unwind(guest_content_export_tests) + add_test(NAME guest_content_export COMMAND guest_content_export_tests) + if(WIN32) + set_tests_properties(guest_content_export PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceFiber/CMakeLists.txt b/core/libs/prx/libSceFiber/CMakeLists.txt new file mode 100644 index 000000000..6fd2e2523 --- /dev/null +++ b/core/libs/prx/libSceFiber/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(libSceFiber SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceFiber PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceFiber) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(fiber_tests ${LIBS_INCLUDE_DIR}/tests/Fiber.cpp) + target_include_directories(fiber_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(fiber_tests PRIVATE libSceFiber libc) + add_test(NAME fiber COMMAND fiber_tests) + if(WIN32) + set_tests_properties(fiber PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceJson2/CMakeLists.txt b/core/libs/prx/libSceJson2/CMakeLists.txt new file mode 100644 index 000000000..d1cd90d94 --- /dev/null +++ b/core/libs/prx/libSceJson2/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(libSceJson2 SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceJson2 PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceJson2) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_json_tests ${LIBS_INCLUDE_DIR}/tests/GuestJson.cpp) + target_include_directories(guest_json_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_json_tests PRIVATE libSceJson2 libc) + add_test(NAME guest_json COMMAND guest_json_tests) + if(WIN32) + set_tests_properties(guest_json PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceNet/CMakeLists.txt b/core/libs/prx/libSceNet/CMakeLists.txt new file mode 100644 index 000000000..d6a6254c7 --- /dev/null +++ b/core/libs/prx/libSceNet/CMakeLists.txt @@ -0,0 +1,22 @@ +add_library(libSceNet SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceNet PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceNet) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_sce_net_tests ${LIBS_INCLUDE_DIR}/tests/GuestSceNet.cpp) + target_include_directories(guest_sce_net_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_sce_net_tests PRIVATE libSceNet libSceNetCtl) + configure_windows_unwind(guest_sce_net_tests) + add_test(NAME guest_sce_net COMMAND guest_sce_net_tests) + set_tests_properties(guest_sce_net PROPERTIES TIMEOUT 20) + if(WIN32) + set_tests_properties(guest_sce_net PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceNetCtl/CMakeLists.txt b/core/libs/prx/libSceNetCtl/CMakeLists.txt new file mode 100644 index 000000000..f221f2193 --- /dev/null +++ b/core/libs/prx/libSceNetCtl/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(libSceNetCtl SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceNetCtl PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceNetCtl) diff --git a/core/libs/prx/libSceRandom/CMakeLists.txt b/core/libs/prx/libSceRandom/CMakeLists.txt new file mode 100644 index 000000000..91ab41b62 --- /dev/null +++ b/core/libs/prx/libSceRandom/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(libSceRandom SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceRandom PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceRandom) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_random_tests ${LIBS_INCLUDE_DIR}/tests/GuestRandom.cpp) + target_include_directories(guest_random_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_random_tests PRIVATE libSceRandom) + add_test(NAME guest_random COMMAND guest_random_tests) + if(WIN32) + set_tests_properties(guest_random PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceRtc/CMakeLists.txt b/core/libs/prx/libSceRtc/CMakeLists.txt new file mode 100644 index 000000000..a0e4a2444 --- /dev/null +++ b/core/libs/prx/libSceRtc/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(libSceRtc SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceRtc PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceRtc) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_rtc_tests ${LIBS_INCLUDE_DIR}/tests/GuestRtc.cpp) + target_include_directories(guest_rtc_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_rtc_tests PRIVATE libSceRtc) + add_test(NAME guest_rtc COMMAND guest_rtc_tests) + if(WIN32) + set_tests_properties(guest_rtc PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif() diff --git a/core/libs/prx/libSceSystemService/CMakeLists.txt b/core/libs/prx/libSceSystemService/CMakeLists.txt new file mode 100644 index 000000000..ff18d4bad --- /dev/null +++ b/core/libs/prx/libSceSystemService/CMakeLists.txt @@ -0,0 +1,35 @@ +add_library(libSceSystemService SHARED EXCLUDE_FROM_ALL Export.cpp) +target_include_directories(libSceSystemService PRIVATE ${LIBS_INCLUDE_DIR}) +configure_windows_unwind(libSceSystemService) + +if(MINGW) + foreach(runtimeLinkFlag IN ITEMS -static-libgcc -static-libstdc++ -static) + string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") + endforeach() +endif() + +if(BUILD_TESTING) + add_test_executable(guest_system_exit_tests ${LIBS_INCLUDE_DIR}/tests/GuestSystemExit.cpp) + target_include_directories(guest_system_exit_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_system_exit_tests PRIVATE libSceSystemService libc) + configure_windows_unwind(guest_system_exit_tests) + add_test(NAME guest_system_exit_parameters COMMAND guest_system_exit_tests) + add_test(NAME guest_system_exit COMMAND guest_system_exit_tests --exit) + add_test(NAME guest_immediate_exit COMMAND guest_system_exit_tests --immediate) + add_test(NAME guest_return_from_main COMMAND guest_system_exit_tests --return-from-main) + set_tests_properties(guest_system_exit PROPERTIES + PASS_REGULAR_EXPRESSION "Guest shutdown and atexit completed") + if(WIN32) + set_tests_properties(guest_system_exit guest_system_exit_parameters guest_immediate_exit guest_return_from_main PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() + add_test_executable(guest_system_service_tests ${LIBS_INCLUDE_DIR}/tests/GuestSystemService.cpp) + target_include_directories(guest_system_service_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_system_service_tests PRIVATE libSceSystemService libc) + configure_windows_unwind(guest_system_service_tests) + add_test(NAME guest_system_service COMMAND guest_system_service_tests) + if(WIN32) + set_tests_properties(guest_system_service PROPERTIES ENVIRONMENT_MODIFICATION + "PATH=path_list_prepend:$") + endif() +endif()