diff options
author | aavit <qt-info@nokia.com> | 2010-12-08 14:35:54 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-12-08 14:35:54 (GMT) |
commit | d21eee4fb39ee8378bb87187cec5e46275dc31ed (patch) | |
tree | baf380d2e6c34922e7c0e83527c42fe619f7839d /tests/arthur/baselineserver/src | |
parent | 993f9b23d72ec74453163413403d0cf06d9f08f4 (diff) | |
download | Qt-d21eee4fb39ee8378bb87187cec5e46275dc31ed.zip Qt-d21eee4fb39ee8378bb87187cec5e46275dc31ed.tar.gz Qt-d21eee4fb39ee8378bb87187cec5e46275dc31ed.tar.bz2 |
Make protocol less lancelot-specific, prepare use in other testcases
Diffstat (limited to 'tests/arthur/baselineserver/src')
-rw-r--r-- | tests/arthur/baselineserver/src/baselineserver.cpp | 30 | ||||
-rw-r--r-- | tests/arthur/baselineserver/src/htmlpage.cpp | 15 |
2 files changed, 22 insertions, 23 deletions
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 53e40b6..90eb594 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -208,8 +208,8 @@ void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock) ImageItemList itemList; 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(); + qDebug() << runId << logtime() << "Received request for checksums for" << itemList.count() + << "items in test function" << itemList.at(0).testFunction; for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { i->imageChecksums.clear(); @@ -232,10 +232,10 @@ void BaselineHandler::provideBaselineChecksums(const QByteArray &itemListBlock) if (file.open(QIODevice::ReadOnly)) { QTextStream in(&file); do { - QString scriptName = in.readLine(); - if (!scriptName.isNull()) { + QString itemName = in.readLine(); + if (!itemName.isNull()) { for (ImageItemList::iterator i = itemList.begin(); i != itemList.end(); ++i) { - if (i->scriptName == scriptName) + if (i->itemName == itemName) i->status = ImageItem::IgnoreItem; } } @@ -258,7 +258,7 @@ void BaselineHandler::storeImage(const QByteArray &itemBlock, bool isBaseline) ds >> item; QString prefix = pathForItem(item, isBaseline); - qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.scriptName << "Storing in" << prefix; + qDebug() << runId << logtime() << "Received" << (isBaseline ? "baseline" : "mismatched") << "image for:" << item.itemName << "Storing in" << prefix; QString dir = prefix.section(QLC('/'), 0, -2); QDir cwd; @@ -333,17 +333,17 @@ QString BaselineHandler::pathForItem(const ImageItem &item, bool isBaseline, boo if (mapped.isEmpty()) mapPlatformInfo(); - QString itemName = item.scriptName; - if (itemName.contains(QLC('.'))) - itemName.replace(itemName.lastIndexOf(QLC('.')), 1, QLC('_')); + QString itemName = item.itemName; + itemName.replace(QLC('.'), QLC('_')); itemName.append(QLC('_')); - itemName.append(QString::number(item.scriptChecksum, 16).rightJustified(4, QLC('0'))); + itemName.append(QString::number(item.itemChecksum, 16).rightJustified(4, QLC('0'))); QStringList path; if (absolute) path += BaselineServer::storagePath(); + path += mapped.value(PI_TestCase); path += QLS(isBaseline ? "baselines" : "mismatches"); - path += item.engineAsString() + QLC('_') + item.formatAsString(); + path += item.testFunction; path += mapped.value(PI_QtVersion); path += mapped.value(PI_QMakeSpec); path += mapped.value(PI_HostName); @@ -397,6 +397,7 @@ QString BaselineHandler::updateSingleBaseline(const QString &oldBaseline, const return res; } + QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist) { QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST")); @@ -439,11 +440,10 @@ void BaselineHandler::testPathMapping() << QLS("localhost"); ImageItem item; - item.scriptName = QLS("arcs.qps"); - item.engine = ImageItem::Raster; - item.renderFormat = QImage::Format_ARGB32_Premultiplied; + item.testFunction = QLS("testPathMapping"); + item.itemName = QLS("arcs.qps"); item.imageChecksums << 0x0123456789abcdefULL; - item.scriptChecksum = 0x0123; + item.itemChecksum = 0x0123; plat.insert(PI_QtVersion, QLS("4.8.0")); plat.insert(PI_BuildKey, QLS("(nobuildkey)")); diff --git a/tests/arthur/baselineserver/src/htmlpage.cpp b/tests/arthur/baselineserver/src/htmlpage.cpp index 11c2eac..2b16d25 100644 --- a/tests/arthur/baselineserver/src/htmlpage.cpp +++ b/tests/arthur/baselineserver/src/htmlpage.cpp @@ -69,7 +69,7 @@ void HTMLPage::start(const QString &storagepath, const QString &runId, const Pla ctx = context; root = storagepath + QLC('/'); imageItems = itemList; - reportDir = pinfo.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/"); + reportDir = pinfo.value(PI_TestCase) + QLC('/') + (pinfo.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/")); QString dir = root + reportDir; QDir cwd; if (!cwd.exists(dir)) @@ -79,8 +79,7 @@ void HTMLPage::start(const QString &storagepath, const QString &runId, const Pla void HTMLPage::writeHeader(const ImageItem &item) { - path = reportDir + id + QLC('_') + item.engineAsString() - + QLC('_') + item.formatAsString() + QLS(".html"); + path = reportDir + id + QLC('_') + item.testFunction + QLS(".html"); QString pageUrl = BaselineServer::baseUrl() + path; @@ -126,7 +125,7 @@ void HTMLPage::addItem(const QString &baseline, const QString &rendered, const I QString pageUrl = BaselineServer::baseUrl() + path; out << "<tr>\n"; - out << "<td>" << item.scriptName << "</td>\n"; + out << "<td>" << item.itemName << "</td>\n"; QStringList images = QStringList() << baseline << rendered << compared; foreach(const QString& img, images) out << "<td><a href=\"/" << img << "\"><img src=\"/" << generateThumbnail(img) << "\" width=240 height=240></a></td>\n"; @@ -135,7 +134,7 @@ void HTMLPage::addItem(const QString &baseline, const QString &rendered, const I << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&oldBaseline=" << baseline << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Replace baseline with rendered</a></p>\n" << "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx - << "&itemId=" << item.scriptName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n" + << "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n" << "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered << "&compared=" << compared << "&url=" << pageUrl << "\">View</a></p>\n" << "</td>\n"; @@ -144,7 +143,7 @@ void HTMLPage::addItem(const QString &baseline, const QString &rendered, const I QMutableVectorIterator<ImageItem> it(imageItems); while (it.hasNext()) { it.next(); - if (it.value().scriptName == item.scriptName) { + if (it.value().itemName == item.itemName) { it.remove(); break; } @@ -158,11 +157,11 @@ void HTMLPage::end() // Add the names of the scripts that passed the test, or were blacklisted QString pageUrl = BaselineServer::baseUrl() + path; for (int i=0; i<imageItems.count(); ++i) { - out << "<tr><td>" << imageItems.at(i).scriptName << "</td><td>N/A</td><td>N/A</td><td>N/A</td><td>"; + out << "<tr><td>" << imageItems.at(i).itemName << "</td><td>N/A</td><td>N/A</td><td>N/A</td><td>"; if (imageItems.at(i).status == ImageItem::IgnoreItem) { out << "<span style=\"background-color:yellow\">Blacklisted</span> " << "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&context=" << ctx - << "&itemId=" << imageItems.at(i).scriptName << "&url=" << pageUrl + << "&itemId=" << imageItems.at(i).itemName << "&url=" << pageUrl << "\">Whitelist item</a>"; } else { out << "<span style=\"color:green\">Test passed</span>"; |