diff options
author | aavit <qt-info@nokia.com> | 2010-08-30 09:46:10 +0200 |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-08-30 09:46:10 +0200 |
commit | ab6a22fd0d414a8c7a9c3875cf1599516c0c6ff3 (patch) | |
tree | ea6283ec5198e800b9da4c01938141591ce45923 /tests/auto/lancelot | |
parent | aabb19f90c93a12a1458c96d7e6baf6632a79098 (diff) |
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 1b832c6eab..f1c6e5c1a2 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()); } |