winetest: Flush the report file to disk between each test.

Francois Gouget fgouget at codeweavers.com
Wed Feb 8 07:12:07 CST 2017


Should Windows crash, this makes it easier to know which test is
responsible.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

I did some tests which confirmed both that this helps figure out which 
test caused a crash, and last that this has no impact on the WineTest 
run time.

 programs/winetest/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 1eb49b6a699..48b71c529c7 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -626,6 +626,10 @@ run_ex (char *cmd, HANDLE out_file, const char *tempdir, DWORD ms)
     PROCESS_INFORMATION pi;
     DWORD wait, status;
 
+    /* Flush to disk so we know which test caused Windows to crash if it does */
+    if (out_file)
+        FlushFileBuffers(out_file);
+
     GetStartupInfoA (&si);
     si.dwFlags    = STARTF_USESTDHANDLES;
     si.hStdInput  = GetStdHandle( STD_INPUT_HANDLE );
-- 
2.11.0




More information about the wine-patches mailing list