cmake: let every test depends on pretest

This commit is contained in:
Anonymous Maarten 2023-09-24 21:35:41 +02:00 committed by Anonymous Maarten
parent f45761908a
commit f5886f11d0
2 changed files with 8 additions and 6 deletions

View file

@ -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(testpower NONINTERACTIVE SOURCES testpower.c)
add_sdl_test_executable(testfilesystem NONINTERACTIVE SOURCES testfilesystem.c) add_sdl_test_executable(testfilesystem NONINTERACTIVE SOURCES testfilesystem.c)
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) 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() endif()
add_sdl_test_executable(testrendertarget NEEDS_RESOURCES TESTUTILS SOURCES testrendertarget.c) add_sdl_test_executable(testrendertarget NEEDS_RESOURCES TESTUTILS SOURCES testrendertarget.c)
add_sdl_test_executable(testscale NEEDS_RESOURCES TESTUTILS SOURCES testscale.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 DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL3
) )
endif() endif()
if(TARGET pretest AND NOT "${TEST}" MATCHES "pretest")
set_property(TEST ${TEST} APPEND PROPERTY DEPENDS pretest)
endif()
endif() endif()
endforeach() endforeach()
if(TARGET testfilesystem_pre)
set_property(TEST testfilesystem APPEND PROPERTY DEPENDS testfilesystem_pre)
endif()
if(SDL_INSTALL_TESTS) if(SDL_INSTALL_TESTS)
if(RISCOS) if(RISCOS)
install( install(

View file

@ -22,12 +22,15 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Uint64 start; Uint64 start;
Uint64 prequit;
(void)argc; (void)argc;
(void)argv; (void)argv;
SDL_Init(0); SDL_Init(0);
start = SDL_GetTicks(); start = SDL_GetTicks();
SDL_GetPrefPath("libsdl", "test_filesystem"); 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_Quit();
SDL_Log("SDL_Quit took %" SDL_PRIu64 "ms", SDL_GetTicks() - prequit);
return 0; return 0;
} }