|
|
@@ -44,7 +44,6 @@ option(SDLTEST_TRACKMEM "Run tests with --trackmem" OFF)
|
|
|
if(WIN32)
|
|
|
option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF)
|
|
|
add_executable(sdlprocdump win32/sdlprocdump.c)
|
|
|
- set_property(TARGET sdlprocdump PROPERTY C_STANDARD "90")
|
|
|
SDL_AddCommonCompilerFlags(sdlprocdump)
|
|
|
if(SDLTEST_PROCDUMP)
|
|
|
set(CMAKE_TEST_LAUNCHER "$<TARGET_FILE:sdlprocdump>;--")
|
|
|
@@ -100,7 +99,7 @@ define_property(TARGET PROPERTY SDL_NONINTERACTIVE_ARGUMENTS BRIEF_DOCS "Argumen
|
|
|
define_property(TARGET PROPERTY SDL_NONINTERACTIVE_TIMEOUT BRIEF_DOCS "Timeout for noninteractive executable." FULL_DOCS "Timeout for noninteractive executable.")
|
|
|
|
|
|
function(add_sdl_test_executable TARGET)
|
|
|
- cmake_parse_arguments(AST "BUILD_DEPENDENT;NONINTERACTIVE;NEEDS_RESOURCES;TESTUTILS;THREADS;NO_C90;MAIN_CALLBACKS;NOTRACKMEM" "" "DEPENDS;DISABLE_THREADS_ARGS;NONINTERACTIVE_TIMEOUT;NONINTERACTIVE_ARGS;INSTALLED_ARGS;SOURCES" ${ARGN})
|
|
|
+ cmake_parse_arguments(AST "BUILD_DEPENDENT;NONINTERACTIVE;NEEDS_RESOURCES;TESTUTILS;THREADS;MAIN_CALLBACKS;NOTRACKMEM" "" "DEPENDS;DISABLE_THREADS_ARGS;NONINTERACTIVE_TIMEOUT;NONINTERACTIVE_ARGS;INSTALLED_ARGS;SOURCES" ${ARGN})
|
|
|
if(AST_UNPARSED_ARGUMENTS)
|
|
|
message(FATAL_ERROR "Unknown argument(s): ${AST_UNPARSED_ARGUMENTS}")
|
|
|
endif()
|
|
|
@@ -123,10 +122,6 @@ function(add_sdl_test_executable TARGET)
|
|
|
SDL_AddCommonCompilerFlags(${TARGET})
|
|
|
target_include_directories(${TARGET} PRIVATE "${SDL3_SOURCE_DIR}/src/video/khronos")
|
|
|
target_link_libraries(${TARGET} PRIVATE SDL3::SDL3_test SDL3::${sdl_name_component})
|
|
|
- if(NOT AST_NO_C90 AND NOT SDL_CMAKE_PLATFORM MATCHES "^(n3ds|ps2|psp)$")
|
|
|
- set_property(TARGET ${TARGET} PROPERTY C_STANDARD 90)
|
|
|
- set_property(TARGET ${TARGET} PROPERTY C_EXTENSIONS FALSE)
|
|
|
- endif()
|
|
|
if(AST_DEPENDS)
|
|
|
add_dependencies(${TARGET} ${AST_DEPENDS})
|
|
|
endif()
|
|
|
@@ -279,7 +274,7 @@ if(FFmpeg_FOUND)
|
|
|
cmake_pop_check_state()
|
|
|
endif()
|
|
|
if(FFmpeg_FOUND AND LIBAVUTIL_AVFRAME_HAS_CH_LAYOUT)
|
|
|
- add_sdl_test_executable(testffmpeg NO_C90 SOURCES testffmpeg.c testffmpeg_vulkan.c ${icon_png_header} DEPENDS generate-icon_png_header)
|
|
|
+ add_sdl_test_executable(testffmpeg SOURCES testffmpeg.c testffmpeg_vulkan.c ${icon_png_header} DEPENDS generate-icon_png_header)
|
|
|
if(LIBAVUTIL_AVFULKANFRAMESCONTEXT_HAS_FORMAT)
|
|
|
target_compile_definitions(testffmpeg PRIVATE FFMPEG_VULKAN_SUPPORT)
|
|
|
endif()
|
|
|
@@ -305,7 +300,7 @@ add_sdl_test_executable(testaudioinfo SOURCES testaudioinfo.c)
|
|
|
add_sdl_test_executable(testaudiostreamdynamicresample NEEDS_RESOURCES TESTUTILS SOURCES testaudiostreamdynamicresample.c)
|
|
|
|
|
|
file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
|
|
|
-add_sdl_test_executable(testautomation NONINTERACTIVE NONINTERACTIVE_TIMEOUT 120 NEEDS_RESOURCES BUILD_DEPENDENT NO_C90 SOURCES ${TESTAUTOMATION_SOURCE_FILES})
|
|
|
+add_sdl_test_executable(testautomation NONINTERACTIVE NONINTERACTIVE_TIMEOUT 120 NEEDS_RESOURCES BUILD_DEPENDENT SOURCES ${TESTAUTOMATION_SOURCE_FILES})
|
|
|
if(EMSCRIPTEN)
|
|
|
target_link_options(testautomation PRIVATE -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb)
|
|
|
endif()
|
|
|
@@ -324,7 +319,7 @@ add_sdl_test_executable(testsymbols NONINTERACTIVE NOTRACKMEM NONINTERACTIVE_ARG
|
|
|
|
|
|
set(build_options_dependent_tests )
|
|
|
|
|
|
-add_sdl_test_executable(testevdev BUILD_DEPENDENT NONINTERACTIVE NO_C90 SOURCES testevdev.c)
|
|
|
+add_sdl_test_executable(testevdev BUILD_DEPENDENT NONINTERACTIVE SOURCES testevdev.c)
|
|
|
|
|
|
if(MACOS)
|
|
|
add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS
|
|
|
@@ -336,7 +331,7 @@ if(MACOS)
|
|
|
elseif(WINDOWS)
|
|
|
add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS SOURCES testnative.c testnativew32.c)
|
|
|
elseif(HAVE_X11 OR HAVE_WAYLAND)
|
|
|
- add_sdl_test_executable(testnative BUILD_DEPENDENT NO_C90 NEEDS_RESOURCES TESTUTILS SOURCES testnative.c)
|
|
|
+ add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS SOURCES testnative.c)
|
|
|
if(HAVE_X11)
|
|
|
target_sources(testnative PRIVATE testnativex11.c)
|
|
|
target_link_libraries(testnative PRIVATE X11)
|
|
|
@@ -381,7 +376,7 @@ add_sdl_test_executable(testime NEEDS_RESOURCES TESTUTILS SOURCES testime.c)
|
|
|
add_sdl_test_executable(testkeys SOURCES testkeys.c)
|
|
|
add_sdl_test_executable(testloadso SOURCES testloadso.c)
|
|
|
add_sdl_test_executable(testlocale NONINTERACTIVE SOURCES testlocale.c)
|
|
|
-add_sdl_test_executable(testlock NO_C90 SOURCES testlock.c)
|
|
|
+add_sdl_test_executable(testlock SOURCES testlock.c)
|
|
|
add_sdl_test_executable(testrwlock SOURCES testrwlock.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 20)
|
|
|
add_sdl_test_executable(testmouse SOURCES testmouse.c)
|
|
|
|
|
|
@@ -425,7 +420,7 @@ if(EMSCRIPTEN)
|
|
|
endif()
|
|
|
add_sdl_test_executable(testbounds NONINTERACTIVE SOURCES testbounds.c)
|
|
|
add_sdl_test_executable(testcustomcursor SOURCES testcustomcursor.c)
|
|
|
-add_sdl_test_executable(testvulkan NO_C90 SOURCES testvulkan.c)
|
|
|
+add_sdl_test_executable(testvulkan SOURCES testvulkan.c)
|
|
|
add_sdl_test_executable(testoffscreen SOURCES testoffscreen.c)
|
|
|
add_sdl_test_executable(testpopup SOURCES testpopup.c)
|
|
|
add_sdl_test_executable(testdialog SOURCES testdialog.c)
|
|
|
@@ -449,7 +444,7 @@ get_property(SDL_TEST_EXECUTABLES DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPER
|
|
|
if (HAVE_WAYLAND)
|
|
|
# Set the GENERATED property on the protocol file, since it is first created at build time
|
|
|
set_property(SOURCE ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c PROPERTY GENERATED 1)
|
|
|
- add_sdl_test_executable(testwaylandcustom NO_C90 NEEDS_RESOURCES SOURCES testwaylandcustom.c ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c)
|
|
|
+ add_sdl_test_executable(testwaylandcustom NEEDS_RESOURCES SOURCES testwaylandcustom.c ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c)
|
|
|
# Needed to silence the documentation warning in the generated header file
|
|
|
target_compile_options(testwaylandcustom PRIVATE -Wno-documentation-unknown-command)
|
|
|
target_link_libraries(testwaylandcustom PRIVATE wayland-client)
|