update SDL3 to latest commit

This commit is contained in:
Sasha Szpakowski
2024-10-06 20:30:44 -03:00
parent 1b0fdc338b
commit 9e5eb1b018
1426 changed files with 242456 additions and 103496 deletions
+12 -36
View File
@@ -19,6 +19,7 @@
#include "testautomation_suites.h"
static SDLTest_CommonState *state;
static SDLTest_TestSuiteRunner *runner;
/* All test suites */
static SDLTest_TestSuiteReference *testSuites[] = {
@@ -34,7 +35,6 @@ static SDLTest_TestSuiteReference *testSuites[] = {
&mainTestSuite,
&mathTestSuite,
&mouseTestSuite,
&penTestSuite,
&pixelsTestSuite,
&platformTestSuite,
&propertiesTestSuite,
@@ -47,7 +47,8 @@ static SDLTest_TestSuiteReference *testSuites[] = {
&timeTestSuite,
&timerTestSuite,
&videoTestSuite,
&subsystemsTestSuite, /* run last, not interfere with other test enviroment */
&blitTestSuite,
&subsystemsTestSuite, /* run last, not interfere with other test environment */
NULL
};
@@ -55,6 +56,7 @@ static SDLTest_TestSuiteReference *testSuites[] = {
static void
quit(int rc)
{
SDLTest_DestroyTestSuiteRunner(runner);
SDLTest_CommonQuit(state);
/* Let 'main()' return normally */
if (rc != 0) {
@@ -65,10 +67,6 @@ quit(int rc)
int main(int argc, char *argv[])
{
int result;
int testIterations = 1;
Uint64 userExecKey = 0;
char *userRunSeed = NULL;
char *filter = NULL;
int i, done;
SDL_Event event;
int list = 0;
@@ -82,6 +80,8 @@ int main(int argc, char *argv[])
/* No need of windows (or update testautomation_mouse.c:mouse_getMouseFocus() */
state->num_windows = 0;
runner = SDLTest_CreateTestSuiteRunner(state, testSuites);
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
@@ -89,36 +89,16 @@ int main(int argc, char *argv[])
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
consumed = -1;
if (SDL_strcasecmp(argv[i], "--iterations") == 0) {
if (argv[i + 1]) {
testIterations = SDL_atoi(argv[i + 1]);
if (testIterations < 1) {
testIterations = 1;
}
consumed = 2;
}
} else if (SDL_strcasecmp(argv[i], "--execKey") == 0) {
if (argv[i + 1]) {
(void)SDL_sscanf(argv[i + 1], "%" SDL_PRIu64, &userExecKey);
consumed = 2;
}
} else if (SDL_strcasecmp(argv[i], "--seed") == 0) {
if (argv[i + 1]) {
userRunSeed = SDL_strdup(argv[i + 1]);
consumed = 2;
}
} else if (SDL_strcasecmp(argv[i], "--filter") == 0) {
if (argv[i + 1]) {
filter = SDL_strdup(argv[i + 1]);
consumed = 2;
}
} else if (SDL_strcasecmp(argv[i], "--list") == 0) {
if (SDL_strcasecmp(argv[i], "--list") == 0) {
consumed = 1;
list = 1;
}
}
if (consumed < 0) {
static const char *options[] = { "[--iterations #]", "[--execKey #]", "[--seed string]", "[--filter suite_name|test_name]", "[--list]", NULL };
static const char *options[] = {
"[--list]",
NULL };
SDLTest_CommonLogUsage(state, argv[0], options);
quit(1);
}
@@ -154,7 +134,7 @@ int main(int argc, char *argv[])
}
/* Call Harness */
result = SDLTest_RunSuites(testSuites, userRunSeed, userExecKey, filter, testIterations);
result = SDLTest_ExecuteTestSuiteRunner(runner);
/* Empty event queue */
done = 0;
@@ -165,10 +145,6 @@ int main(int argc, char *argv[])
SDL_Delay(10);
}
/* Clean up */
SDL_free(userRunSeed);
SDL_free(filter);
/* Shutdown everything */
quit(0);
return result;