refactor(cmake): place all test executables in build tests directory

This commit is contained in:
boykopovar 2026-10-01 12:28:06 +03:00
parent b22ede6c93
commit 61ba4d661a
18 changed files with 96 additions and 87 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libSceNet>")
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:$<TARGET_FILE_DIR:libSceRandom>")
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:$<TARGET_FILE_DIR:libSceRtc>")
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:$<TARGET_FILE_DIR:libSceJson2>")
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)

View File

@ -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)

View File

@ -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 "$<TARGET_FILE:glslang-standalone>"
-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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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
)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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:$<TARGET_FILE_DIR:libc>")
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)

View File

@ -75,7 +75,7 @@ if(BUILD_TESTING)
COMMAND $<TARGET_FILE:nid_patcher> guest_module_fixture $<TARGET_FILE: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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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:$<TARGET_FILE_DIR:libkernel>")
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)

View File

@ -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