summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-10-26 14:07:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-10-26 15:12:53 +1000
commit442ae2aeacd7424e4909630e57ca3eea86e8e49a (patch)
treef3ab3fdca8bafc4726785ad7539bd3e8d68b4b77
parent800a2a43c9c620e49147b29c6c4d08e6efb3d5ce (diff)
common: rip VideoDriverTest class's body out
Make it dependent on XITServer which does all the work for us. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--tests/common/Makefile.am1
-rw-r--r--tests/common/video-driver-test.cpp34
-rw-r--r--tests/common/video-driver-test.h53
3 files changed, 9 insertions, 79 deletions
diff --git a/tests/common/Makefile.am b/tests/common/Makefile.am
index cabf378..6be8689 100644
--- a/tests/common/Makefile.am
+++ b/tests/common/Makefile.am
@@ -33,5 +33,4 @@ common_sources = \
$(top_srcdir)/tests/common/helpers.h \
$(top_srcdir)/tests/common/device-interface.cpp \
$(top_srcdir)/tests/common/device-interface.h \
- $(top_srcdir)/tests/common/video-driver-test.cpp \
$(top_srcdir)/tests/common/video-driver-test.h
diff --git a/tests/common/video-driver-test.cpp b/tests/common/video-driver-test.cpp
deleted file mode 100644
index 33cb53a..0000000
--- a/tests/common/video-driver-test.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdexcept>
-#include <fstream>
-#include <xorg/gtest/xorg-gtest.h>
-
-#include "video-driver-test.h"
-#include "helpers.h"
-
-void VideoDriverTest::StartServer() {
- server.Start();
- xorg::testing::Test::SetDisplayString(server.GetDisplayString());
-
- ASSERT_NO_FATAL_FAILURE(xorg::testing::Test::SetUp());
-}
-
-void VideoDriverTest::SetUpConfigAndLog(const std::string& param) {
- InitDefaultLogFiles(server, &config);
-
- config.AddDefaultScreenWithDriver(param, param);
- config.WriteConfig();
-}
-
-void VideoDriverTest::SetUp() {
- SetUp("");
-}
-
-void VideoDriverTest::SetUp(const std::string &param) {
- SetUpEventListener();
- SetUpConfigAndLog(param);
- StartServer();
-}
-
diff --git a/tests/common/video-driver-test.h b/tests/common/video-driver-test.h
index e3db0aa..05bc07f 100644
--- a/tests/common/video-driver-test.h
+++ b/tests/common/video-driver-test.h
@@ -7,6 +7,7 @@
#include <xorg/gtest/xorg-gtest.h>
#include "xit-server-test.h"
+#include "helpers.h"
/**
* A test fixture for testing Video drivers. This class automates basic
@@ -16,45 +17,7 @@
* instead. For simple test cases, use SimpleVideoDriverTest.
*/
class VideoDriverTest : public XITServerTest {
-protected:
- /**
- * Set up the config and log file. The param is used for both the
- * config file ("param.conf") and the log file ("Xorg-param.log").
- * The default behavior of this function is to set up an xorg.conf with
- * a single input device, using the param as the driver name.
- *
- * This function is called from SetUp(), before the server is started.
- * Tests that need a different configuration but the same general
- * behavior can override SetUpConfigAndLog() only and leave the rest of
- * the behaviour intact.
- *
- * @param param The param used as prefix for the config file and the log file and as input driver.
- */
- virtual void SetUpConfigAndLog(const std::string& param = "");
-
- /**
- * Starts the server and waits for connections. Once completed,
- * xorg::testing::Test::Display() will be set to the server's display
- * and that display will have registered for XI2.
- */
- virtual void StartServer();
-
- /**
- * Default googletest entry point for setup-work during test fixtures.
- * This implementation simply calls SetUp() with an empty string.
- */
- virtual void SetUp();
-
- /**
- * Sets up an event listener to watch for test failures and calls
- * SetUpConfigAndLog() for initalisation of the server config. Finally,
- * starts the server.
- *
- * Most test fixtures will not need any extra other than initializing a
- * device and then calling SetUp().
- */
- virtual void SetUp(const std::string &param);
-
+ /* implementation is obsolete with XITServerTest */
};
/**
@@ -65,11 +28,13 @@ protected:
class SimpleVideoDriverTest : public VideoDriverTest,
public ::testing::WithParamInterface<std::string> {
public:
- /**
- * Calls InputDriverTest::SetUp() with a parameter value of GetParam().
- */
- virtual void SetUp() {
- VideoDriverTest::SetUp(GetParam());
+ virtual void SetUpConfigAndLog() {
+ InitDefaultLogFiles(server, &config);
+
+ std::string driver = GetParam();
+
+ config.AddDefaultScreenWithDriver(driver, driver);
+ config.WriteConfig();
}
};