diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 70069a547..9f65a59ef 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -304,7 +304,7 @@ add_sdl_test_executable(testplatform NONINTERACTIVE SOURCES testplatform.c) add_sdl_test_executable(testpower NONINTERACTIVE SOURCES testpower.c) add_sdl_test_executable(testfilesystem NONINTERACTIVE SOURCES testfilesystem.c) if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) - add_sdl_test_executable(testfilesystem_pre SOURCES testfilesystem_pre.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 60) + add_sdl_test_executable(pretest SOURCES pretest.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 60) endif() add_sdl_test_executable(testrendertarget NEEDS_RESOURCES TESTUTILS SOURCES testrendertarget.c) add_sdl_test_executable(testscale NEEDS_RESOURCES TESTUTILS SOURCES testscale.c) @@ -511,13 +511,12 @@ foreach(TEST ${SDL_TEST_EXECUTABLES}) DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL3 ) endif() + if(TARGET pretest AND NOT "${TEST}" MATCHES "pretest") + set_property(TEST ${TEST} APPEND PROPERTY DEPENDS pretest) + endif() endif() endforeach() -if(TARGET testfilesystem_pre) - set_property(TEST testfilesystem APPEND PROPERTY DEPENDS testfilesystem_pre) -endif() - if(SDL_INSTALL_TESTS) if(RISCOS) install( diff --git a/test/testfilesystem_pre.c b/test/pretest.c similarity index 81% rename from test/testfilesystem_pre.c rename to test/pretest.c index 1a7e0d617..ab43685ee 100644 --- a/test/testfilesystem_pre.c +++ b/test/pretest.c @@ -22,12 +22,15 @@ int main(int argc, char *argv[]) { Uint64 start; + Uint64 prequit; (void)argc; (void)argv; SDL_Init(0); start = SDL_GetTicks(); SDL_GetPrefPath("libsdl", "test_filesystem"); - SDL_Log("SDL_GetPrefPath took %" SDL_PRIu64 "ms", SDL_GetTicks() - start); + prequit = SDL_GetTicks(); + SDL_Log("SDL_GetPrefPath took %" SDL_PRIu64 "ms", prequit - start); SDL_Quit(); + SDL_Log("SDL_Quit took %" SDL_PRIu64 "ms", SDL_GetTicks() - prequit); return 0; }