summaryrefslogtreecommitdiffstats
path: root/tests/baselineserver/src/report.cpp
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-09-01 14:50:59 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-01 16:14:18 +0200
commit74cadacdd5f571dfbab0e8b5f626bee79761c549 (patch)
tree23d7a6de0fa6b42ba3cc345d3fb94f33af333ede /tests/baselineserver/src/report.cpp
parent9bb0cc30ee8566e8c99865a657afd275d2d2f477 (diff)
Add option to compare to different platform in lancelot autotest
(cherry picked from commit b6b160d9ba1e0a5f1fbd67112f8c78ba48e7cad7) Conflicts: tests/baselineserver/src/baselineserver.cpp Change-Id: Ie8bdff26b8394bb6a5b6b48225b20833dbee0637 Reviewed-on: http://codereview.qt.nokia.com/4082 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests/baselineserver/src/report.cpp')
-rw-r--r--tests/baselineserver/src/report.cpp49
1 files changed, 32 insertions, 17 deletions
diff --git a/tests/baselineserver/src/report.cpp b/tests/baselineserver/src/report.cpp
index 7c2d6ac6df..16f061c7e7 100644
--- a/tests/baselineserver/src/report.cpp
+++ b/tests/baselineserver/src/report.cpp
@@ -66,12 +66,13 @@ void Report::init(const BaselineHandler *h, const QString &r, const PlatformInfo
runId = r;
plat = p;
rootDir = BaselineServer::storagePath() + QLC('/');
- reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.value(PI_PulseGitBranch).isEmpty() ? QLS("reports/adhoc/") : QLS("reports/pulse/"));
+ reportDir = plat.value(PI_TestCase) + QLC('/') + (plat.isAdHocRun() ? QLS("reports/adhoc/") : QLS("reports/pulse/"));
QString dir = rootDir + reportDir;
QDir cwd;
if (!cwd.exists(dir))
cwd.mkpath(dir);
path = reportDir + QLS("Report_") + runId + QLS(".html");
+ hasOverride = !plat.overrides().isEmpty();
}
void Report::addItems(const ImageItemList &items)
@@ -141,11 +142,19 @@ void Report::writeHeader()
<< "<p>Note: This is a <i>static</i> page, generated at " << QDateTime::currentDateTime().toString()
<< " for the test run with id " << runId << "</p>\n"
<< "<p>Summary: <b><span style=\"color:red\">" << numMismatches << " of " << numItems << "</b></span> items reported mismatching</p>\n\n";
- out << "<h3>Platform Info:</h3>\n"
+ out << "<h3>Testing Client Platform Info:</h3>\n"
<< "<table>\n";
foreach (QString key, plat.keys())
- out << "<tr><td>" << key << "</td><td>" << plat.value(key) << "</td></tr>\n";
+ out << "<tr><td>" << key << ":</td><td>" << plat.value(key) << "</td></tr>\n";
out << "</table>\n\n";
+ if (hasOverride) {
+ out << "<span style=\"color:red\"><h4>Note! Platform Override Info:</h4></span>\n"
+ << "<p>The client's output has been compared to baselines created on a different platform. Differences:</p>\n"
+ << "<table>\n";
+ for (int i = 0; i < plat.overrides().size()-1; i+=2)
+ out << "<tr><td>" << plat.overrides().at(i) << ":</td><td>" << plat.overrides().at(i+1) << "</td></tr>\n";
+ out << "</table>\n\n";
+ }
}
@@ -158,10 +167,12 @@ void Report::writeFunctionResults(const ImageItemList &list)
out << "\n<p>&nbsp;</p><h3>Test function: " << testFunction << "</h3>\n";
- out << "<p><a href=\"/cgi-bin/server.cgi?cmd=clearAllBaselines&context=" << ctx << "&url=" << pageUrl
- << "\"><b>Clear all baselines</b></a> for this testfunction (They will be recreated by the next run)</p>\n";
- out << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&context=" << ctx << "&mismatchContext=" << misCtx << "&url=" << pageUrl
- << "\"><b>Let these mismatching images be the new baselines</b></a> for this testfunction</p>\n\n";
+ if (!hasOverride) {
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=clearAllBaselines&context=" << ctx << "&url=" << pageUrl
+ << "\"><b>Clear all baselines</b></a> for this testfunction (They will be recreated by the next run)</p>\n";
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateAllBaselines&context=" << ctx << "&mismatchContext=" << misCtx << "&url=" << pageUrl
+ << "\"><b>Let these mismatching images be the new baselines</b></a> for this testfunction</p>\n\n";
+ }
out << "<table border=\"2\">\n"
"<tr>\n"
@@ -192,10 +203,12 @@ void Report::writeFunctionResults(const ImageItemList &list)
out << "Baseline not found/regenerated";
break;
case ImageItem::IgnoreItem:
- out << "<span style=\"background-color:yellow\">Blacklisted</span> "
- << "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&context=" << ctx
- << "&itemId=" << item.itemName << "&url=" << pageUrl
- << "\">Whitelist this item</a>";
+ out << "<span style=\"background-color:yellow\">Blacklisted</span> ";
+ if (!hasOverride) {
+ out << "<a href=\"/cgi-bin/server.cgi?cmd=whitelist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl
+ << "\">Whitelist this item</a>";
+ }
break;
case ImageItem::Ok:
out << "<span style=\"color:green\"><small>No mismatch reported</small></span>";
@@ -224,12 +237,14 @@ void Report::writeItem(const QString &baseline, const QString &rendered, const I
out << "<td align=center>\n"
<< "<p><span style=\"color:red\">Mismatch reported</span></p>\n"
- << "<p><a href=\"/" << metadata << "\">Baseline Info</a>\n"
- << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&context=" << ctx << "&mismatchContext=" << misCtx
- << "&itemFile=" << itemFile << "&url=" << pageUrl << "\">Let this be the new baseline</a></p>\n"
- << "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx
- << "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n"
- << "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered
+ << "<p><a href=\"/" << metadata << "\">Baseline Info</a>\n";
+ if (!hasOverride) {
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=updateSingleBaseline&context=" << ctx << "&mismatchContext=" << misCtx
+ << "&itemFile=" << itemFile << "&url=" << pageUrl << "\">Let this be the new baseline</a></p>\n"
+ << "<p><a href=\"/cgi-bin/server.cgi?cmd=blacklist&context=" << ctx
+ << "&itemId=" << item.itemName << "&url=" << pageUrl << "\">Blacklist this item</a></p>\n";
+ }
+ out << "<p><a href=\"/cgi-bin/server.cgi?cmd=view&baseline=" << baseline << "&rendered=" << rendered
<< "&compared=" << compared << "&url=" << pageUrl << "\">Inspect</a></p>\n"
<< "</td>\n";
}