mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-21 12:18:28 +00:00
testprograms: parse arguments using SDLTest_CommonState
This commit is contained in:
parent
8bea41f737
commit
4a6528e3f0
71 changed files with 1516 additions and 389 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue