Allowing the job to fail to avoid failing the pipeline. Some new tests are failing with it, and some are succeeding todo_wine.
-- v5: gitlab: Run user32 32-bit tests with nulldrv driver. user32/tests: Update todos specific to the X11 display driver. user32/tests: Check graphics driver and add todos for nulldrv.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/msg.c | 6 ++++ dlls/user32/tests/user32_test.h | 57 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 dlls/user32/tests/user32_test.h
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 6faaa2c2f40..e8a05cf87d7 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -36,6 +36,8 @@
#include "wine/test.h"
+#include "user32_test.h" + #define MDI_FIRST_CHILD_ID 2004
/* undocumented SWP flags - from SDK 3.1 */ @@ -12806,9 +12808,11 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg)
himc = ImmGetContext(hwnd); ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0); + todo_wine_if(is_driver( L"null" )) ok(ret, "ImmSetCompositionStringA failed.\n"); flush_sequence(); ret = ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + todo_wine_if(is_driver( L"null" )) ok(ret, "ImmNotifyIME failed.\n"); /* Note that the following message loop is necessary to get the WM_CHAR messages because they * are posted. Same for the later message loops in this function. */ @@ -12828,9 +12832,11 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0); + todo_wine_if(is_driver( L"null" )) ok(ret, "ImmSetCompositionStringA failed.\n"); flush_sequence(); ret = ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + todo_wine_if(is_driver( L"null" )) ok(ret, "ImmNotifyIME failed.\n"); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok_sequence(edit_eimes_getcompstratonce_seq, diff --git a/dlls/user32/tests/user32_test.h b/dlls/user32/tests/user32_test.h new file mode 100644 index 00000000000..30ef19cdcc1 --- /dev/null +++ b/dlls/user32/tests/user32_test.h @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Rémi Bernon for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stddef.h> + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" + +#include "wine/test.h" + +static inline BOOL is_driver( const WCHAR *match ) +{ + static WCHAR *cache; + + WCHAR *tmp = NULL, driver[MAX_PATH] = {0}, path[sizeof("System\CurrentControlSet\Control\Video\{}\0000") + 40]; + DWORD size = sizeof(driver); + UINT guid_atom; + HKEY key; + + if (cache) return !wcscmp( cache, match ); + + guid_atom = HandleToULong( GetPropW( GetDesktopWindow(), L"__wine_display_device_guid" ) ); + wcscpy( path, L"System\CurrentControlSet\Control\Video\{" ); + if (GlobalGetAtomNameW( guid_atom, path + wcslen( path ), 40 )) + { + wcscat( path, L"}\0000" ); + if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, path, &key )) + { + if (!RegQueryValueExW( key, L"GraphicsDriver", NULL, NULL, (BYTE *)&driver, &size )) + tmp = wcsdup( driver ); + RegCloseKey(key); + } + } + + if (!tmp) tmp = wcsdup( L"" ); + if ((tmp = InterlockedExchangePointer( (void *)&cache, tmp ))) free( tmp ); + + return !wcscmp( cache, match ); +}
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/user32/tests/msg.c | 3 ++- dlls/user32/tests/sysparams.c | 4 +++- dlls/user32/tests/win.c | 11 ++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index e8a05cf87d7..f4bdc30f62d 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16978,7 +16978,8 @@ static DWORD CALLBACK post_rbuttonup_msg( void *arg ) DWORD ret;
ret = WaitForSingleObject( data->wndproc_finished, 500 ); - todo_wine ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret ); + todo_wine_if(is_driver( L"winex11.drv" )) + ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret ); if( ret == WAIT_OBJECT_0 ) return 0;
PostMessageA( data->hwnd, WM_RBUTTONUP, 0, 0 ); diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 6ed7755b91b..666fa931fd1 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -30,6 +30,8 @@ #include "winuser.h" #include "winnls.h"
+#include "user32_test.h" + static BOOL (WINAPI *pIsProcessDPIAware)(void); static BOOL (WINAPI *pSetProcessDPIAware)(void); static BOOL (WINAPI *pSetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); @@ -3574,7 +3576,7 @@ static void test_dpi_mapping(void) hdc = GetWindowDC( hwnd ); GetClipBox( hdc, &rect ); SetRect( &expect, 0, 0, 295, 303 ); - todo_wine + todo_wine_if(is_driver( L"winex11.drv" )) ok( EqualRect( &expect, &rect ), "%Iu/%Iu: wrong clip box win DC %s expected %s\n", i, j, wine_dbgstr_rect(&rect), wine_dbgstr_rect(&expect) ); ReleaseDC( hwnd, hdc ); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 1252e046ad3..452c08fbf8a 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -34,6 +34,8 @@
#include "wine/test.h"
+#include "user32_test.h" + #ifndef WM_SYSTIMER #define WM_SYSTIMER 0x0118 #endif @@ -3282,7 +3284,8 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) ret = SetWindowPos(hwnd_child, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_SHOWWINDOW); ok(ret, "Got %d\n", ret); flush_events( TRUE ); - todo_wine check_active_state(hwnd2, hwnd2, hwnd2); + todo_wine_if(is_driver( L"winex11.drv" )) + check_active_state(hwnd2, hwnd2, hwnd2); DestroyWindow(hwnd_child); }
@@ -4034,8 +4037,10 @@ static void test_SetForegroundWindow(HWND hwnd) /* FIXME: these tests are failing because of a race condition * between internal focus state applied immediately and X11 focus * message coming late */ - todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow()); - todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus()); + todo_wine_if(is_driver( L"winex11.drv" )) + ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow()); + todo_wine_if(is_driver( L"winex11.drv" )) + ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
SetForegroundWindow(hwnd); check_wnd_state(hwnd, hwnd, hwnd, 0);
From: Rémi Bernon rbernon@codeweavers.com
--- tools/gitlab/test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/tools/gitlab/test.yml b/tools/gitlab/test.yml index 808c825eae9..64f2f62b4e0 100644 --- a/tools/gitlab/test.yml +++ b/tools/gitlab/test.yml @@ -66,6 +66,21 @@ test-linux-32: - export WINETEST_COLOR=1 - wine usr/local/lib/wine/i386-windows/winetest.exe -q -q -o - -t gitlab -u $CI_JOB_URL -n $EXCLUDE_TESTS
+test-linux-32-null: + extends: .wine-test + variables: + INCLUDE_TESTS: user32 + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + needs: + - job: build-linux + script: + - wine reg add HKCU\Software\Wine\Drivers /v Graphics /d null /f + - wineserver -w + - export WINETEST_COLOR=1 + - wine usr/local/lib/wine/i386-windows/winetest.exe -q -q -o - -t gitlab -u $CI_JOB_URL $INCLUDE_TESTS + - wine reg delete HKCU\Software\Wine\Drivers /v Graphics /f + debian-32: extends: .wine-test rules:
Fwiw I've setup some external jobs to run the test suite with `nulldrv`, they show up in https://test.winehq.org/data/patterns.html as `rbernon-nulldrv-win32` and `rbernon-nulldrv-win64`.
Several user32 tests are failing, which is possibly some regressions, or tests that only pass because of winex11. D3D-related tests are also often crashing in this configuration because they don't expect host GL/VK support to be unavailable.
I still think it'd be nice to have some jobs on Gitlab CI as well, so that we can test and expose `winex11` / `user32` bugs before fixing them.
This merge request was closed by Rémi Bernon.