Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in non-linear order (see #9303) #9320

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

1bsyl
Copy link
Contributor

@1bsyl 1bsyl commented Mar 20, 2024

Run tests in non-linear order (see #9303)

It mixes the testSuites array, and for each suite, it mixes the sub-tests.

Hence, it changes the public API behavior of SDLTest_RunSuites(). not sure if this is acceptable ?

@1bsyl
Copy link
Contributor Author

1bsyl commented Mar 20, 2024

now, some test seems to fails: at least 2:

--seed BM1BUVUADHUWWKPN --filter audio_initOpenCloseQuitAudio
--seed BM1BUVUADHUWWKPN --filter pen_buttonReporting

@madebr
Copy link
Contributor

madebr commented Mar 20, 2024

Hence, it changes the public API behavior of SDLTest_RunSuites(). not sure if this is acceptable ?

I asked about this in #9301.
For SDL_test to be useful for the satellite libraries in SDL3's lifetime, it's important for it to have a stable API (ABI does not matter).
So perhaps it's better for SDLTest_RunSuites to accept a single struct, which must be zero initialized before use.
Then we can add parameters and don't need to worry about backwards compatibility:

SDL_zero(testspec);
#if SDL_VERSION_ATLEAST(3,5,0)
testspec.parallel = SDL_TRUE
#endif 
SDLTest_RunSuites(&testspec);

@1bsyl
Copy link
Contributor Author

1bsyl commented Mar 21, 2024

yes, we need to modify the parameters of SDLTest_RunSuites

@slouken
could adding SDL_bool allow_random_order be enough or something more complex ?

int SDLTest_RunSuites(
                  SDLTest_TestSuiteReference *testSuites[], 
                  const char     *userRunSeed,
                  Uint64 userExecKey, 
                  const char *filter,
                  int testIterations)   ;

@slouken
Copy link
Collaborator

slouken commented Mar 21, 2024

I wonder if we could always permute them, based on the random seed? Alternatively this could be done in the application just by permitting the test suites before passing them in.

@1bsyl
Copy link
Contributor Author

1bsyl commented Mar 21, 2024

A seed should always give the same permutation.

we can permute the suite&case before passing them. (probably we need to create the seed before). but we lose the correct numbering of case/suite in the log.

@slouken
Copy link
Collaborator

slouken commented Mar 21, 2024

Good point.

@1bsyl
Copy link
Contributor Author

1bsyl commented Mar 22, 2024

I have updated the branch so that we don't lose the suite numbers neither.
and added SDL_bool randomOrder parameter to SDLTest_RunSuites().

Also added a "--no-random-order" parameter to testautomation so that we can still run test in linear order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants