Report the line number where the test failed to wait for the child so one can identify which child process did not behave as expected. Also wait_child_process() is meant for the general case so report all non-crash error cases as test failures so they are accounted for. Omit the "winetest_" prefix to match the other Wine test functions and so the underlying winetest_wait_child_process() function can be wrapped with the usual line-capturing macros.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48651 Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/advapi32/tests/security.c | 4 ++-- dlls/dbgeng/tests/dbgeng.c | 4 ++-- dlls/gdi32/tests/font.c | 2 +- dlls/kernel32/tests/actctx.c | 4 ++-- dlls/kernel32/tests/console.c | 2 +- dlls/kernel32/tests/heap.c | 2 +- dlls/kernel32/tests/pipe.c | 6 +++--- dlls/kernel32/tests/toolhelp.c | 2 +- dlls/kernel32/tests/virtual.c | 4 ++-- dlls/mfplat/tests/mfplat.c | 4 ++-- dlls/mscoree/tests/comtest.c | 2 +- dlls/msvcrt/tests/data.c | 2 +- dlls/msvcrt/tests/file.c | 4 ++-- dlls/ntdll/tests/exception.c | 4 ++-- dlls/ole32/tests/marshal.c | 2 +- dlls/oleacc/tests/main.c | 2 +- dlls/qmgr/tests/qmgr.c | 2 +- dlls/rpcrt4/tests/server.c | 6 +++--- dlls/shell32/tests/shellpath.c | 2 +- dlls/shlwapi/tests/ordinal.c | 2 +- dlls/sxs/tests/sxs.c | 2 +- dlls/ucrtbase/tests/misc.c | 2 +- dlls/urlmon/tests/misc.c | 2 +- dlls/urlmon/tests/sec_mgr.c | 2 +- dlls/user32/tests/class.c | 2 +- dlls/user32/tests/clipboard.c | 2 +- dlls/user32/tests/cursoricon.c | 2 +- dlls/user32/tests/msg.c | 2 +- dlls/user32/tests/win.c | 6 +++--- include/wine/test.h | 32 ++++++++++++++++++++++---------- 30 files changed, 64 insertions(+), 52 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index d003a7f1a0d..c6f5d4690ae 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3050,7 +3050,7 @@ static void test_process_security(void) STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); TEST_GRANTED_ACCESS2( info.hThread, THREAD_ALL_ACCESS_NT4, STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess );
FreeSid(EveryoneSid); CloseHandle( info.hProcess ); @@ -7189,7 +7189,7 @@ static void test_token_security_descriptor(void) sprintf(buffer, "%s security test_token_sd", myARGV[0]); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info); ok(ret, "CreateProcess failed with error %u\n", GetLastError()); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess); CloseHandle(info.hThread);
diff --git a/dlls/dbgeng/tests/dbgeng.c b/dlls/dbgeng/tests/dbgeng.c index 498ecd4de69..572d96e405b 100644 --- a/dlls/dbgeng/tests/dbgeng.c +++ b/dlls/dbgeng/tests/dbgeng.c @@ -308,7 +308,7 @@ todo_wine
SetEvent(event);
- winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess);
CloseHandle(info.hProcess); CloseHandle(info.hThread); @@ -473,7 +473,7 @@ static void test_module_information(void) ok(hr == S_OK, "Failed to detach, hr %#x.\n", hr);
SetEvent(event); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess);
CloseHandle(info.hProcess); CloseHandle(info.hThread); diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 7e90a50d844..ae4a643aa54 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -7268,7 +7268,7 @@ START_TEST(font) sprintf(path_name, "%s font %s", argv[0], test_names[i]); ok(CreateProcessA(NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info), "CreateProcess failed.\n"); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess); CloseHandle(info.hThread); } diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index 4b7096276e8..01c6c1e627c 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -2506,7 +2506,7 @@ static void run_child_process(void) sprintf(cmdline, ""%s" %s manifest1", argv[0], argv[1]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError()); - winetest_wait_child_process( pi.hProcess ); + wait_child_process( pi.hProcess ); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); DeleteFileA(path); @@ -3470,7 +3470,7 @@ static void run_child_process_two_dll(int run) ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError());
- winetest_wait_child_process( pi.hProcess ); + wait_child_process( pi.hProcess );
CloseHandle(pi.hThread); CloseHandle(pi.hProcess); diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index 9698f11779e..5e35f101d5a 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -3272,7 +3272,7 @@ static void test_AttachConsole(HANDLE console) ok(res, "CreateProcess failed: %u\n", GetLastError()); CloseHandle(info.hThread);
- winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess);
res = ReadConsoleOutputCharacterA(console, buf, 5, c, &len); diff --git a/dlls/kernel32/tests/heap.c b/dlls/kernel32/tests/heap.c index 3c697f31952..bc57498bf91 100644 --- a/dlls/kernel32/tests/heap.c +++ b/dlls/kernel32/tests/heap.c @@ -1102,7 +1102,7 @@ static void test_debug_heap( const char *argv0, DWORD flags ) ok( ret, "failed to create child process error %u\n", GetLastError() ); if (ret) { - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess ); CloseHandle( info.hThread ); CloseHandle( info.hProcess ); } diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 20f3450c6d0..3c7ca06a045 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -3258,7 +3258,7 @@ static void test_overlapped_transport(BOOL msg_mode, BOOL msg_read_mode) ok(!res && GetLastError() == ERROR_MORE_DATA, "ReadFile returned: %x %u\n", res, GetLastError()); ok(read_bytes == 10, "read_bytes = %u\n", read_bytes); TerminateProcess(process, 0); - winetest_wait_child_process(process); + wait_child_process(process); /* after terminating process, there is no pending write and pipe buffer is empty */ overlapped_read_async(server, buf, 10, &overlapped); overlapped_write_sync(client, buf, 1); @@ -3524,7 +3524,7 @@ static void test_namedpipe_process_id(void) ok(server != INVALID_HANDLE_VALUE, "got %u\n", GetLastError());
process = create_check_id_process("checkpid", GetProcessId(GetCurrentProcess())); - winetest_wait_child_process(process); + wait_child_process(process);
CloseHandle(overlapped.hEvent); CloseHandle(process); @@ -3667,7 +3667,7 @@ static void test_namedpipe_session_id(void) ok(server != INVALID_HANDLE_VALUE, "got %u\n", GetLastError());
process = create_check_id_process("checksessionid", current); - winetest_wait_child_process(process); + wait_child_process(process);
CloseHandle(overlapped.hEvent); CloseHandle(process); diff --git a/dlls/kernel32/tests/toolhelp.c b/dlls/kernel32/tests/toolhelp.c index 159d71a20cd..9250f8dc549 100644 --- a/dlls/kernel32/tests/toolhelp.c +++ b/dlls/kernel32/tests/toolhelp.c @@ -343,5 +343,5 @@ START_TEST(toolhelp) test_module(info.dwProcessId, sub_expected_modules, ARRAY_SIZE(sub_expected_modules));
SetEvent(ev2); - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess ); } diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index c534e310efe..99dde34396f 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -4154,7 +4154,7 @@ static void test_shared_memory(BOOL is_child) sprintf(cmdline, ""%s" virtual sharedmem", argv[0]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); - winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); } @@ -4194,7 +4194,7 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access) sprintf(cmdline, ""%s" virtual sharedmemro %x", argv[0], child_access); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); - winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index bf63337b60f..008aa05c302 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -4434,7 +4434,7 @@ static void test_queue_com(void) sprintf(path_name, "%s mfplat s%d", argv[0], system_queues[i]); ok(CreateProcessA( NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info), "CreateProcess failed.\n" ); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess); CloseHandle(info.hThread); } @@ -4446,7 +4446,7 @@ static void test_queue_com(void) sprintf(path_name, "%s mfplat u%d", argv[0], user_queues[i]); ok(CreateProcessA( NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info), "CreateProcess failed.\n" ); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess); CloseHandle(info.hThread); } diff --git a/dlls/mscoree/tests/comtest.c b/dlls/mscoree/tests/comtest.c index 69e24494e6d..12b112417d5 100644 --- a/dlls/mscoree/tests/comtest.c +++ b/dlls/mscoree/tests/comtest.c @@ -315,7 +315,7 @@ static void run_child_process(const char *dll_source, run_type run) ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError());
- winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hProcess); diff --git a/dlls/msvcrt/tests/data.c b/dlls/msvcrt/tests/data.c index 050a234ce87..52742ba4994 100644 --- a/dlls/msvcrt/tests/data.c +++ b/dlls/msvcrt/tests/data.c @@ -217,7 +217,7 @@ static void test___getmainargs_parent(char *name) memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(startup); CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &proc); - winetest_wait_child_process(proc.hProcess); + wait_child_process(proc.hProcess);
_unlink(filepath); sprintf(filepath, "%swine_test\a", tmppath); diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 0c4e024a8ec..8c6df2e8e2b 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -1430,7 +1430,7 @@ static void test_stdout_handle( STARTUPINFOA *startup, char *cmdline, HANDLE hst
CreateProcessA( NULL, cmdline, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE | NORMAL_PRIORITY_CLASS, NULL, NULL, startup, &proc ); - winetest_wait_child_process( proc.hProcess ); + wait_child_process( proc.hProcess );
data = read_file( hErrorFile ); if (expect_stdout) @@ -1647,7 +1647,7 @@ static void test_invalid_stdin( const char* selfname ) sprintf(cmdline, "%s file stdin", selfname); CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &proc); - winetest_wait_child_process(proc.hProcess); + wait_child_process(proc.hProcess);
ret = RegCloseKey(key); ok(!ret, "RegCloseKey failed: %x\n", ret); diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 07e05e45c90..4003b0a4805 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -1182,7 +1182,7 @@ static void test_debugger(void)
} while (de.dwDebugEventCode != EXIT_PROCESS_DEBUG_EVENT);
- winetest_wait_child_process( pi.hProcess ); + wait_child_process( pi.hProcess ); ret = CloseHandle(pi.hThread); ok(ret, "error %u\n", GetLastError()); ret = CloseHandle(pi.hProcess); @@ -3402,7 +3402,7 @@ static void test_suspend_process(void)
SetEvent(event);
- winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess);
CloseHandle(info.hProcess); CloseHandle(info.hThread); diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index ea224994e55..e2608ecb768 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -3894,7 +3894,7 @@ static void test_local_server(void) quit_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); SetEvent(quit_event);
- winetest_wait_child_process( process ); + wait_child_process( process ); CloseHandle(quit_event); CloseHandle(process); } diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index 685e9b76f56..c1e7d93ba3f 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -547,7 +547,7 @@ static void test_LresultFromObject(const char *name) memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(startup); CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &proc); - winetest_wait_child_process(proc.hProcess); + wait_child_process(proc.hProcess); ok(Object_ref == 1, "Object_ref = %d\n", Object_ref); }
diff --git a/dlls/qmgr/tests/qmgr.c b/dlls/qmgr/tests/qmgr.c index 4ab12d3360a..d000fd6f36d 100644 --- a/dlls/qmgr/tests/qmgr.c +++ b/dlls/qmgr/tests/qmgr.c @@ -117,7 +117,7 @@ static void run_child(WCHAR *secret)
wsprintfW(cmdline, format, progname, secret); ok(CreateProcessW(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n"); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); ok(CloseHandle(info.hProcess), "CloseHandle\n"); ok(CloseHandle(info.hThread), "CloseHandle\n"); } diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c index 0a76c96d589..2400143eefe 100644 --- a/dlls/rpcrt4/tests/server.c +++ b/dlls/rpcrt4/tests/server.c @@ -1112,7 +1112,7 @@ run_client(const char *test)
make_cmdline(cmdline, test); ok(CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info), "CreateProcess\n"); - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess ); ok(CloseHandle(info.hProcess), "CloseHandle\n"); ok(CloseHandle(info.hThread), "CloseHandle\n"); } @@ -2337,7 +2337,7 @@ static void test_reconnect(void)
stop();
- winetest_wait_child_process(server_process); + wait_child_process(server_process); ok(CloseHandle(server_process), "CloseHandle\n");
/* create new server, rpcrt4 will connect to it once sending to existing connection fails @@ -2346,7 +2346,7 @@ static void test_reconnect(void) basic_tests(); stop();
- winetest_wait_child_process(server_process); + wait_child_process(server_process); ok(CloseHandle(server_process), "CloseHandle\n");
ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index f3a634dc298..4c9b9693983 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -1786,7 +1786,7 @@ static void test_NonExistentPath(void) startup.wShowWindow = SW_SHOWNORMAL; CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess );
/* restore original values: */ trace("Restoring CSIDL_FAVORITES to %s\n", originalPath); diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index f1527eb6b83..8c5e3e261e2 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -481,7 +481,7 @@ static void test_alloc_shared(int argc, char **argv) ok(ret, "could not create child process error: %u\n", GetLastError()); if (ret) { - winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
diff --git a/dlls/sxs/tests/sxs.c b/dlls/sxs/tests/sxs.c index eb54c6fa1d4..6b1a9952f36 100644 --- a/dlls/sxs/tests/sxs.c +++ b/dlls/sxs/tests/sxs.c @@ -192,7 +192,7 @@ static void run_child_process(void) ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError());
- winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hProcess); diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 79f3dc9af8c..ada3a52eb64 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -476,7 +476,7 @@ static void test__get_narrow_winmain_command_line(char *path) CreateProcessA(path, cmd, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &proc); - winetest_wait_child_process(proc.hProcess); + wait_child_process(proc.hProcess); CloseHandle(proc.hProcess); CloseHandle(proc.hThread); } diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c index 4c5c6aea10b..abe77ac7eaf 100644 --- a/dlls/urlmon/tests/misc.c +++ b/dlls/urlmon/tests/misc.c @@ -1916,7 +1916,7 @@ static void test_internet_features(void) { sprintf(cmdline, ""%s" %s internet_features", argv[0], argv[1]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError()); - winetest_wait_child_process( pi.hProcess ); + wait_child_process( pi.hProcess ); CloseHandle(pi.hThread); CloseHandle(pi.hProcess);
diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c index 54dc67bdeed..0577af4ecc9 100644 --- a/dlls/urlmon/tests/sec_mgr.c +++ b/dlls/urlmon/tests/sec_mgr.c @@ -848,7 +848,7 @@ static void run_child_process(void) sprintf(cmdline, ""%s" %s domain_tests", argv[0], argv[1]); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Failed to spawn child process: %u\n", GetLastError()); - winetest_wait_child_process(pi.hProcess); + wait_child_process(pi.hProcess); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); } diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index 51bc1169081..606a29a257f 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -1280,7 +1280,7 @@ static void test_comctl32_classes(void) sprintf( path_name, "%s class %s", argv[0], classes[i] ); ok( CreateProcessA( NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ), "CreateProcess failed.\n" ); - winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess ); CloseHandle( info.hProcess ); CloseHandle( info.hThread ); } diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index df23bb28946..6fc4325e985 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -171,7 +171,7 @@ static void run_process( const char *args ) ok( CreateProcessA( NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ), "CreateProcess %s failed\n", cmd );
- winetest_wait_child_process( info.hProcess ); + wait_child_process( info.hProcess ); CloseHandle( info.hProcess ); CloseHandle( info.hThread ); } diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c index 7a5f9551615..ff4ab5d8755 100644 --- a/dlls/user32/tests/cursoricon.c +++ b/dlls/user32/tests/cursoricon.c @@ -446,7 +446,7 @@ static void do_parent(void) static void finish_child_process(void) { SendMessageA(child, WM_CLOSE, 0, 0); - winetest_wait_child_process( child_process ); + wait_child_process( child_process ); CloseHandle(child_process); }
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 423157b623d..303a026cda1 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16305,7 +16305,7 @@ static void test_WaitForInputIdle( char *argv0 ) WaitForSingleObject( pi.hProcess, 1000 ); /* give it a chance to exit on its own */ } TerminateProcess( pi.hProcess, 0 ); /* just in case */ - winetest_wait_child_process( pi.hProcess ); + wait_child_process( pi.hProcess ); ret = WaitForInputIdle( pi.hProcess, 100 ); ok( ret == WAIT_FAILED, "%u: WaitForInputIdle after exit error %08x\n", i, ret ); CloseHandle( pi.hProcess ); diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 0f683f858a1..56072bebf71 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -9451,7 +9451,7 @@ static void test_window_from_point(const char *argv0) ok(win == child, "WindowFromPoint returned %p, expected %p\n", win, child);
SetEvent(end_event); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(start_event); CloseHandle(end_event); CloseHandle(info.hProcess); @@ -10302,7 +10302,7 @@ static void test_winproc_handles(const char *argv0) startup.cb = sizeof(startup); ok(CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info), "CreateProcess failed.\n"); - winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(info.hProcess); CloseHandle(info.hThread); } @@ -11825,7 +11825,7 @@ static void test_other_process_window(const char *argv0) ret = WaitForSingleObject(test_done_event, 5000); ok(ret == WAIT_OBJECT_0, "Unexpected ret %x.\n", ret);
- winetest_wait_child_process(info.hProcess); + wait_child_process(info.hProcess); CloseHandle(window_ready_event); CloseHandle(test_done_event); CloseHandle(info.hProcess); diff --git a/include/wine/test.h b/include/wine/test.h index 3af3ffd2a91..1bf178339fd 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -110,12 +110,14 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT # 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 +# define wait_process_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_wait_process #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 +# define wait_child_process_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : winetest_wait_child_process #endif
#define subtest subtest_(__FILE__, __LINE__) @@ -123,6 +125,7 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT #define skip skip_(__FILE__, __LINE__) #define win_skip win_skip_(__FILE__, __LINE__) #define trace trace_(__FILE__, __LINE__) +#define wait_child_process wait_child_process_(__FILE__, __LINE__)
#define todo_if(is_todo) for (winetest_start_todo(is_todo); \ winetest_loop_todo(); \ @@ -477,24 +480,33 @@ void winetest_add_failures( LONG new_failures )
void winetest_wait_child_process( HANDLE process ) { - DWORD exit_code = 1; + DWORD ret;
- if (WaitForSingleObject( process, 30000 )) - printf( "%s: child process wait failed\n", current_test->name ); - else - GetExitCodeProcess( process, &exit_code ); + winetest_ok( process != NULL, "No child process handle (CreateProcess failed?)\n" ); + if (!process) return;
- if (exit_code) + ret = WaitForSingleObject( process, 30000 ); + if (ret == WAIT_TIMEOUT) + winetest_ok( 0, "Timed out waiting for the child process\n" ); + else if (ret != WAIT_OBJECT_0) + winetest_ok( 0, "Could not wait for the child process: %d le=%u\n", + ret, GetLastError() ); + else { + DWORD exit_code; + struct tls_data *data = get_tls_data(); + GetExitCodeProcess( process, &exit_code ); if (exit_code > 255) { - printf( "%s: exception 0x%08x in child process\n", current_test->name, exit_code ); + DWORD pid = GetProcessId( process ); + printf( "%s:%d: unhandled exception %08x in child process %04x\n", + current_test->name, data->current_line, exit_code, pid ); InterlockedIncrement( &failures ); } - else + else if (exit_code) { - printf( "%s: %u failures in child process\n", - current_test->name, exit_code ); + printf( "%s:%d: %u failures in child process\n", + current_test->name, data->current_line, exit_code ); while (exit_code-- > 0) InterlockedIncrement(&failures); }
Make sure they are included in the failure count, highlighted as failures and sanitized before comparison for the new failures detection.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48651 Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
I'm sending this patch as a reply to the Wine one because they work together and maybe that makes review easier (or maybe it's the opposite).
In any case they don't have to be committed or rather 'put in production' in a specific order. Either one on its own won't make things worse than they currently are.
testbot/lib/WineTestBot/LogUtils.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm index 57229bc40d..99c30e0f76 100644 --- a/testbot/lib/WineTestBot/LogUtils.pm +++ b/testbot/lib/WineTestBot/LogUtils.pm @@ -327,7 +327,7 @@ sub GetReportLineCategory($) if ($Line =~ /: Test (?:failed|succeeded inside todo block): / or $Line =~ /Fatal: test .* does not exist/ or $Line =~ / done (258)/ or - $Line =~ /: unhandled exception [0-9a-fA-F]{8} at / or + $Line =~ /: unhandled exception [0-9a-fA-F]{8} (?:at|in) / or $Line =~ /^Unhandled exception: /) { return "error"; @@ -627,6 +627,13 @@ sub ParseWineTestReport($$$) _CheckUnit($LogInfo, $Cur, $Unit, "unhandled exception"); $Cur->{LineFailures}++; } + elsif (($Cur->{Unit} ne "" and + $Line =~ /($Cur->{UnitsRE}):\d+: unhandled exception [0-9a-fA-F]{8} in child process /) or + $Line =~ /^([_.a-z0-9]+):\d+: unhandled exception [0-9a-fA-F]{8} in child process /) + { + _CheckUnit($LogInfo, $Cur, $1, "child exception"); + $Cur->{LineFailures}++; + } elsif (($Cur->{Unit} ne "" and $Line =~ /([0-9a-f]+):($Cur->{Unit}): \d+ tests? executed ((\d+) marked as todo, (\d+) failures?), (\d+) skipped./) or $Line =~ /^([0-9a-f]+):([_a-z0-9]+): \d+ tests? executed ((\d+) marked as todo, (\d+) failures?), (\d+) skipped./) @@ -1054,6 +1061,8 @@ sub _GetLineKey($) or $Line =~ s/^(Unhandled exception: .* code) (0x[0-9a-fA-F]{8,16}).$/$1/ # or the process id in Wine's exc_filter() lines or $Line =~ s/^[0-9a-f]+:([_a-z0-9]+: unhandled exception [0-9a-fA-F]{8} at )[0-9a-fA-F]{8,16}$/$1/ + # or child process id + or $Line =~ s/^([_.a-z0-9]+:)\d+:( unhandled exception [0-9a-fA-F]{8} in child process )[0-9a-fA-F]{4}$/$1$2/
# The exact amount of data printed does not change the error or $Line =~ s/^([_.a-z0-9-]+:[_a-z0-9]* prints too much data )(\d+ bytes)$/$1/;
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=67265
Your paranoid android.
=== w1064v1809_ja (32 bit report) ===
kernel32: pipe.c:1372: Test failed: connecting to pipe
=== w864 (32 bit report) ===
rpcrt4: server.c:2127: Test failed: RpcBindingFree
=== w1064v1507 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809 (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_2scr (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_ar (32 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_he (32 bit report) ===
user32: cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1809_zh_CN (32 bit report) ===
user32: cursoricon.c:2366: Test failed: wrong info cursor 000203C7/00010003 cursoricon.c:2509: Test failed: cursor not shown in info
=== w1064v1507 (64 bit report) ===
user32: cursoricon.c:2420: Test failed: cursor not shown in info cursoricon.c:2444: Test failed: cursor not shown in info cursoricon.c:2497: Test failed: cursor not shown in info cursoricon.c:2509: Test failed: cursor not shown in info
=== w8 (32 bit report) ===
user32: msg.c:14677: Test failed: unexpected message 31f msg.c:14678: Test failed: bad wparam 1 msg.c:14684: Test failed: unicode WM_CHAR: 0: the msg sequence is not complete: expected 0102 - actual 0000
=== w1064v1809_he (32 bit report) ===
user32: msg.c:17796: Test failed: Restore minimized window: 0: the msg 0x0005 was expected, but got msg 0x0024 instead
=== w1064v1809 (32 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 0003004C win.c:3170: Test failed: GetFocus() = 00000000 win.c:3182: Test failed: GetFocus() = 00000000 win.c:3185: Test failed: GetFocus() = 00000000 win.c:3188: Test failed: GetFocus() = 00000000 win.c:3191: Test failed: GetActiveWindow() = 0003004C win.c:3195: Test failed: GetFocus() = 00000000 win.c:3198: Test failed: GetFocus() = 00000000 win.c:3892: Test failed: hwnd 00030174/004A0048 message 0737 win.c:3897: Test failed: hwnd 004A0048/004A0048 message 0202 win.c:3902: Test failed: hwnd 004A0048/004A0048 message 0203 win.c:3906: Test failed: message 0202 available
=== w1064v1809_2scr (32 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 000301CA win.c:3170: Test failed: GetFocus() = 00000000 win.c:3182: Test failed: GetFocus() = 00000000 win.c:3185: Test failed: GetFocus() = 00000000 win.c:3188: Test failed: GetFocus() = 00000000 win.c:3191: Test failed: GetActiveWindow() = 000301CA win.c:3195: Test failed: GetFocus() = 00000000 win.c:3198: Test failed: GetFocus() = 00000000 win.c:3892: Test failed: hwnd 000300E2/001F01A2 message 0737 win.c:3897: Test failed: hwnd 001F01A2/001F01A2 message 0202 win.c:3902: Test failed: hwnd 001F01A2/001F01A2 message 0203 win.c:3906: Test failed: message 0202 available win.c:3918: Test failed: hwnd 000301CA/000301CA message 0200 win.c:3922: Test failed: hwnd 000301CA/000301CA message 0201 win.c:3931: Test failed: hwnd 001F01A2/001F01A2 message 0202 win.c:3934: Test failed: hwnd 001F01A2/001F01A2 message 0201
=== w1064v1809_ja (32 bit report) ===
user32: win.c:3727: Test failed: message 0738 available win.c:3852: Test failed: hwnd 000202FE message 7fff win.c:3931: Test failed: hwnd 000202FE/000202DA message 7fff win.c:3934: Test failed: hwnd 000202FE/000202DA message 7fff
=== w1064v1809_zh_CN (32 bit report) ===
user32: win.c:3852: Test failed: hwnd 00010382 message 0282 win.c:3931: Test failed: hwnd 00010382/001E03CC message 0282 win.c:3934: Test failed: hwnd 00010382/001E03CC message 0282
=== w1064v1809 (64 bit report) ===
user32: win.c:3167: Test failed: GetActiveWindow() = 0000000000030296 win.c:3170: Test failed: GetFocus() = 0000000000000000 win.c:3182: Test failed: GetFocus() = 0000000000000000 win.c:3185: Test failed: GetFocus() = 0000000000000000 win.c:3188: Test failed: GetFocus() = 0000000000000000 win.c:3191: Test failed: GetActiveWindow() = 0000000000030296 win.c:3195: Test failed: GetFocus() = 0000000000000000 win.c:3198: Test failed: GetFocus() = 0000000000000000 win.c:3892: Test failed: hwnd 00000000000200E4/00000000000F02CA message 0737 win.c:3897: Test failed: hwnd 00000000000F02CA/00000000000F02CA message 0202 win.c:3902: Test failed: hwnd 00000000000F02CA/00000000000F02CA message 0203 win.c:3906: Test failed: message 0202 available
=== debiant (32 bit report) ===
mfplat: Unhandled exception: page fault on execute access to 0x0476840f in 32-bit code (0x0476840f).
=== debiant (32 bit Chinese:China report) ===
user32: msg.c:14580: Test failed: bad time 926a1b
On Mon, Mar 16, 2020 at 6:52 PM Francois Gouget fgouget@codeweavers.com wrote:
diff --git a/include/wine/test.h b/include/wine/test.h index 3af3ffd2a91..1bf178339fd 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -110,12 +110,14 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT # 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 +# define wait_process_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_wait_process
This should be wait_child_process_ and winetest_wait_child_process here right?
On Wed, 18 Mar 2020, Mathew Hodson wrote:
On Mon, Mar 16, 2020 at 6:52 PM Francois Gouget fgouget@codeweavers.com wrote:
diff --git a/include/wine/test.h b/include/wine/test.h index 3af3ffd2a91..1bf178339fd 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -110,12 +110,14 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) __WINE_PRINT # 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 +# define wait_process_(file, line) (winetest_set_location(file, 0), 0) ? (void)0 : winetest_wait_process
This should be wait_child_process_ and winetest_wait_child_process here right?
Thanks for spotting it. Sending a patch...