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)
main
Daniel Gibson 2022-12-15 05:58:20 +01:00 committed by Sam Lantinga
parent ca2fe7be1a
commit 22e22ba196
71 changed files with 73 additions and 0 deletions

View File

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

View File

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

View File

@ -1,4 +1,6 @@
#include <SDL3/SDL.h> #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 <stdio.h>
#include EXPORT_HEADER #include EXPORT_HEADER

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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