Browse Source

Add SDL_main.h includes to tests

.. including cmake/test/*.c, whatever that does

(this is needed now because SDL.h doesn't include SDL_main.h anymore)
Daniel Gibson 2 years ago
parent
commit
22e22ba196
71 changed files with 73 additions and 0 deletions
  1. 1 0
      cmake/test/main_cli.c
  2. 1 0
      cmake/test/main_gui.c
  3. 2 0
      cmake/test/main_lib.c
  4. 1 0
      test/checkkeys.c
  5. 1 0
      test/checkkeysthreads.c
  6. 1 0
      test/controllermap.c
  7. 1 0
      test/loopwave.c
  8. 1 0
      test/loopwavequeue.c
  9. 1 0
      test/testatomic.c
  10. 1 0
      test/testaudiocapture.c
  11. 1 0
      test/testaudiohotplug.c
  12. 1 0
      test/testaudioinfo.c
  13. 1 0
      test/testautomation.c
  14. 1 0
      test/testbounds.c
  15. 1 0
      test/testcustomcursor.c
  16. 1 0
      test/testdisplayinfo.c
  17. 1 0
      test/testdraw2.c
  18. 1 0
      test/testdrawchessboard.c
  19. 1 0
      test/testdropfile.c
  20. 1 0
      test/testerror.c
  21. 1 0
      test/testfile.c
  22. 1 0
      test/testfilesystem.c
  23. 1 0
      test/testgamecontroller.c
  24. 1 0
      test/testgeometry.c
  25. 1 0
      test/testgl2.c
  26. 1 0
      test/testgles.c
  27. 1 0
      test/testgles2.c
  28. 1 0
      test/testgles2_sdf.c
  29. 1 0
      test/testhaptic.c
  30. 1 0
      test/testhittesting.c
  31. 1 0
      test/testhotplug.c
  32. 1 0
      test/testiconv.c
  33. 1 0
      test/testime.c
  34. 1 0
      test/testintersections.c
  35. 1 0
      test/testjoystick.c
  36. 1 0
      test/testkeys.c
  37. 1 0
      test/testloadso.c
  38. 1 0
      test/testlocale.c
  39. 1 0
      test/testlock.c
  40. 1 0
      test/testmessage.c
  41. 1 0
      test/testmouse.c
  42. 1 0
      test/testmultiaudio.c
  43. 2 0
      test/testnative.c
  44. 1 0
      test/testoffscreen.c
  45. 1 0
      test/testoverlay2.c
  46. 1 0
      test/testplatform.c
  47. 1 0
      test/testpower.c
  48. 1 0
      test/testqsort.c
  49. 1 0
      test/testrelative.c
  50. 1 0
      test/testrendercopyex.c
  51. 1 0
      test/testrendertarget.c
  52. 1 0
      test/testresample.c
  53. 1 0
      test/testrumble.c
  54. 1 0
      test/testscale.c
  55. 1 0
      test/testsem.c
  56. 1 0
      test/testsensor.c
  57. 1 0
      test/testshader.c
  58. 1 0
      test/testshape.c
  59. 1 0
      test/testsprite2.c
  60. 1 0
      test/testspriteminimal.c
  61. 1 0
      test/teststreaming.c
  62. 1 0
      test/testsurround.c
  63. 1 0
      test/testthread.c
  64. 1 0
      test/testtimer.c
  65. 1 0
      test/testurl.c
  66. 1 0
      test/testver.c
  67. 1 0
      test/testviewport.c
  68. 1 0
      test/testvulkan.c
  69. 1 0
      test/testwm2.c
  70. 1 0
      test/testyuv.c
  71. 1 0
      test/torturethread.c

+ 1 - 0
cmake/test/main_cli.c

@@ -1,5 +1,6 @@
 #define SDL_MAIN_HANDLED
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <stdio.h>
 
 int main(int argc, char *argv[]) {

+ 1 - 0
cmake/test/main_gui.c

@@ -1,4 +1,5 @@
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <stdio.h>
 
 int main(int argc, char *argv[]) {

+ 2 - 0
cmake/test/main_lib.c

@@ -1,4 +1,6 @@
 #include <SDL3/SDL.h>
+#define SDL_MAIN_HANDLED /* don't drag in header-only SDL_main implementation */
+#include <SDL3/SDL_main.h>
 #include <stdio.h>
 
 #include EXPORT_HEADER

+ 1 - 0
test/checkkeys.c

@@ -22,6 +22,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <SDL3/SDL_test_font.h>
 
 static SDL_Window *window;

+ 1 - 0
test/checkkeysthreads.c

@@ -23,6 +23,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int done;
 

+ 1 - 0
test/controllermap.c

@@ -17,6 +17,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 /* Define this for verbose output while mapping controllers */

+ 1 - 0
test/loopwave.c

@@ -22,6 +22,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static struct

+ 1 - 0
test/loopwavequeue.c

@@ -19,6 +19,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #if HAVE_SIGNAL_H
 #include <signal.h>

+ 1 - 0
test/testatomic.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /*
   Absolutely basic tests just to see if we get the expected value

+ 1 - 0
test/testaudiocapture.c

@@ -13,6 +13,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #ifdef __EMSCRIPTEN__
 #include <emscripten/emscripten.h>

+ 1 - 0
test/testaudiohotplug.c

@@ -23,6 +23,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static SDL_AudioSpec spec;

+ 1 - 0
test/testaudioinfo.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static void
 print_devices(int iscapture)

+ 1 - 0
test/testautomation.c

@@ -13,6 +13,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <SDL3/SDL_test.h>
 
 #include "testautomation_suites.h"

+ 1 - 0
test/testbounds.c

@@ -11,6 +11,7 @@
 */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char **argv)
 {

+ 1 - 0
test/testcustomcursor.c

@@ -16,6 +16,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 /* Stolen from the mailing list */
 /* Creates a new mouse cursor from an XPM */

+ 1 - 0
test/testdisplayinfo.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static void
 print_mode(const char *prefix, const SDL_DisplayMode *mode)

+ 1 - 0
test/testdraw2.c

@@ -20,6 +20,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #define NUM_OBJECTS 100
 

+ 1 - 0
test/testdrawchessboard.c

@@ -19,6 +19,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 SDL_Window *window;
 SDL_Renderer *renderer;

+ 1 - 0
test/testdropfile.c

@@ -13,6 +13,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 static SDLTest_CommonState *state;
 

+ 1 - 0
test/testerror.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static int alive = 0;
 

+ 1 - 0
test/testfile.c

@@ -24,6 +24,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /* WARNING ! those 2 files will be destroyed by this test program */
 

+ 1 - 0
test/testfilesystem.c

@@ -12,6 +12,7 @@
 /* Simple test of filesystem functions. */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 0
test/testgamecontroller.c

@@ -13,6 +13,7 @@
 /* Simple program to test the SDL game controller routines */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #ifdef __EMSCRIPTEN__

+ 1 - 0
test/testgeometry.c

@@ -20,6 +20,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static SDLTest_CommonState *state;

+ 1 - 0
test/testgl2.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #ifdef HAVE_OPENGL
 

+ 1 - 0
test/testgles.c

@@ -12,6 +12,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #if defined(__IOS__) || defined(__ANDROID__)
 #define HAVE_OPENGLES

+ 1 - 0
test/testgles2.c

@@ -16,6 +16,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #if defined(__IOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__WINDOWS__) || defined(__LINUX__)
 #define HAVE_OPENGLES2

+ 1 - 0
test/testgles2_sdf.c

@@ -16,6 +16,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #if defined(__IOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__WINDOWS__) || defined(__LINUX__)

+ 1 - 0
test/testhaptic.c

@@ -17,6 +17,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static SDL_Haptic *haptic;
 

+ 1 - 0
test/testhittesting.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /* !!! FIXME: rewrite this to be wired in to test framework. */
 

+ 1 - 0
test/testhotplug.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 0
test/testiconv.c

@@ -18,6 +18,7 @@
 #include <stdio.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static size_t

+ 1 - 0
test/testime.c

@@ -14,6 +14,7 @@
    Download at http://unifoundry.com/unifont.html */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #ifdef HAVE_SDL_TTF
 #include "SDL_ttf.h"
 #endif

+ 1 - 0
test/testintersections.c

@@ -20,6 +20,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #define SWAP(typ, a, b) \
     do {                \

+ 1 - 0
test/testjoystick.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #ifdef __EMSCRIPTEN__
 #include <emscripten/emscripten.h>

+ 1 - 0
test/testkeys.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 0
test/testloadso.c

@@ -16,6 +16,7 @@
 #include <stdio.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 typedef int (*fntype)(const char *);
 

+ 1 - 0
test/testlocale.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /* !!! FIXME: move this to the test framework */
 

+ 1 - 0
test/testlock.c

@@ -18,6 +18,7 @@
 #include <stdlib.h> /* for atexit() */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static SDL_mutex *mutex = NULL;
 static SDL_threadID mainthread;

+ 1 - 0
test/testmessage.c

@@ -15,6 +15,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
 static void

+ 1 - 0
test/testmouse.c

@@ -11,6 +11,7 @@
 */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #ifdef __EMSCRIPTEN__
 #include <emscripten/emscripten.h>

+ 1 - 0
test/testmultiaudio.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #include <stdio.h> /* for fflush() and stdout */
 

+ 2 - 0
test/testnative.c

@@ -17,6 +17,8 @@
 #include "testnative.h"
 #include "testutils.h"
 
+#include <SDL3/SDL_main.h>
+
 #define WINDOW_W    640
 #define WINDOW_H    480
 #define NUM_SPRITES 100

+ 1 - 0
test/testoffscreen.c

@@ -20,6 +20,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <SDL3/SDL_opengl.h>
 
 static SDL_Renderer *renderer = NULL;

+ 1 - 0
test/testoverlay2.c

@@ -24,6 +24,7 @@
 
 #include <SDL3/SDL_test.h>
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #define MOOSEPIC_W 64

+ 1 - 0
test/testplatform.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 /*
  * Watcom C flags these as Warning 201: "Unreachable code" if you just

+ 1 - 0
test/testpower.c

@@ -12,6 +12,7 @@
 /* Simple test of power subsystem. */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static void
 report_power(void)

+ 1 - 0
test/testqsort.c

@@ -11,6 +11,7 @@
 */
 
 #include <SDL3/SDL_test.h>
+#include <SDL3/SDL_main.h>
 
 static int SDLCALL
 num_compare(const void *_a, const void *_b)

+ 1 - 0
test/testrelative.c

@@ -16,6 +16,7 @@
 #include <time.h>
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #ifdef __EMSCRIPTEN__
 #include <emscripten/emscripten.h>

+ 1 - 0
test/testrendercopyex.c

@@ -18,6 +18,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static SDLTest_CommonState *state;

+ 1 - 0
test/testrendertarget.c

@@ -18,6 +18,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static SDLTest_CommonState *state;

+ 1 - 0
test/testresample.c

@@ -11,6 +11,7 @@
 */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char **argv)
 {

+ 1 - 0
test/testrumble.c

@@ -26,6 +26,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  * includes
  */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static SDL_Haptic *haptic;
 

+ 1 - 0
test/testscale.c

@@ -18,6 +18,7 @@
 #endif
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #define WINDOW_WIDTH  640

+ 1 - 0
test/testsem.c

@@ -15,6 +15,7 @@
 #include <signal.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #define NUM_THREADS 10
 /* This value should be smaller than the maximum count of the */

+ 1 - 0
test/testsensor.c

@@ -13,6 +13,7 @@
 /* Simple test of the SDL sensor code */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static const char *GetSensorTypeString(SDL_SensorType type)
 {

+ 1 - 0
test/testshader.c

@@ -12,6 +12,7 @@
 /* This is a simple example of using GLSL shaders with SDL */
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #include <stdlib.h>
 

+ 1 - 0
test/testshape.c

@@ -12,6 +12,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #define SHAPED_WINDOW_X         150
 #define SHAPED_WINDOW_Y         150

+ 1 - 0
test/testsprite2.c

@@ -20,6 +20,7 @@
 
 #include <SDL3/SDL_test.h>
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #define NUM_SPRITES 100

+ 1 - 0
test/testspriteminimal.c

@@ -19,6 +19,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #define WINDOW_WIDTH  640

+ 1 - 0
test/teststreaming.c

@@ -22,6 +22,7 @@
 #endif
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 #define MOOSEPIC_W 64

+ 1 - 0
test/testsurround.c

@@ -12,6 +12,7 @@
 
 /* Program to test surround sound audio channels */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static int total_channels;
 static int active_channel;

+ 1 - 0
test/testthread.c

@@ -16,6 +16,7 @@
 #include <signal.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static SDL_TLSID tls;
 static int alive = 0;

+ 1 - 0
test/testtimer.c

@@ -14,6 +14,7 @@
    platform
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #define DEFAULT_RESOLUTION 1
 

+ 1 - 0
test/testurl.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 static void tryOpenURL(const char *url)
 {

+ 1 - 0
test/testver.c

@@ -14,6 +14,7 @@
    version of SDL
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 int main(int argc, char *argv[])
 {

+ 1 - 0
test/testviewport.c

@@ -19,6 +19,7 @@
 
 #include <SDL3/SDL_test.h>
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 #include "testutils.h"
 
 static SDLTest_CommonState *state;

+ 1 - 0
test/testvulkan.c

@@ -12,6 +12,7 @@
 #include <stdlib.h>
 
 #include <SDL3/SDL_test_common.h>
+#include <SDL3/SDL_main.h>
 
 #if defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
 

+ 1 - 0
test/testwm2.c

@@ -18,6 +18,7 @@
 
 #include <SDL3/SDL_test_common.h>
 #include <SDL3/SDL_test_font.h>
+#include <SDL3/SDL_main.h>
 
 static SDLTest_CommonState *state;
 int done;

+ 1 - 0
test/testyuv.c

@@ -10,6 +10,7 @@
   freely.
 */
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 #include <SDL3/SDL_test_font.h>
 #include "testyuv_cvt.h"
 

+ 1 - 0
test/torturethread.c

@@ -16,6 +16,7 @@
 #include <signal.h>
 
 #include <SDL3/SDL.h>
+#include <SDL3/SDL_main.h>
 
 #define NUMTHREADS 10