summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-06-28 11:05:32 +1000
committerChase Douglas <chase.douglas@canonical.com>2012-07-20 14:28:22 -0700
commit04d9fd136c2651bef05bc815187b0b53940f848b (patch)
tree59afa0d68ca96953304697842962a09a5daf5ca1 /include
parentcf9c6a9f588390869f278e5620ec40bfa2859d6a (diff)
xserver: move Terminate and Kill handling here
Same behaviour as Process, but with some more error messages Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/xorg/gtest/xorg-gtest-process.h4
-rw-r--r--include/xorg/gtest/xorg-gtest-xserver.h25
2 files changed, 27 insertions, 2 deletions
diff --git a/include/xorg/gtest/xorg-gtest-process.h b/include/xorg/gtest/xorg-gtest-process.h
index ca853d4..402be49 100644
--- a/include/xorg/gtest/xorg-gtest-process.h
+++ b/include/xorg/gtest/xorg-gtest-process.h
@@ -152,7 +152,7 @@ class Process {
* @post If successful: Child process terminated.
* @post If successful: Subsequent calls to Pid() return -1.
*/
- bool Terminate(unsigned int timeout = 0);
+ virtual bool Terminate(unsigned int timeout = 0);
/**
* Kills (SIGKILL) this child process and waits a given timeout for the
@@ -170,7 +170,7 @@ class Process {
* @post If successful: Child process killed.
* @post If successful: Subsequent calls to Pid() return -1.
*/
- bool Kill(unsigned int timeout = 0);
+ virtual bool Kill(unsigned int timeout = 0);
/**
* Accesses the pid of the child process.
diff --git a/include/xorg/gtest/xorg-gtest-xserver.h b/include/xorg/gtest/xorg-gtest-xserver.h
index 81c9f74..4a778c6 100644
--- a/include/xorg/gtest/xorg-gtest-xserver.h
+++ b/include/xorg/gtest/xorg-gtest-xserver.h
@@ -55,6 +55,31 @@ class XServer : public xorg::testing::Process {
void Start(const std::string &program = "");
/**
+ * Terminates this server process. Will signal the server to terminate
+ * multiple times before giving up.
+ *
+ * @param [in] timeout The timeout in millis to wait for the process to
+ * terminate. A timeout of 0 implies not to wait but
+ * return immediately.
+ *
+ * @returns true if termination succeeded and, if a timout is given, the
+ * process shut down within that timeout. false otherwise.
+ */
+ virtual bool Terminate(unsigned int timeout = 0);
+
+ /**
+ * Kills the server. With a vengeance.
+ *
+ * @param [in] timeout The timeout in millis to wait for the process to
+ * terminate. A timeout of 0 implies not to wait but
+ * return immediately.
+ *
+ * @returns true if kill succeeded and, if a timout is given, the
+ * process shut down within that timeout. false otherwise.
+ */
+ virtual bool Kill(unsigned int timeout = 0);
+
+ /**
* Waits until this server is ready to take connections.
*/
void WaitForConnections(void);