mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-21 09:36:24 +00:00
Run test suites and test cases in non-linear order (see libsdl-org#9303)
This commit is contained in:
@@ -75,6 +75,7 @@ int main(int argc, char *argv[])
|
||||
int i, done;
|
||||
SDL_Event event;
|
||||
int list = 0;
|
||||
SDL_bool randomOrder = SDL_FALSE;
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO | SDL_INIT_AUDIO);
|
||||
@@ -118,10 +119,21 @@ int main(int argc, char *argv[])
|
||||
} else if (SDL_strcasecmp(argv[i], "--list") == 0) {
|
||||
consumed = 1;
|
||||
list = 1;
|
||||
} else if (SDL_strcasecmp(argv[i], "--random-order") == 0) {
|
||||
consumed = 1;
|
||||
randomOrder = SDL_TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
if (consumed < 0) {
|
||||
static const char *options[] = { "[--iterations #]", "[--execKey #]", "[--seed string]", "[--filter suite_name|test_name]", "[--list]", NULL };
|
||||
static const char *options[] = {
|
||||
"[--iterations #]",
|
||||
"[--execKey #]",
|
||||
"[--seed string]",
|
||||
"[--filter suite_name|test_name]",
|
||||
"[--list]",
|
||||
"[--random-order]",
|
||||
NULL };
|
||||
SDLTest_CommonLogUsage(state, argv[0], options);
|
||||
quit(1);
|
||||
}
|
||||
@@ -157,7 +169,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Call Harness */
|
||||
result = SDLTest_RunSuites(testSuites, userRunSeed, userExecKey, filter, testIterations);
|
||||
result = SDLTest_RunSuites(testSuites, userRunSeed, userExecKey, filter, testIterations, randomOrder);
|
||||
|
||||
/* Empty event queue */
|
||||
done = 0;
|
||||
|
||||
Reference in New Issue
Block a user