summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-09 20:19:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-09 20:19:33 (GMT)
commiteec2c615443d02ea5d9b2407336218c55956151e (patch)
treec0718c2b03df45f56a3d3536f5780c308ca21067 /tests
parent68229f50480f4b3768e64cdba4d5ca0cc9534aa7 (diff)
parentd20a1d3ba89dfb75fec829128b89603f89337624 (diff)
downloadQt-eec2c615443d02ea5d9b2407336218c55956151e.zip
Qt-eec2c615443d02ea5d9b2407336218c55956151e.tar.gz
Qt-eec2c615443d02ea5d9b2407336218c55956151e.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Removed obsolete documentation from QPixmap. Fixed auto-test failures caused by a3a79fefe65ec12. Improved error msg Place cursor at the end of the selected range Fail in a nicer way when QPixmap is used in a non-GUI application. Build fix for shadow built Qt Make updating single baseline work again Updated for new git repo structure Re-added the update-all-baselines command
Diffstat (limited to 'tests')
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.cpp36
-rw-r--r--tests/arthur/baselineserver/src/baselineserver.h2
-rw-r--r--tests/arthur/baselineserver/src/report.cpp25
-rw-r--r--tests/arthur/baselineserver/src/report.h3
-rw-r--r--tests/arthur/common/baselineprotocol.cpp2
-rw-r--r--tests/auto/baselineexample/baselineexample.pro2
-rw-r--r--tests/auto/lancelot/lancelot.pro8
7 files changed, 44 insertions, 34 deletions
diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp
index 8aaa8ff..d3710ac 100644
--- a/tests/arthur/baselineserver/src/baselineserver.cpp
+++ b/tests/arthur/baselineserver/src/baselineserver.cpp
@@ -178,7 +178,7 @@ bool BaselineHandler::establishConnection()
if (branch.isEmpty()) {
// Not run by Pulse, i.e. ad hoc run: Ok.
}
- else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration"))) {
+ else if (branch != QLS("master-integration") || !plat.value(PI_GitCommit).contains(QLS("Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration"))) {
qDebug() << runId << logtime() << "Did not pass branch/staging repo filter, disconnecting.";
proto.sendBlock(BaselineProtocol::Abort, QByteArray("This branch/staging repo is not assigned to be tested."));
proto.socket.disconnectFromHost();
@@ -426,27 +426,25 @@ QString BaselineHandler::clearAllBaselines(const QString &context)
return QString(QLS("%1 of %2 baselines cleared from context ")).arg((tot-failed)/2).arg(tot/2) + context;
}
-QString BaselineHandler::updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline)
+QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile)
{
- QString res;
- QString basePath(BaselineServer::storagePath() + QLC('/'));
- QString srcBase(basePath + newBaseline.left(newBaseline.length() - 3));
- QString dstDir(basePath + oldBaseline.left(oldBaseline.lastIndexOf(QLC('/'))));
-
- QProcess proc;
- proc.setProcessChannelMode(QProcess::MergedChannels);
- proc.start(QLS("cp"), QStringList() << QLS("-f") << srcBase + QLS(FileFormat) << srcBase + QLS(MetadataFileExt) << dstDir);
- proc.waitForFinished();
- if (proc.exitCode() == 0)
- res = QString("Successfully updated '%1'").arg(oldBaseline);
- else
- res = QString("Error updating baseline: %1<br>"
- "Command output: <pre>%2</pre>").arg(proc.errorString(), proc.readAll().constData());
-
- return res;
+ int tot = 0;
+ int failed = 0;
+ QString storagePrefix = BaselineServer::storagePath() + QLC('/');
+ // If itemId is set, update just that one, otherwise, update all:
+ QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile;
+ QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt));
+ while (it.hasNext()) {
+ tot++;
+ it.next();
+ QString oldFile = storagePrefix + context + QLC('/') + it.fileName();
+ QFile::remove(oldFile); // Remove existing baseline file
+ if (!QFile::copy(it.filePath(), oldFile)) // and replace it with the mismatch
+ failed++;
+ }
+ return QString(QLS("%1 of %2 baselines updated in context %3 from context %4")).arg((tot-failed)/2).arg(tot/2).arg(context, mismatchContext);
}
-
QString BaselineHandler::blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist)
{
QFile file(BaselineServer::storagePath() + QLC('/') + context + QLS("/BLACKLIST"));
diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h
index a5683b2..33b2ed7 100644
--- a/tests/arthur/baselineserver/src/baselineserver.h
+++ b/tests/arthur/baselineserver/src/baselineserver.h
@@ -109,7 +109,7 @@ public:
// CGI callbacks:
static QString view(const QString &baseline, const QString &rendered, const QString &compared);
static QString clearAllBaselines(const QString &context);
- static QString updateSingleBaseline(const QString &oldBaseline, const QString &newBaseline);
+ static QString updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile);
static QString blacklistTest(const QString &context, const QString &itemId, bool removeFromBlacklist = false);
private slots:
diff --git a/tests/arthur/baselineserver/src/report.cpp b/tests/arthur/baselineserver/src/report.cpp
index c85f144..88b5625 100644
--- a/tests/arthur/baselineserver/src/report.cpp
+++ b/tests/arthur/baselineserver/src/report.cpp
@@ -154,10 +154,14 @@ void Report::writeFunctionResults(const ImageItemList &list)
QString testFunction = list.at(0).testFunction;
QString pageUrl = BaselineServer::baseUrl() + path;
QString ctx = handler->pathForItem(list.at(0), true, false).section(QLC('/'), 0, -2);
+ QString misCtx = handler->pathForItem(list.at(0), false, false).section(QLC('/'), 0, -2);
+
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><big>Clear all baselines</big></b></a></h3> (They will be recreated by the next run)</p>\n\n";
+ << "\"><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"
@@ -176,7 +180,8 @@ void Report::writeFunctionResults(const ImageItemList &list)
QString metadata = prefix + QLS(MetadataFileExt);
if (item.status == ImageItem::Mismatch) {
QString rendered = handler->pathForItem(item, false, false) + QLS(FileFormat);
- writeItem(baseline, rendered, item, ctx, metadata);
+ QString itemFile = prefix.section(QLC('/'), -1);
+ writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata);
}
else {
out << "<td align=center><a href=\"/" << baseline << "\">image</a> <a href=\"/" << metadata << "\">info</a></td>\n"
@@ -207,7 +212,8 @@ void Report::writeFunctionResults(const ImageItemList &list)
out << "</table>\n";
}
-void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx, const QString &metadata)
+void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata)
{
QString compared = generateCompared(baseline, rendered);
QString pageUrl = BaselineServer::baseUrl() + path;
@@ -219,8 +225,8 @@ 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&oldBaseline=" << baseline
- << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Replace baseline with rendered</a></p>\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
@@ -280,8 +286,13 @@ void Report::handleCGIQuery(const QString &query)
cgiUrl.queryItemValue(QLS("compared")));
}
else if (command == QLS("updateSingleBaseline")) {
- s << BaselineHandler::updateSingleBaseline(cgiUrl.queryItemValue(QLS("oldBaseline")),
- cgiUrl.queryItemValue(QLS("newBaseline")));
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ cgiUrl.queryItemValue(QLS("itemFile")));
+ } else if (command == QLS("updateAllBaselines")) {
+ s << BaselineHandler::updateBaselines(cgiUrl.queryItemValue(QLS("context")),
+ cgiUrl.queryItemValue(QLS("mismatchContext")),
+ QString());
} else if (command == QLS("clearAllBaselines")) {
s << BaselineHandler::clearAllBaselines(cgiUrl.queryItemValue(QLS("context")));
} else if (command == QLS("blacklist")) {
diff --git a/tests/arthur/baselineserver/src/report.h b/tests/arthur/baselineserver/src/report.h
index a56aafb..685539e 100644
--- a/tests/arthur/baselineserver/src/report.h
+++ b/tests/arthur/baselineserver/src/report.h
@@ -67,7 +67,8 @@ public:
private:
void write();
void writeFunctionResults(const ImageItemList &list);
- void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx, const QString &metadata);
+ void writeItem(const QString &baseline, const QString &rendered, const ImageItem &item,
+ const QString &itemFile, const QString &ctx, const QString &misCtx, const QString &metadata);
void writeHeader();
void writeFooter();
QString generateCompared(const QString &baseline, const QString &rendered, bool fuzzy = false);
diff --git a/tests/arthur/common/baselineprotocol.cpp b/tests/arthur/common/baselineprotocol.cpp
index e4445bd..cff74cc 100644
--- a/tests/arthur/common/baselineprotocol.cpp
+++ b/tests/arthur/common/baselineprotocol.cpp
@@ -310,7 +310,7 @@ bool BaselineProtocol::connect(const QString &testCase, bool *dryrun)
}
if (cmd == Abort) {
- errMsg += QLS("Server aborted connection. Reason: ") + QString::fromLatin1(block);
+ errMsg += QLS("Server rejected connection. Reason: ") + QString::fromLatin1(block);
return false;
}
diff --git a/tests/auto/baselineexample/baselineexample.pro b/tests/auto/baselineexample/baselineexample.pro
index 30feecc..13f03b8 100644
--- a/tests/auto/baselineexample/baselineexample.pro
+++ b/tests/auto/baselineexample/baselineexample.pro
@@ -15,4 +15,4 @@ TEMPLATE = app
SOURCES += tst_baselineexample.cpp
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
+include($$PWD/../../arthur/common/qbaselinetest.pri)
diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro
index 93841a3..11beb7e 100644
--- a/tests/auto/lancelot/lancelot.pro
+++ b/tests/auto/lancelot/lancelot.pro
@@ -3,11 +3,11 @@ QT += xml svg
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
SOURCES += tst_lancelot.cpp \
- $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.cpp
-HEADERS += $$QT_SOURCE_TREE/tests/arthur/common/paintcommands.h
-RESOURCES += $$QT_SOURCE_TREE/tests/arthur/common/images.qrc
+ $$PWD/../../arthur/common/paintcommands.cpp
+HEADERS += $$PWD/../../arthur/common/paintcommands.h
+RESOURCES += $$PWD/../../arthur/common/images.qrc
-include($$QT_SOURCE_TREE/tests/arthur/common/qbaselinetest.pri)
+include($$PWD/../../arthur/common/qbaselinetest.pri)
!symbian:!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
linux-g++-maemo:DEFINES += USE_RUNTIME_DIR