diff options
author | aavit <qt-info@nokia.com> | 2010-10-18 13:37:59 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-10-18 13:37:59 (GMT) |
commit | e7f0288bd9a57c25a7e482f4b058769d7147270a (patch) | |
tree | e47e93fce72f7a303732ff2a5b8e4bb060edb080 /tests/arthur | |
parent | 5c92ff774eadca40e6f33b5e096df01ecc5da717 (diff) | |
download | Qt-e7f0288bd9a57c25a7e482f4b058769d7147270a.zip Qt-e7f0288bd9a57c25a7e482f4b058769d7147270a.tar.gz Qt-e7f0288bd9a57c25a7e482f4b058769d7147270a.tar.bz2 |
Add OS and git data to PlatformInfo
Diffstat (limited to 'tests/arthur')
-rw-r--r-- | tests/arthur/baselineserver/src/baselineserver.cpp | 26 | ||||
-rw-r--r-- | tests/arthur/baselineserver/src/htmlpage.cpp | 8 | ||||
-rw-r--r-- | tests/arthur/common/baselineprotocol.cpp | 38 | ||||
-rw-r--r-- | tests/arthur/common/baselineprotocol.h | 11 |
4 files changed, 58 insertions, 25 deletions
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 072e216..86554fd 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -105,8 +105,10 @@ void BaselineHandler::receiveRequest() return; } connectionEstablished = true; - qDebug() << runId << logtime() << "Connection established with" << plat.hostname << proto.socket.peerAddress().toString() << "Qt version:" << plat.qtVersion << plat.buildKey; - return; + 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; } QByteArray block; @@ -140,7 +142,7 @@ void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock) QDataStream ds(itemListBlock); ds >> itemList; qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() << "items, engine" - << itemList.at(0).engineAsString() << "pixel format" << itemList.at(0).formatAsString(); + << itemList.at(0).engineAsString() << "pixel format" << itemList.at(0).formatAsString(); for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { i->imageChecksums.clear(); @@ -240,7 +242,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.hostName.section(QLC('.'), 0, 0); // Filter away domain, if any if (host.isEmpty() || host == QLS("localhost")) { host = proto.socket.peerAddress().toString(); if (host.isEmpty()) @@ -379,13 +381,13 @@ void BaselineHandler::testPathMapping() QStringList hosts; hosts << QLS("bq-ubuntu910-x86-01") - << QLS("bq-ubuntu910-x86-15") - << QLS("osl-mac-master-5.test.qt.nokia.com") - << QLS("osl-mac-master-6.test.qt.nokia.com") - << QLS("sv-xp-vs-010") - << QLS("sv-xp-vs-011") - << QLS("chimera") - << QLS("localhost"); + << QLS("bq-ubuntu910-x86-15") + << QLS("osl-mac-master-5.test.qt.nokia.com") + << QLS("osl-mac-master-6.test.qt.nokia.com") + << QLS("sv-xp-vs-010") + << QLS("sv-xp-vs-011") + << QLS("chimera") + << QLS("localhost"); ImageItem item; item.scriptName = QLS("arcs.qps"); @@ -398,7 +400,7 @@ void BaselineHandler::testPathMapping() plat.buildKey = QLS("(nobuildkey)"); foreach(const QString& host, hosts) { pathForRun = QString(); - plat.hostname = host; + plat.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/htmlpage.cpp b/tests/arthur/baselineserver/src/htmlpage.cpp index 7759c8e..14bcb0c 100644 --- a/tests/arthur/baselineserver/src/htmlpage.cpp +++ b/tests/arthur/baselineserver/src/htmlpage.cpp @@ -48,12 +48,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 << "</h3>\n"; + out << "<h3>Host: " << plat.hostName << "</h3>\n"; out << "<h3>Qt version: " << plat.qtVersion << "</h3>\n"; out << "<h3>Build key: " << plat.buildKey << "</h3>\n"; out << "<h3>Engine: " << item.engineAsString() << "</h3>\n"; out << "<h3>Format: " << item.formatAsString() << "</h3>\n\n"; - out << "<h3><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&id="<< id << "&host=" << plat.hostname + out << "<h3><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&id="<< id << "&host=" << plat.hostName << "&engine=" << item.engineAsString() << "&format=" << item.formatAsString() << "&url=" << pageUrl << "\">Update all baselines</a><br>"; @@ -91,7 +91,7 @@ void HTMLPage::addItem(const QString &baseline, const QString &rendered, const I out << "<td><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&oldBaseline=" << baseline << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Update baseline</a><br>" "<a href=\"/cgi-bin/server.cgi?cmd=blacklist&scriptName=" << item.scriptName - << "&host=" << plat.hostname << "&engine=" << item.engineAsString() + << "&host=" << plat.hostName << "&engine=" << item.engineAsString() << "&format=" << item.formatAsString() << "&url=" << pageUrl << "\">Blacklist test</a></td>\n"; out << "<tr>\n\n"; @@ -117,7 +117,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.hostName << "&engine=" << imageItems.at(i).engineAsString() << "&format=" << imageItems.at(i).formatAsString() << "&url=" << pageUrl diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp index 697ce58..78c80f1 100644 --- a/tests/arthur/common/baselineprotocol.cpp +++ b/tests/arthur/common/baselineprotocol.cpp @@ -3,25 +3,53 @@ #include <QImage> #include <QBuffer> #include <QHostInfo> +#include <QSysInfo> +#include <QProcess> PlatformInfo::PlatformInfo(bool useLocal) { if (useLocal) { buildKey = QLibraryInfo::buildKey(); qtVersion = QLatin1String(qVersion()); - hostname = QHostInfo::localHostName(); + hostName = QHostInfo::localHostName(); + osVersion = -1; +#if defined(Q_OS_LINUX) + osName = QLatin1String("Linux"); +#elif defined(Q_OS_WINCE) + osName = QLatin1String("WinCE"); + osVersion = QSysInfo::windowsVersion(); +#elif defined(Q_OS_WIN) + osName = QLatin1String("Windows"); + osVersion = QSysInfo::windowsVersion(); +#elif defined(Q_OS_MAC) + osName = QLatin1String("MacOS"); + osVersion = qMacVersion(); +#elif defined(Q_OS_SYMBIAN) + osName = QLatin1String("Symbian"); + osVersion = QSysInfo::symbianVersion(); +#else + osName = QLatin1String("Other"); +#endif + + QProcess git; + git.start(QLS("git"), QStringList() << QLS("log") << QLS("--max-count=1") << QLS("--pretty=%H")); + git.waitForFinished(3000); + if (!git.exitCode()) + gitCommit = QString::fromLocal8Bit(git.readAllStandardOutput().constData()).trimmed(); + else + gitCommit = QLS("Unknown"); } } -QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pinfo) +QDataStream & operator<< (QDataStream &stream, const PlatformInfo &p) { - stream << pinfo.buildKey << pinfo.qtVersion << pinfo.hostname; + stream << p.hostName << p.osName << p.osVersion << p.qtVersion << p.buildKey << p.gitCommit; return stream; } -QDataStream & operator>> (QDataStream& stream, PlatformInfo& pinfo) +QDataStream & operator>> (QDataStream& stream, PlatformInfo& p) { - stream >> pinfo.buildKey >> pinfo.qtVersion >> pinfo.hostname; + stream >> p.hostName >> p.osName >> p.osVersion >> p.qtVersion >> p.buildKey >> p.gitCommit; return stream; } diff --git a/tests/arthur/common/baselineprotocol.h b/tests/arthur/common/baselineprotocol.h index 6af4f22..42f9729 100644 --- a/tests/arthur/common/baselineprotocol.h +++ b/tests/arthur/common/baselineprotocol.h @@ -15,12 +15,15 @@ struct PlatformInfo { PlatformInfo(bool useLocal = false); - QString buildKey; + QString hostName; + QString osName; + int osVersion; QString qtVersion; - QString hostname; + QString buildKey; + QString gitCommit; }; -QDataStream & operator<< (QDataStream &stream, const PlatformInfo &pinfo); -QDataStream & operator>> (QDataStream& stream, PlatformInfo& pinfo); +QDataStream & operator<< (QDataStream &stream, const PlatformInfo &p); +QDataStream & operator>> (QDataStream& stream, PlatformInfo& p); struct ImageItem { |