testprograms: parse arguments using SDLTest_CommonState

This commit is contained in:
Anonymous Maarten authored and Anonymous Maarten committed 2023-03-17 17:54:16 +01:00
1 parent 8bea41f737
commit 4a6528e3f0
71 files changed
+1516 -389

No files matched your search

+19 -1
View File
@@ -12,6 +12,7 @@
*/
#include "../src/SDL_internal.h"
#include <SDL3/SDL_test.h>
#include <stdio.h>
#include <string.h>
@@ -1038,5 +1039,22 @@ run_test(void)
int main(int argc, char *argv[])
{
return run_test() ? 0 : 1;
int result;
SDLTest_CommonState *state;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (state == NULL) {
return 1;
}
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
result = run_test() ? 0 : 1;
SDLTest_CommonDestroyState(state);
return result;
}