diff options
author | aavit <qt-info@nokia.com> | 2010-11-05 14:33:41 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-11-05 14:33:41 (GMT) |
commit | 111270e240320831038a47f7f0848a4f429d25d7 (patch) | |
tree | cde116e26d097072c7743949ffc2fd50bfb73bad /tests/arthur/baselineserver/src | |
parent | a84181407f51cc855a6ddb2033a7aa6738354602 (diff) | |
download | Qt-111270e240320831038a47f7f0848a4f429d25d7.zip Qt-111270e240320831038a47f7f0848a4f429d25d7.tar.gz Qt-111270e240320831038a47f7f0848a4f429d25d7.tar.bz2 |
Add even more platform info, and make it expandable.
Diffstat (limited to 'tests/arthur/baselineserver/src')
-rw-r--r-- | tests/arthur/baselineserver/src/baselineserver.cpp | 29 | ||||
-rw-r--r-- | tests/arthur/baselineserver/src/baselineserver.h | 2 | ||||
-rw-r--r-- | tests/arthur/baselineserver/src/htmlpage.cpp | 11 | ||||
-rw-r--r-- | tests/arthur/baselineserver/src/main.cpp | 3 |
4 files changed, 27 insertions, 18 deletions
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index dd26a85..03d6499 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -133,24 +133,29 @@ BaselineHandler::BaselineHandler(int socketDescriptor) proto.socket.setSocketDescriptor(socketDescriptor); } -QString BaselineHandler::logtime() +const char *BaselineHandler::logtime() { - return QTime::currentTime().toString(QLS("mm:ss.zzz")); + return 0; + //return QTime::currentTime().toString(QLS("mm:ss.zzz")); } void BaselineHandler::receiveRequest() { if (!connectionEstablished) { if (!proto.acceptConnection(&plat)) { - qWarning() << runId << logtime() << "Accepting new connection failed. " << proto.errorMessage(); - QThread::currentThread()->exit(1); + qWarning() << runId << logtime() << "Accepting new connection from" << proto.socket.peerAddress().toString() << "failed." << proto.errorMessage(); + proto.socket.disconnectFromHost(); return; } connectionEstablished = true; - qDebug() << runId << logtime() << "Connection established with" << plat.hostName << "[" << proto.socket.peerAddress().toString() << "]" - << "OS:" << plat.osName << "[" << plat.osVersion << "]" << "Qt version:" << plat.qtVersion << "[" << plat.buildKey << "]" - << "git commit:" << plat.gitCommit; - return; + QString logMsg; + foreach (QString key, plat.keys()) { + if (key != PI_HostName && key != PI_HostAddress) + logMsg += key + QLS(": '") + plat.value(key) + QLS("', "); + } + qDebug() << runId << logtime() << "Connection established with" << plat.value(PI_HostName) + << "[" << qPrintable(plat.value(PI_HostAddress)) << "]" << logMsg; + return; } QByteArray block; @@ -284,7 +289,7 @@ QString BaselineHandler::itemSubPath(const QString &engine, const QString &forma QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, bool absolute) { if (pathForRun.isNull()) { - QString host = plat.hostName.section(QLC('.'), 0, 0); // Filter away domain, if any + QString host = plat.value(PI_HostName).section(QLC('.'), 0, 0); // Filter away domain, if any if (host.isEmpty() || host == QLS("localhost")) { host = proto.socket.peerAddress().toString(); if (host.isEmpty()) @@ -438,11 +443,11 @@ void BaselineHandler::testPathMapping() item.imageChecksums << 0x0123456789abcdefULL; item.scriptChecksum = 0x0123; - plat.qtVersion = QLS("4.8.0"); - plat.buildKey = QLS("(nobuildkey)"); + plat.insert(PI_QtVersion, QLS("4.8.0")); + plat.insert(PI_BuildKey, QLS("(nobuildkey)")); foreach(const QString& host, hosts) { pathForRun = QString(); - plat.hostName = host; + plat.insert(PI_HostName, host); qDebug() << "Baseline from" << host << "->" << pathForItem(item, true).remove(BaselineServer::storagePath()); qDebug() << "Mismatch from" << host << "->" << pathForItem(item, false).remove(BaselineServer::storagePath()); } diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h index bbebabb..e311527 100644 --- a/tests/arthur/baselineserver/src/baselineserver.h +++ b/tests/arthur/baselineserver/src/baselineserver.h @@ -116,7 +116,7 @@ private: void provideBaselineChecksums(const QByteArray &itemListBlock); void storeImage(const QByteArray &itemBlock, bool isBaseline); QString pathForItem(const ImageItem &item, bool isBaseline = true, bool absolute = true); - QString logtime(); + const char *logtime(); QString computeMismatchScore(const QImage& baseline, const QImage& rendered); QString engineForItem(const ImageItem &item); diff --git a/tests/arthur/baselineserver/src/htmlpage.cpp b/tests/arthur/baselineserver/src/htmlpage.cpp index 00d07f1..ad7f8b7 100644 --- a/tests/arthur/baselineserver/src/htmlpage.cpp +++ b/tests/arthur/baselineserver/src/htmlpage.cpp @@ -89,9 +89,12 @@ void HTMLPage::writeHeader(const ImageItem &item) out.setDevice(&file); out << "<html><body><h1>Lancelot results from run " << id << "</h1>\n\n"; - out << "<h3>Host: " << plat.hostName << " [" << address << "] OS: " << plat.osName << " [enum: " << plat.osVersion << "]</h3>\n"; - out << "<h3>Qt version: " << plat.qtVersion << " [commit: " << plat.gitCommit << "] Build key: \"" << plat.buildKey << "\"</h3>\n"; - out << "<h3>Engine: " << item.engineAsString() << " Format: " << item.formatAsString() << "</h3>\n\n"; + out << "<h3>Platform Info:</h3>\n"; + out << "<table>\n"; + foreach (QString key, plat.keys()) + out << "<tr><td>" << key << "</td><td>" << plat.value(key) << "</td></tr>\n"; + out << "</table>\n"; + #if 0 out << "<h3><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&id="<< id << "&host=" << plat.hostName << "&engine=" << item.engineAsString() << "&format=" << item.formatAsString() @@ -161,7 +164,7 @@ void HTMLPage::end() if (imageItems.at(i).status == ImageItem::IgnoreItem) { out << "<span style=\"background-color:yellow\">Blacklisted</span><br>" "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&scriptName=" - << imageItems.at(i).scriptName << "&host=" << plat.hostName + << imageItems.at(i).scriptName << "&host=" << plat.value(PI_HostName) << "&engine=" << imageItems.at(i).engineAsString() << "&format=" << imageItems.at(i).formatAsString() << "&url=" << pageUrl diff --git a/tests/arthur/baselineserver/src/main.cpp b/tests/arthur/baselineserver/src/main.cpp index dcddfdf..a5ec4db 100644 --- a/tests/arthur/baselineserver/src/main.cpp +++ b/tests/arthur/baselineserver/src/main.cpp @@ -64,6 +64,7 @@ int main(int argc, char *argv[]) return 1; } - qDebug() << "Listening for connections"; + qDebug() << "\n*****" << argv[0] << "started, ready to serve on port" << BaselineProtocol::ServerPort + << "with baseline protocol version" << BaselineProtocol::ProtocolVersion << "*****\n"; return a.exec(); } |