From 4672ff71c5c02b13b6435594cc55638d428053ab Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 19 Jan 2011 15:31:25 +0100 Subject: Re-added the update-all-baselines command --- tests/arthur/baselineserver/src/baselineserver.cpp | 34 ++++++++++------------ tests/arthur/baselineserver/src/baselineserver.h | 2 +- tests/arthur/baselineserver/src/report.cpp | 26 +++++++++++++---- tests/arthur/baselineserver/src/report.h | 2 +- 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 8aaa8ff..75309a4 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -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 &itemId) { - 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
" - "Command output:
%2
").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 = (itemId.isEmpty() ? QLS("*") : itemId) + QLS("_????."); // Match any checksum. #vulnerable to changes in file naming + 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..0f14c8c 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 &itemId); 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..217b92c 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

 

Test function: " << testFunction << "

\n"; out << "

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

\n\n"; + << "\">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" @@ -176,7 +180,7 @@ 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); + writeItem(baseline, rendered, item, ctx, misCtx, metadata); } else { out << "\n" @@ -207,7 +211,7 @@ void Report::writeFunctionResults(const ImageItemList &list) out << "
image info
\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 &ctx, const QString &misCtx, const QString &metadata) { QString compared = generateCompared(baseline, rendered); QString pageUrl = BaselineServer::baseUrl() + path; @@ -219,8 +223,13 @@ void Report::writeItem(const QString &baseline, const QString &rendered, const I out << "\n" << "

Mismatch reported

\n" << "

Baseline Info\n" +#if 0 << "

Replace baseline with rendered

\n" + << "&newBaseline=" << rendered << "&url=" << pageUrl << "\">Let this be the new baseline

\n" +#else + << "

Let this be the new baseline

\n" +#endif << "

Blacklist this item

\n" << "

Date: Wed, 26 Jan 2011 14:52:55 +0100 Subject: Updated for new git repo structure --- tests/arthur/baselineserver/src/baselineserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index 75309a4..fef592e 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(); -- cgit v0.12 From 3024ff7d32e1c902580bff3fcdb0232afab43c75 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 28 Jan 2011 11:52:44 +0100 Subject: Make updating single baseline work again --- tests/arthur/baselineserver/src/baselineserver.cpp | 4 ++-- tests/arthur/baselineserver/src/baselineserver.h | 2 +- tests/arthur/baselineserver/src/report.cpp | 15 ++++++--------- tests/arthur/baselineserver/src/report.h | 3 ++- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/arthur/baselineserver/src/baselineserver.cpp b/tests/arthur/baselineserver/src/baselineserver.cpp index fef592e..d3710ac 100644 --- a/tests/arthur/baselineserver/src/baselineserver.cpp +++ b/tests/arthur/baselineserver/src/baselineserver.cpp @@ -426,13 +426,13 @@ 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::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemId) +QString BaselineHandler::updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemFile) { int tot = 0; int failed = 0; QString storagePrefix = BaselineServer::storagePath() + QLC('/'); // If itemId is set, update just that one, otherwise, update all: - QString filter = (itemId.isEmpty() ? QLS("*") : itemId) + QLS("_????."); // Match any checksum. #vulnerable to changes in file naming + QString filter = itemFile.isEmpty() ? QLS("*_????.") : itemFile; QDirIterator it(storagePrefix + mismatchContext, QStringList() << filter + QLS(FileFormat) << filter + QLS(MetadataFileExt)); while (it.hasNext()) { tot++; diff --git a/tests/arthur/baselineserver/src/baselineserver.h b/tests/arthur/baselineserver/src/baselineserver.h index 0f14c8c..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 updateBaselines(const QString &context, const QString &mismatchContext, const QString &itemId); + 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 217b92c..88b5625 100644 --- a/tests/arthur/baselineserver/src/report.cpp +++ b/tests/arthur/baselineserver/src/report.cpp @@ -180,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, misCtx, metadata); + QString itemFile = prefix.section(QLC('/'), -1); + writeItem(baseline, rendered, item, itemFile, ctx, misCtx, metadata); } else { out << "image info\n" @@ -211,7 +212,8 @@ void Report::writeFunctionResults(const ImageItemList &list) out << "\n"; } -void Report::writeItem(const QString &baseline, const QString &rendered, const ImageItem &item, const QString &ctx, const QString &misCtx, 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; @@ -223,13 +225,8 @@ void Report::writeItem(const QString &baseline, const QString &rendered, const I out << "\n" << "

Mismatch reported

\n" << "

Baseline Info\n" -#if 0 - << "

Let this be the new baseline

\n" -#else << "

Let this be the new baseline

\n" -#endif + << "&itemFile=" << itemFile << "&url=" << pageUrl << "\">Let this be the new baseline

\n" << "

Blacklist this item

\n" << "

Date: Tue, 1 Mar 2011 12:24:23 +0100 Subject: Build fix for shadow built Qt --- tests/auto/baselineexample/baselineexample.pro | 2 +- tests/auto/lancelot/lancelot.pro | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 -- cgit v0.12 From a3a79fefe65ec12c4c34a69885c2d23d79538a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 4 Mar 2011 10:29:46 +0100 Subject: Fail in a nicer way when QPixmap is used in a non-GUI application. Show same fatal message as when trying to instantiate a QWidget. Task-number: QTBUG-17873 Reviewed-by: Gunnar Sletta --- src/gui/image/qpixmap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index f896572..71fb079 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -112,8 +112,13 @@ void QPixmap::init(int w, int h, Type type) init(w, h, int(type)); } +extern QApplication::Type qt_appType; + void QPixmap::init(int w, int h, int type) { + if (qt_appType == QApplication::Tty) + qFatal("QPixmap: Cannot create a QPixmap when no GUI is being used"); + if ((w > 0 && h > 0) || type == QPixmapData::BitmapType) data = QPixmapData::create(w, h, (QPixmapData::PixelType) type); else -- cgit v0.12 From bfcd2cabf7b5bc15105c968f80f71132efb65759 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 3 Mar 2011 18:39:51 +0100 Subject: Place cursor at the end of the selected range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Selected range is the range of the text that has been edited with input method, but not yet committed, normally the cursor should be placed that the end of it (or hidden). Task-number: QTBUG-17923 Reviewed-by: Morten Sørvig --- src/gui/kernel/qcocoaview_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ff2dfe7..5e8b37e 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -983,7 +983,7 @@ static int qCocoaViewCount = 0; QString qtText; // Cursor position is retrived from the range. QList attrs; - attrs<([aString string])); composingLength = qtText.length(); -- cgit v0.12 From 9326d1b80e34a03bf221fca46eb46fbf6420b4d9 Mon Sep 17 00:00:00 2001 From: aavit Date: Fri, 4 Mar 2011 14:47:10 +0100 Subject: Improved error msg --- tests/arthur/common/baselineprotocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v0.12 From 39f2c09d9154e00409c73c6f6db90a4ddb06b8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 7 Mar 2011 10:01:51 +0100 Subject: Fixed auto-test failures caused by a3a79fefe65ec12. QPixmaps might be unintentionally created through QVariant streaming for example, so to prevent breaking existing applications we should just use a warning instead, when creating a QPixmap in a non-GUI application. Task-number: QTBUG-17873 Reviewed-by: aavit --- src/gui/image/qpixmap.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 71fb079..be0ad4a 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -116,8 +116,11 @@ extern QApplication::Type qt_appType; void QPixmap::init(int w, int h, int type) { - if (qt_appType == QApplication::Tty) - qFatal("QPixmap: Cannot create a QPixmap when no GUI is being used"); + if (qt_appType == QApplication::Tty) { + qWarning("QPixmap: Cannot create a QPixmap when no GUI is being used"); + data = 0; + return; + } if ((w > 0 && h > 0) || type == QPixmapData::BitmapType) data = QPixmapData::create(w, h, (QPixmapData::PixelType) type); -- cgit v0.12 From fe02247a72467f8bd95c0e68c316c1d71f8e0c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 7 Mar 2011 10:44:12 +0100 Subject: Removed obsolete documentation from QPixmap. This documentation is misleading, as the internal representation of a QPixmap is not guaranteed to be RGB32 or ARGB32_Premultiplied, and whether it's stored client side or server side also depends on the graphicssystem. Reviewed-by: Jani Hautakangas --- src/gui/image/qpixmap.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index be0ad4a..021f281 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1644,16 +1644,6 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) {Implicit Data Sharing} documentation. QPixmap objects can also be streamed. - Depending on the system, QPixmap is stored using a RGB32 or a - premultiplied alpha format. If the image has an alpha channel, and - if the system allows, the preferred format is premultiplied alpha. - Note also that QPixmap, unlike QImage, may be hardware dependent. - On X11, Mac and Symbian, a QPixmap is stored on the server side while - a QImage is stored on the client side (on Windows, these two classes - have an equivalent internal representation, i.e. both QImage and - QPixmap are stored on the client side and don't use any GDI - resources). - Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because QPixmap is a QPaintDevice subclass, QPainter can be used to draw directly onto pixmaps. -- cgit v0.12