diff options
author | aavit <qt-info@nokia.com> | 2010-08-30 07:46:10 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-08-30 07:46:10 (GMT) |
commit | ab6a22fd0d414a8c7a9c3875cf1599516c0c6ff3 (patch) | |
tree | ea6283ec5198e800b9da4c01938141591ce45923 /tests/auto/lancelot | |
parent | aabb19f90c93a12a1458c96d7e6baf6632a79098 (diff) | |
download | Qt-ab6a22fd0d414a8c7a9c3875cf1599516c0c6ff3.zip Qt-ab6a22fd0d414a8c7a9c3875cf1599516c0c6ff3.tar.gz Qt-ab6a22fd0d414a8c7a9c3875cf1599516c0c6ff3.tar.bz2 |
Experiment with generating and storing the diff image also on failure
Diffstat (limited to 'tests/auto/lancelot')
-rw-r--r-- | tests/auto/lancelot/tst_lancelot.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp index 1b832c6..f1c6e5c 100644 --- a/tests/auto/lancelot/tst_lancelot.cpp +++ b/tests/auto/lancelot/tst_lancelot.cpp @@ -160,6 +160,19 @@ void tst_Lancelot::testRendering() if (rendered != baseline) { QByteArray failMsg; proto.submitMismatch(fileName, rendered, &failMsg); + +#if 1 + // Also generate & submit the diff image + QImage diff(rendered.size(), QImage::Format_RGB32); + diff.fill(0); + QPainter p(&diff); + p.drawImage(0, 0, rendered); + p.setCompositionMode(QPainter::RasterOp_SourceXorDestination); + p.drawImage(0, 0, baseline); + p.end(); + proto.submitMismatch(fileName + QLatin1String("_diff"), diff, 0); +#endif + failMsg.prepend("Rendered image differs from baseline. "); QFAIL(failMsg.constData()); } |