summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-11-16 03:31:47 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-11-16 03:41:55 (GMT)
commit7c40149cf63877ee3d29ec34826ed2a63b4908f2 (patch)
treed88b19a5f017400283ae13e493e79e62247f91b4 /tools
parent83e0577412ca18eff3e39b7882deb885179f982b (diff)
downloadQt-7c40149cf63877ee3d29ec34826ed2a63b4908f2.zip
Qt-7c40149cf63877ee3d29ec34826ed2a63b4908f2.tar.gz
Qt-7c40149cf63877ee3d29ec34826ed2a63b4908f2.tar.bz2
Turn off font antialiasing during tests.
Font antialiasing varies from machine to machine, and so is too unstable Also switching to a monospaced font in visual tests to attempt to pre-empt another possible source of instability. This commit also slightly increases verbosity of test failure messages to be more useful in the CI system Task-number: QTBUG-14792
Diffstat (limited to 'tools')
-rw-r--r--tools/qml/qdeclarativetester.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/qml/qdeclarativetester.cpp b/tools/qml/qdeclarativetester.cpp
index 499822a..e2a90cc 100644
--- a/tools/qml/qdeclarativetester.cpp
+++ b/tools/qml/qdeclarativetester.cpp
@@ -62,6 +62,12 @@ QDeclarativeTester::QDeclarativeTester(const QString &script, QDeclarativeViewer
parent->viewport()->installEventFilter(this);
parent->installEventFilter(this);
QUnifiedTimer::instance()->setConsistentTiming(true);
+
+ //Font antialiasing makes tests system-specific, so disable it
+ QFont noAA = QApplication::font();
+ noAA.setStyleStrategy(QFont::NoAntialias);
+ QApplication::setFont(noAA);
+
if (options & QDeclarativeViewer::Play)
this->run();
start();
@@ -268,14 +274,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (options & QDeclarativeViewer::TestImages) {
img.fill(qRgb(255,255,255));
-#ifdef Q_WS_MAC
- bool oldSmooth = qt_applefontsmoothing_enabled;
- qt_applefontsmoothing_enabled = false;
-#endif
QPainter p(&img);
-#ifdef Q_WS_MAC
- qt_applefontsmoothing_enabled = oldSmooth;
-#endif
m_view->render(&p);
}
@@ -337,14 +336,14 @@ void QDeclarativeTester::updateCurrentTime(int msec)
if (QDeclarativeVisualTestFrame *frame = qobject_cast<QDeclarativeVisualTestFrame *>(event)) {
if (frame->msec() < msec) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Extra frame. Seen:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Extra frame. Seen:"
<< msec << "Expected:" << frame->msec();
imagefailure();
}
} else if (frame->msec() == msec) {
if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) {
if (options & QDeclarativeViewer::TestImages && !(options & QDeclarativeViewer::Record)) {
- qWarning() << "QDeclarativeTester: Mismatched frame hash at" << msec
+ qWarning() << "QDeclarativeTester(" << m_script << "): Mismatched frame hash at" << msec
<< ". Seen:" << fe.hash.toHex()
<< "Expected:" << frame->hash().toUtf8();
imagefailure();
@@ -363,7 +362,7 @@ void QDeclarativeTester::updateCurrentTime(int msec)
}
if (goodImage != img) {
QString reject(frame->image().toLocalFile() + ".reject.png");
- qWarning() << "QDeclarativeTester: Image mismatch. Reject saved to:"
+ qWarning() << "QDeclarativeTester(" << m_script << "): Image mismatch. Reject saved to:"
<< reject;
img.save(reject);
bool doDiff = (goodImage.size() == img.size());