Re: Allow running conformance tests in parallel

2008-07-14 Thread Dan Kegel
On Sun, Jul 13, 2008 at 9:59 PM, Scott Ritchie [EMAIL PROTECTED] wrote:
 About the same number of tests fail regardless of -j value.

 About -- shouldn't it be exactly?

Yes, but our tests are flaky.




Allow running conformance tests in parallel

2008-07-13 Thread Dan Kegel
The attached patch lets you run Wine's conformance tests in parallel.

On my relatively fast dual core machine (e7200):
make -k test takes 3 minutes 55 seconds
make -k -j2 test takes 2 minutes 15 seconds
make -k -j4 test takes 1 minute 45 seconds
make -k -j10 test takes 1 minute 27 seconds

About the same number of tests fail regardless of -j value.

How it works:
this patch adds a new function, winetest_exclusive(),
that waits until it can acquire an exclusive lock.
It should be called near the top of the START_TEST body
for any test that needs exclusive access to the
system.  (In tests that exec themselves, the call has to
be placed carefully to avoid having the child call it.)
I did this for all tests that call CreateWindow, and
a few more that seemed like they might need it.

The list of tests marked exclusive is somewhat rough;
probably a few tests should be added or removed,
but it's pretty good for a first cut.

I've been wanting to do this for ages.  Turned out to be easier than I'd feared.
diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c
index eca7ca4..7fe0874 100644
--- a/dlls/comctl32/tests/comboex.c
+++ b/dlls/comctl32/tests/comboex.c
@@ -339,6 +339,8 @@ static void cleanup(void)
 
 START_TEST(comboex)
 {
+winetest_exclusive();
+
 if (!init())
 return;
 
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index b194cc1..5bff228 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -579,6 +579,8 @@ START_TEST(datetime)
 BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
 INITCOMMONCONTROLSEX iccex;
 
+winetest_exclusive();
+
 hComctl32 = GetModuleHandleA(comctl32.dll);
 pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, InitCommonControlsEx);
 if (!pInitCommonControlsEx)
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index a3778cf..c62dca2 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -1524,6 +1524,8 @@ START_TEST(header)
 {
 HWND parent_hwnd;
 
+winetest_exclusive();
+
 if (!init())
 return;
 
diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c
index 0d1770b..76600ec 100644
--- a/dlls/comctl32/tests/imagelist.c
+++ b/dlls/comctl32/tests/imagelist.c
@@ -976,6 +976,9 @@ static void test_imagelist_storage(void)
 START_TEST(imagelist)
 {
 HMODULE hComCtl32 = GetModuleHandle(comctl32.dll);
+
+winetest_exclusive();
+
 pImageList_DrawIndirect = (void*)GetProcAddress(hComCtl32, ImageList_DrawIndirect);
 pImageList_SetImageCount = (void*)GetProcAddress(hComCtl32, ImageList_SetImageCount);
 
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 4f8b32d..8069835 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1216,6 +1216,8 @@ START_TEST(listview)
 HMODULE hComctl32;
 BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
 
+winetest_exclusive();
+
 hComctl32 = GetModuleHandleA(comctl32.dll);
 pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, InitCommonControlsEx);
 if (pInitCommonControlsEx)
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index cd9592d..bd167f2 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -1114,6 +1114,8 @@ START_TEST(monthcal)
 INITCOMMONCONTROLSEX iccex;
 HWND hwnd, parent_wnd;
 
+winetest_exclusive();
+
 hComctl32 = GetModuleHandleA(comctl32.dll);
 pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, InitCommonControlsEx);
 if (!pInitCommonControlsEx)
diff --git a/dlls/comctl32/tests/msg.c b/dlls/comctl32/tests/msg.c
index 2129f22..b1fe203 100644
--- a/dlls/comctl32/tests/msg.c
+++ b/dlls/comctl32/tests/msg.c
@@ -248,4 +248,5 @@ void init_msg_sequences(struct msg_sequence **seq, int n)
 
 START_TEST(msg)
 {
+winetest_exclusive();
 }
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c
index 10bbbef..bf9a455 100644
--- a/dlls/comctl32/tests/progress.c
+++ b/dlls/comctl32/tests/progress.c
@@ -222,6 +222,8 @@ static void test_redraw(void)
 
 START_TEST(progress)
 {
+winetest_exclusive();
+
 init();
 
 test_redraw();
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
index 45c8d97..1f7b612 100644
--- a/dlls/comctl32/tests/propsheet.c
+++ b/dlls/comctl32/tests/propsheet.c
@@ -201,6 +201,8 @@ static void test_disableowner(void)
 
 START_TEST(propsheet)
 {
+winetest_exclusive();
+
 test_title();
 test_nopage();
 test_disableowner();
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index e5bea38..fdb18d3 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -835,6 +835,8 @@ START_TEST(rebar)
 MSG msg;
 RECT rc;
 
+winetest_exclusive();
+
 /* LoadLibrary is needed. This file has 

Re: Allow running conformance tests in parallel

2008-07-13 Thread Scott Ritchie
Dan Kegel wrote:
 About the same number of tests fail regardless of -j value.
 
 How it works:
 this patch adds a new function, winetest_exclusive(),
 that waits until it can acquire an exclusive lock.
 It should be called near the top of the START_TEST body
 for any test that needs exclusive access to the
 system.  (In tests that exec themselves, the call has to
 be placed carefully to avoid having the child call it.)
 I did this for all tests that call CreateWindow, and
 a few more that seemed like they might need it.
 
 The list of tests marked exclusive is somewhat rough;
 probably a few tests should be added or removed,
 but it's pretty good for a first cut.
 
About -- shouldn't it be exactly?  Unless tests are sometimes supposed
fail inconsistently, then you probably need it on every one that behaves
differently.

Thanks,
Scott Ritchie