From 74cadacdd5f571dfbab0e8b5f626bee79761c549 Mon Sep 17 00:00:00 2001 From: aavit Date: Thu, 1 Sep 2011 14:50:59 +0200 Subject: 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 Reviewed-by: Jiang Jiang --- tests/baselineserver/src/report.cpp | 49 ++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'tests/baselineserver/src/report.cpp') 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() << "

Note: This is a static page, generated at " << QDateTime::currentDateTime().toString() << " for the test run with id " << runId << "

\n" << "

Summary: " << numMismatches << " of " << numItems << " items reported mismatching

\n\n"; - out << "

Platform Info:

\n" + out << "

Testing Client Platform Info:

\n" << "\n"; foreach (QString key, plat.keys()) - out << "\n"; + out << "\n"; out << "
" << key << "" << plat.value(key) << "
" << key << ":" << plat.value(key) << "
\n\n"; + if (hasOverride) { + out << "

Note! Platform Override Info:

\n" + << "

The client's output has been compared to baselines created on a different platform. Differences:

\n" + << "\n"; + for (int i = 0; i < plat.overrides().size()-1; i+=2) + out << "\n"; + out << "
" << plat.overrides().at(i) << ":" << plat.overrides().at(i+1) << "
\n\n"; + } } @@ -158,10 +167,12 @@ void Report::writeFunctionResults(const ImageItemList &list) out << "\n

 

Test function: " << testFunction << "

\n"; - out << "

Clear all baselines for this testfunction (They will be recreated by the next run)

\n"; - out << "

Let these mismatching images be the new baselines for this testfunction

\n\n"; + if (!hasOverride) { + out << "

Clear all baselines for this testfunction (They will be recreated by the next run)

\n"; + out << "

Let these mismatching images be the new baselines for this testfunction

\n\n"; + } out << "\n" "\n" @@ -192,10 +203,12 @@ void Report::writeFunctionResults(const ImageItemList &list) out << "Baseline not found/regenerated"; break; case ImageItem::IgnoreItem: - out << "Blacklisted " - << "Whitelist this item"; + out << "Blacklisted "; + if (!hasOverride) { + out << "Whitelist this item"; + } break; case ImageItem::Ok: out << "No mismatch reported"; @@ -224,12 +237,14 @@ void Report::writeItem(const QString &baseline, const QString &rendered, const I out << "\n"; } -- cgit v1.2.3
\n" << "

Mismatch reported

\n" - << "

Baseline Info\n" - << "

Let this be the new baseline

\n" - << "

Blacklist this item

\n" - << "

Baseline Info\n"; + if (!hasOverride) { + out << "

Let this be the new baseline

\n" + << "

Blacklist this item

\n"; + } + out << "

Inspect

\n" << "