SDL: Run tests with OpenWatcom on CI

From aa51a9791a972cf177d11b7752a378de41912864 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Thu, 19 May 2022 13:14:29 +0100
Subject: [PATCH] Run tests with OpenWatcom on CI

---
 .github/workflows/watcom.yml |  5 +++++
 test/watcom.mif              | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/.github/workflows/watcom.yml b/.github/workflows/watcom.yml
index 4650246c64c..ead7c4724f7 100644
--- a/.github/workflows/watcom.yml
+++ b/.github/workflows/watcom.yml
@@ -23,6 +23,11 @@ jobs:
         run: |
           cd test && wmake -f ${{ matrix.platform.makefile }}
           cd ..
+      - name: Run tests
+        if: "matrix.platform.makefile == 'Makefile.w32'"
+        run: |
+          cd test && wmake -f ${{ matrix.platform.makefile }} check-quick
+          cd ..
       - name: distclean
         run: |
           wmake -f ${{ matrix.platform.makefile }} distclean
diff --git a/test/watcom.mif b/test/watcom.mif
index 4cc8e7e3a14..dbeec5ddd59 100644
--- a/test/watcom.mif
+++ b/test/watcom.mif
@@ -25,6 +25,29 @@ TARGETS = testatomic.exe testdisplayinfo.exe testbounds.exe testdraw2.exe &
           testautomation.exe testaudiohotplug.exe testcustomcursor.exe testmultiaudio.exe &
           testoffscreen.exe testurl.exe
 
+noninteractive = &
+	testatomic.exe &
+	testerror.exe &
+	testfilesystem.exe &
+	testkeys.exe &
+	testlocale.exe &
+	testplatform.exe &
+	testpower.exe &
+	testqsort.exe &
+	testthread.exe &
+	testtimer.exe &
+	testver.exe
+
+needs_audio = &
+	testaudioinfo.exe &
+	testsurround.exe
+
+needs_display = &
+	testbounds.exe &
+	testdisplayinfo.exe
+
+TESTS = $(noninteractive) $(needs_audio) $(needs_display)
+
 # testautomation sources
 TASRCS = testautomation.c testautomation_audio.c testautomation_clipboard.c &
          testautomation_events.c testautomation_hints.c &
@@ -73,6 +96,19 @@ testime.exe: testime.obj
 testutils.lib: testutils.obj
   wlib -q -b -n -c -pa -s -t -zld -ii -io $@ $<
 
+check: .SYMBOLIC $(TESTS)
+  @set SDL_AUDIODRIVER=dummy
+  @set SDL_VIDEODRIVER=dummy
+  @copy "../SDL2.dll" .
+  @for %exe in ($(TESTS)) do %exe
+
+check-quick: .SYMBOLIC $(TESTS)
+  @set SDL_TESTS_QUICK=1
+  @set SDL_AUDIODRIVER=dummy
+  @set SDL_VIDEODRIVER=dummy
+  @copy "../SDL2.dll" .
+  @for %exe in ($(TESTS)) do %exe
+
 clean: .SYMBOLIC
   rm -f *.obj *.err
 distclean: .SYMBOLIC clean