libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.23k stars 1.87k forks source link

[SDL2] testautomation video_createWindowVariousFlags failing under dummy driver on Linux #8309

Closed smcv closed 1 year ago

smcv commented 1 year ago

To reproduce:

Expected result: SDL2 test suite passes

Actual result: both SDL2 and sdl2-compat have several test failures, most of which are out of scope for this particular bug report. The one I'm interested in right now is video_createWindowVariousFlags, in which creating a window with flag 2 (SDL_WINDOW_OPENGL) is failing:

INFO:  09/28/23 11:26:25: ----- Test Case 21.4: 'video_createWindowVariousFlags' started
INFO:  09/28/23 11:26:25: Test Description: 'Create windows using various flags'
INFO:  09/28/23 11:26:25: Test Iteration 1: execKey 153473147769168775
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,2)': Passed
ERROR: 09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Failed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,4)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,8)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,16)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,32)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed 
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,64)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,128)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,256)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,512)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,1024)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,2048)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_CreateWindow('Title',82,57,985,651,1048576)': Passed
INFO:  09/28/23 11:26:25: Assert 'Validate that returned window struct is not NULL': Passed
INFO:  09/28/23 11:26:25: Assert 'Call to SDL_DestroyWindow()': Passed
INFO:  09/28/23 11:26:25: Fuzzer invocations: 4
ERROR: 09/28/23 11:26:25: Assert Summary: Total=35 Passed=34 Failed=1
INFO:  09/28/23 11:26:25: Total Test runtime: 0.0 sec
ERROR: 09/28/23 11:26:25: >>> Test 'video_createWindowVariousFlags': Failed

The same is true for sdl2-compat, so I suppose it's faithfully emulating real SDL2, which is sort of good... but still a test failure.

Do we expect SDL_WINDOW_OPENGL with the dummy driver to fail, in which case that particular test should be skipped when using the dummy driver? Or do we expect it to succeed? (My test VM does not have a real GPU, but it does have GLX/EGL rendering on the CPU via Mesa's llvmpipe, which works well enough for GNOME Shell and glxgears.)

I'm reporting this because eventually, I'd like to be able to use testautomation as an acceptance test for new SDL versions in Debian. It looks as though I can now do this for SDL3 (at least with the dummy drivers), but not with SDL2 yet.

Kontrabant commented 1 year ago

This, along with #8308, was fixed in SDL3 via b8d91252. We can probably backport these changes.