summaryrefslogtreecommitdiffstats
path: root/tests/arthur/baselineserver/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arthur/baselineserver/src/main.cpp')
-rw-r--r--tests/arthur/baselineserver/src/main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp
new file mode 100644
index 0000000..0e15a60
--- /dev/null
+++ b/tests/arthur/baselineserver/src/main.cpp
@@ -0,0 +1,29 @@
+#include <QtCore/QCoreApplication>
+#include "baselineserver.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QString queryString(qgetenv("QUERY_STRING"));
+ if (!queryString.isEmpty()) {
+ // run as CGI script
+ HTMLPage::handleCGIQuery(queryString);
+ return 0;
+ }
+
+ if (a.arguments().contains(QLatin1String("-testmapping"))) {
+ BaselineHandler h;
+ h.testPathMapping();
+ return 0;
+ }
+
+ BaselineServer server;
+ if (!server.listen(QHostAddress::Any, BaselineProtocol::ServerPort)) {
+ qWarning("Failed to listen!");
+ return 1;
+ }
+
+ qDebug() << "Listening for connections";
+ return a.exec();
+}