Some Wine tests run code compiled from another C file, resulting in traces and errors that look like they come from a different test. subtest() allows such tests to declare their subtests so they are recognized by scripts parsing the results such as the TestBot and WineTest website.
Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
Currently the WineTest website just ignores the name of the unit test which is a bit suboptimal because it means it cannot detect when a test's subprocess stays around for too long and starts polluting the following tests.
But for proper parsing the subtest names should be declared. This patch makes it possible to do so through the subtest() API:
subtest("driver");
The WineTest and TestBot scripts can then identify subtests and handle them as appropriate.
include/wine/test.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/include/wine/test.h b/include/wine/test.h index b5aa9c14c70..588a36eb85e 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -123,17 +123,20 @@ extern void __winetest_cdecl winetest_win_skip( const char *msg, ... ) WINETEST_ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) WINETEST_PRINTF_ATTR(1,2);
#ifdef WINETEST_NO_LINE_NUMBERS +# define subtest_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_subtest # define ok_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_ok # define skip_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_skip # define win_skip_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_win_skip # define trace_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_trace #else +# define subtest_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_subtest # define ok_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_ok # define skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_skip # define win_skip_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_win_skip # define trace_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_trace #endif
+#define subtest subtest_(__FILE__, __LINE__) #define ok ok_(__FILE__, __LINE__) #define skip skip_(__FILE__, __LINE__) #define win_skip win_skip_(__FILE__, __LINE__) @@ -308,6 +311,13 @@ void winetest_set_location( const char* file, int line ) data->current_line=line; }
+void winetest_subtest( const char* name ) +{ + struct tls_data *data = get_tls_data(); + printf( "%s:%d: Subtest %s\n", + data->current_file, data->current_line, name); +} + int broken( int condition ) { return (strcmp(winetest_platform, "windows") == 0) && condition;
It may print test failures and as such should be declared by its parent.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/msi/tests/action.c | 1 + dlls/msi/tests/install.c | 1 + 2 files changed, 2 insertions(+)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index c0d67c343ec..6be56f76d7c 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -6519,6 +6519,7 @@ START_TEST(action) BOOL ret = FALSE;
init_functionpointers(); + subtest("custom");
if (pIsWow64Process) pIsWow64Process(GetCurrentProcess(), &is_wow64); diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index e348f327011..978d6193157 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -6212,6 +6212,7 @@ START_TEST(install) BOOL ret = FALSE;
init_functionpointers(); + subtest("custom");
if (pIsWow64Process) pIsWow64Process(GetCurrentProcess(), &is_wow64);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55851
Your paranoid android.
=== w2003std (task log) ===
Task errors: The task timed out
=== wvistau64 (task log) ===
Task errors: The task timed out
=== wvistau64_zh_CN (task log) ===
Task errors: The task timed out
=== wvistau64_fr (task log) ===
Task errors: The task timed out
=== wvistau64_he (task log) ===
Task errors: The task timed out
=== w7u (32 bit report) ===
msi: action: Timeout
=== w7pro64 (32 bit report) ===
msi: action: Timeout
=== w1064v1507 (32 bit report) ===
msi: action: Timeout
=== wvistau64 (64 bit report) ===
msi: action: Timeout
=== wvistau64 (task log) ===
Task errors: The task timed out
=== w7pro64 (64 bit report) ===
msi: action: Timeout
=== w1064v1507 (64 bit report) ===
msi: action: Timeout
=== w2003std (task log) ===
Task errors: The task timed out
=== wvistau64 (task log) ===
Task errors: The task timed out
=== wvistau64_zh_CN (task log) ===
Task errors: The task timed out
=== wvistau64_fr (task log) ===
Task errors: The task timed out
=== wvistau64_he (task log) ===
Task errors: The task timed out
=== w7u (32 bit report) ===
msi: install: Timeout
=== w7pro64 (32 bit report) ===
msi: install: Timeout
=== w1064v1507 (32 bit report) ===
msi: install.c:2730: Test failed: Expected ERROR_PATH_NOT_FOUND, got 1618 install.c:2743: Test failed: Expected ERROR_SUCCESS, got 1618 install.c:2511: Test failed: File not installed install.c:2512: Test failed: Directory not created install.c:2513: Test failed: File not installed install.c:2514: Test failed: Directory not created install.c:2515: Test failed: File not installed install.c:2516: Test failed: Directory not created install.c:2517: Test failed: File not installed install.c:2518: Test failed: Directory not created install.c:2519: Test failed: File not installed install.c:2520: Test failed: File not installed install.c:2521: Test failed: Directory not created install.c:2748: Test failed: Expected ERROR_SUCCESS, got 2 install.c:2753: Test failed: Expected ERROR_SUCCESS, got 6 install.c:2754: Test failed: Expected imaname, got install.c:2759: Test failed: Expected ERROR_FILE_NOT_FOUND, got 6 install.c:2764: Test failed: Expected ERROR_SUCCESS, got 6 install.c:2765: Test failed: Expected 314, got 0 install.c:2770: Test failed: Expected ERROR_SUCCESS, got 6 install.c:2771: Test failed: Expected OrderTestValue, got install.c:2777: Test failed: Expected ERROR_SUCCESS, got 1618 install.c:2511: Test failed: File not installed install.c:2512: Test failed: Directory not created install.c:2513: Test failed: File not installed install.c:2514: Test failed: Directory not created install.c:2515: Test failed: File not installed install.c:2516: Test failed: Directory not created install.c:2517: Test failed: File not installed install.c:2518: Test failed: Directory not created install.c:2519: Test failed: File not installed install.c:2520: Test failed: File not installed install.c:2521: Test failed: Directory not created install.c:2782: Test failed: Expected ERROR_SUCCESS, got 2
=== wvistau64 (64 bit report) ===
msi: install: Timeout
=== w7pro64 (64 bit report) ===
msi: install: Timeout
=== w1064v1507 (64 bit report) ===
msi: install.c:3072: Test failed: Expected ERROR_SUCCESS, got 1618 install.c:3073: Test failed: File not installed install.c:3074: Test failed: File not installed install.c:3075: Test failed: File not installed install.c:3076: Test failed: Directory not created install.c:3094: Test failed: Expected ERROR_SUCCESS, got 1618 install.c:3095: Test failed: File not installed install.c:3097: Test failed: File not installed install.c:3098: Test failed: File not installed install.c:3099: Test failed: Directory not created install.c:3120: Test failed: Expected ERROR_INSTALL_FAILURE, got 1618
=== debian10 (32 bit report) ===
Report errors: msi:install contains a misplaced todo message for custom
=== debian10 (32 bit French report) ===
Report errors: msi:install contains a misplaced todo message for custom
=== debian10 (32 bit Japanese:Japan report) ===
Report errors: msi:install contains a misplaced todo message for custom
=== debian10 (32 bit Chinese:China report) ===
Report errors: msi:install contains a misplaced todo message for custom
=== debian10 (32 bit WoW report) ===
Report errors: msi:install contains a misplaced todo message for custom
=== debian10 (64 bit WoW report) ===
Report errors: msi:install contains a misplaced todo message for custom
It may print test failures and as such should be declared by its parent.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 86dce75f29f..eb58878cec4 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -493,6 +493,7 @@ START_TEST(ntoskrnl) pSetFileCompletionNotificationModes = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "SetFileCompletionNotificationModes");
+ subtest("driver"); if (!(service = load_driver(filename, "driver.dll", "WineTestDriver"))) return; if (!start_driver(service))
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=55852
Your paranoid android.
=== w7u (task log) ===
Task errors: The previous 1 run(s) terminated abnormally
=== debian10 (32 bit report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit French report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit Japanese:Japan report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit Chinese:China report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (32 bit WoW report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver
=== debian10 (64 bit WoW report) ===
Report errors: ntoskrnl.exe:ntoskrnl contains a misplaced todo message for driver