Success in todo depending on the Wine platform

Francois Gouget fgouget at free.fr
Sun Feb 21 05:35:49 CST 2016


On Tue, 16 Feb 2016, Francois Gouget wrote:

> 
> What should we do if a test succeeds in a todo_wine on Mac but fails on 
> Linux, FreeBSD and Solaris.
> 
> Specifically I'm thinking about the ntdll:info test:
>     /* Check if we have some return values */
>     trace("WorkingSetSize : %ld\n", pvi.WorkingSetSize);
>     todo_wine
>         ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n");
[...]
> But do we have other solutions? I initially thought setting 
> WINETEST_PLATFORM to Linux, FreeBSD, etc. could do the trick.

To be clear, I don't think we should adjust the todos for every missing 
library, graphics card version, etc. The tests should already deal with 
variations in the graphics cards behavior.

So I think this should really just be about actually being able to use 
winetest_platform to have a check to be a todo on just Linux or in this 
case non-Darwin. Here's a proposed patch (the test.h part should go in 
regardless):

diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index be355fb..b81d78d 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1062,7 +1062,7 @@ static void test_query_process_vm(void)
 
     /* Check if we have some return values */
     trace("WorkingSetSize : %ld\n", pvi.WorkingSetSize);
-    todo_wine
+    todo_wine_if(strcmp(winetest_platform, "Darwin"))
     {
         ok( pvi.WorkingSetSize > 0, "Expected a WorkingSetSize > 0\n");
     }
diff --git a/include/wine/test.h b/include/wine/test.h
index 0d81a24..eddfd13 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -121,8 +121,8 @@ extern void __winetest_cdecl winetest_trace( const char *msg, ... ) WINETEST_PRI
 #define todo_if(is_todo) for (winetest_start_todo(is_todo); \
                               winetest_loop_todo(); \
                               winetest_end_todo())
-#define todo_wine               todo_if(!strcmp(winetest_platform, "wine"))
-#define todo_wine_if(is_todo)   todo_if((is_todo) && !strcmp(winetest_platform, "wine"))
+#define todo_wine               todo_if(strcmp(winetest_platform, "windows"))
+#define todo_wine_if(is_todo)   todo_if((is_todo) && strcmp(winetest_platform, "windows"))
 
 
 #ifdef NONAMELESSUNION
diff --git a/tools/runtest b/tools/runtest
index 79bd2f7..6863f9d 100755
--- a/tools/runtest
+++ b/tools/runtest
@@ -137,6 +137,7 @@ if [ -n "$modules" ]; then
     WINEDLLOVERRIDES="$WINEDLLOVERRIDES;$modules=b"
     export WINEDLLOVERRIDES
 fi
+[ -z "$platform" ] || platform=`uname -s`
 WINETEST_PLATFORM=${platform:-wine}
 export WINETEST_PLATFORM WINETEST_DEBUG
 


If that's still deemed too complex we could also have the policy that a 
test that succeeds on any Wine platform should not be a todo on any Wine 
platform.


-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
     We are Pentium of Borg. You will be approximated. Division is futile.



More information about the wine-devel mailing list