=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: tests: Explicitly detect if tests are run under Wine.

Alexandre Julliard julliard at winehq.org
Thu Dec 14 08:03:45 CST 2017


Module: vkd3d
Branch: master
Commit: a285b4c842aeb7b2b666e3c763083ef105c4b786
URL:    http://source.winehq.org/git/vkd3d.git/?a=commit;h=a285b4c842aeb7b2b666e3c763083ef105c4b786

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Dec 14 11:45:58 2017 +0100

tests: Explicitly detect if tests are run under Wine.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 include/private/vkd3d_test.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/private/vkd3d_test.h b/include/private/vkd3d_test.h
index f4a1627..888436a 100644
--- a/include/private/vkd3d_test.h
+++ b/include/private/vkd3d_test.h
@@ -237,6 +237,12 @@ static char *vkd3d_test_strdupWtoA(WCHAR *str)
     return out;
 }
 
+static bool running_under_wine(void)
+{
+    HMODULE module = GetModuleHandleA("ntdll.dll");
+    return module && GetProcAddress(module, "wine_server_call");
+}
+
 int wmain(int argc, WCHAR **wargv)
 {
     char **argv;
@@ -251,7 +257,7 @@ int wmain(int argc, WCHAR **wargv)
     }
     assert(i == argc);
 
-    vkd3d_test_platform = "windows";
+    vkd3d_test_platform = running_under_wine() ? "wine" : "windows";
 
     ret = main(argc, argv);
 




More information about the wine-cvs mailing list