diff options
Diffstat (limited to 'xorg-server/test')
-rw-r--r-- | xorg-server/test/xi2/protocol-common.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c index 9a429e49f..9265ba390 100644 --- a/xorg-server/test/xi2/protocol-common.c +++ b/xorg-server/test/xi2/protocol-common.c @@ -25,6 +25,7 @@ #include <dix-config.h> #endif +#include <errno.h> #include <stdint.h> #include "extinit.h" /* for XInputExtensionInit */ #include "exglobals.h" @@ -137,6 +138,18 @@ init_devices(void) { ClientRec client; struct devices local_devices; + int ret; + + /* + * Put a unique name in display pointer so that when tests are run in + * parallel, their xkbcomp outputs to /tmp/server-<display>.xkm don't + * stomp on each other. + */ +#ifdef HAVE_GETPROGNAME + display = getprogname(); +#elif HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME + display = program_invocation_short_name; +#endif client = init_client(0, NULL); @@ -145,15 +158,20 @@ init_devices(void) inputInfo.pointer = local_devices.vcp; inputInfo.keyboard = local_devices.vck; - ActivateDevice(local_devices.vcp, FALSE); - ActivateDevice(local_devices.vck, FALSE); + ret = ActivateDevice(local_devices.vcp, FALSE); + assert(ret == Success); + /* This may fail if xkbcomp fails or xkb-config is not found. */ + ret = ActivateDevice(local_devices.vck, FALSE); + assert(ret == Success); EnableDevice(local_devices.vcp, FALSE); EnableDevice(local_devices.vck, FALSE); AllocDevicePair(&client, "", &local_devices.mouse, &local_devices.kbd, TestPointerProc, CoreKeyboardProc, FALSE); - ActivateDevice(local_devices.mouse, FALSE); - ActivateDevice(local_devices.kbd, FALSE); + ret = ActivateDevice(local_devices.mouse, FALSE); + assert(ret == Success); + ret = ActivateDevice(local_devices.kbd, FALSE); + assert(ret == Success); EnableDevice(local_devices.mouse, FALSE); EnableDevice(local_devices.kbd, FALSE); |