SDL: cmake: run testautomation with CTest on ci

From a420eb79bb569b528e708c90542b3f033a0faa81 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 28 Sep 2023 19:15:52 +0200
Subject: [PATCH] cmake: run testautomation with CTest on ci

---
 .github/workflows/msvc.yml | 1 +
 test/CMakeLists.txt        | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml
index 7cfacdc92db4..373de567f270 100644
--- a/.github/workflows/msvc.yml
+++ b/.github/workflows/msvc.yml
@@ -41,6 +41,7 @@ jobs:
             set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
             cmake_minimum_required(VERSION 3.0...3.25)
             project(sdl_user)
+            enable_testing()
             add_subdirectory("{ srcdir }" SDL)
           """))
     - name: Configure (CMake)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6819c86837ec..f048d51f9edc 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -140,7 +140,7 @@ add_sdl_test_executable(testresample NEEDS_RESOURCES testresample.c)
 add_sdl_test_executable(testaudioinfo testaudioinfo.c)
 
 file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
-add_sdl_test_executable(testautomation NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES})
+add_sdl_test_executable(testautomation NONINTERACTIVE NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES})
 add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES testmultiaudio.c testutils.c)
 add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES testaudiohotplug.c testutils.c)
 add_sdl_test_executable(testaudiocapture testaudiocapture.c)
@@ -491,6 +491,7 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE})
     endif()
 endforeach()
 
+set_tests_properties(testautomation PROPERTIES TIMEOUT 120)
 set_tests_properties(testthread PROPERTIES TIMEOUT 40)
 set_tests_properties(testtimer PROPERTIES TIMEOUT 60)
 if(TARGET testfilesystem_pre)