Added patch to automatically detect if tests are running under Wine.

This commit is contained in:
Sebastian Lackner 2014-11-23 22:52:20 +01:00
parent 3b946491da
commit 2741db55bd
3 changed files with 59 additions and 0 deletions

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ wine-compholio (1.7.32) UNRELEASED; urgency=low
* Added patch to avoid race-conditions of async WSARecv() operations with write watches.
* Added patch to fix issues with write watches when using Exagear.
* Added patch to avoid failure because of missing ptrace support for Exagear.
* Added patch to automatically detect if tests are running under Wine.
* Removed patch to close server fd is there is no space in thread inflight fd list (accepted upstream).
* Removed patch to fix bugs in StrStr functions (accepted upstream).
* Removed patches to avoid sending messages in FindWindowExW (accepted upstream).

View File

@ -43,6 +43,7 @@ PATCHLIST := \
gdiplus-GdipCreateRegionRgnData.ok \
imagehlp-BindImageEx.ok \
imm32-Cross_Thread_Access.ok \
include-Winetest.ok \
iphlpapi-TCP_Table.ok \
kernel32-GetFinalPathNameByHandle.ok \
kernel32-GetNumaProcessorNode.ok \
@ -551,6 +552,18 @@ imm32-Cross_Thread_Access.ok:
echo '+ { "Aric Stewart", "imm32: Limit cross thread access to ImmSet* functions.", 1 },'; \
) > imm32-Cross_Thread_Access.ok
# Patchset include-Winetest
# |
# | Modified files:
# | * include/wine/test.h
# |
.INTERMEDIATE: include-Winetest.ok
include-Winetest.ok:
$(call APPLY_FILE,include-Winetest/0001-include-Automatically-detect-if-tests-are-running-un.patch)
@( \
echo '+ { "Sebastian Lackner", "include: Automatically detect if tests are running under Wine when WINETEST_PLATFORM is not specified.", 1 },'; \
) > include-Winetest.ok
# Patchset iphlpapi-TCP_Table
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,45 @@
From dc6ade01aa4c28b675218453d7da818af1a6f827 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 23 Nov 2014 22:50:34 +0100
Subject: include: Automatically detect if tests are running under Wine when
WINETEST_PLATFORM is not specified.
---
include/wine/test.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/include/wine/test.h b/include/wine/test.h
index f8b608f..567229a 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -618,6 +618,14 @@ static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs )
return EXCEPTION_EXECUTE_HANDLER;
}
+/* check if we're running under wine */
+static BOOL running_under_wine(void)
+{
+ HMODULE module = GetModuleHandleA( "ntdll.dll" );
+ if (!module) return FALSE;
+ return (GetProcAddress( module, "wine_server_call" ) != NULL);
+}
+
#ifdef __GNUC__
void _fpreset(void) {} /* override the mingw fpu init code */
#endif
@@ -632,7 +640,11 @@ int main( int argc, char **argv )
winetest_argc = argc;
winetest_argv = argv;
- if (GetEnvironmentVariableA( "WINETEST_PLATFORM", p, sizeof(p) )) winetest_platform = strdup(p);
+ if (GetEnvironmentVariableA( "WINETEST_PLATFORM", p, sizeof(p) ))
+ winetest_platform = strdup(p);
+ else if (running_under_wine())
+ winetest_platform = "wine";
+
if (GetEnvironmentVariableA( "WINETEST_DEBUG", p, sizeof(p) )) winetest_debug = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_INTERACTIVE", p, sizeof(p) )) winetest_interactive = atoi(p);
if (GetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", p, sizeof(p) )) report_success = atoi(p);
--
2.1.3