This class is a Process, so it's a drop-in replacement for the current
Environment, but it provides a few methods to talk to the server being
started.
SetDisplayNumber() is called, but currently unused by the server.
Signed-off-by: Peter Hutterer <[email protected]>
---
Changes to v1:
- squashed a few minor patches in so this class is a bit more complete out
of the box.
configure.ac | 2 +-
include/Makefile.am | 1 +
include/xorg/gtest/xorg-gtest-xserver.h | 126 ++++++++++++++++++++
include/xorg/gtest/xorg-gtest.h | 1 +
src/Makefile.am | 1 +
src/environment.cpp | 22 ++--
src/xorg-gtest-all.cpp | 1 +
src/xserver.cpp | 196 +++++++++++++++++++++++++++++++
8 files changed, 339 insertions(+), 11 deletions(-)
create mode 100644 include/xorg/gtest/xorg-gtest-xserver.h
create mode 100644 src/xserver.cpp
diff --git a/configure.ac b/configure.ac
index ea29c50..d9b3072 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ XORG_DEFAULT_OPTIONS
XORG_ENABLE_INTEGRATION_TESTS([yes])
XORG_WITH_DOXYGEN
-PKG_CHECK_MODULES(X11, x11)
+PKG_CHECK_MODULES(X11, x11 xi)
# Check for Google Test
CHECK_GTEST
diff --git a/include/Makefile.am b/include/Makefile.am
index 9ff5f2a..4a6ce03 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -34,6 +34,7 @@ nobase_include_HEADERS = \
xorg/gtest/xorg-gtest-environment.h \
xorg/gtest/xorg-gtest-process.h \
xorg/gtest/xorg-gtest-test.h \
+ xorg/gtest/xorg-gtest-xserver.h \
xorg/gtest/evemu/xorg-gtest-device.h \
xorg/gtest/xorg-gtest.h \
$(compat_headers)
diff --git a/include/xorg/gtest/xorg-gtest-xserver.h
b/include/xorg/gtest/xorg-gtest-xserver.h
new file mode 100644
index 0000000..56dacf6
--- /dev/null
+++ b/include/xorg/gtest/xorg-gtest-xserver.h
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ *
+ * X testing environment - Google Test helper class to communicate with the
+ * server
+ *
+ * Copyright (C) 2012 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
+ * SOFTWARE.
+ *
+
******************************************************************************/
+
+
+#ifndef XORG_GTEST_XSERVER_H
+#define XORG_GTEST_XSERVER_H
+
+#include <gtest/gtest.h>
+#include <xorg/gtest/xorg-gtest.h>
+#include <X11/Xlib.h>
+
+namespace xorg {
+namespace testing {
+
+/**
+ * @class XServer xorg-gtest-xserver.h xorg/gtest/xorg-gtest-xserver.h